Code Monkey home page Code Monkey logo

mfx-migrator's Introduction

build coverage Go Report Card

mfx-migrator is a centralized daemon responsible for migrating data from the old MANY chain to the new MANIFEST chain. The daemon analyses the MANY chain for new migration-type transactions, processed them, and triggers token transaction on the MANIFEST chain.

This software is not for external use.

The complete migration flow is as follows:

  1. The user performs a migration transaction on the MANY chain using Alberto's Token Migration Portal.
  2. The transaction is processed by the MANY chain.
  3. The Talib block explorer picks up the transaction and stores it in its database.
  4. The mfx-migrator daemon claim new work items from the Talib database.
  5. The mfx-migrator daemon processes the work item and triggers a token transaction on the MANIFEST chain.
  6. The transaction is processed by the MANIFEST chain.
  7. The mfx-migrator daemon updates the work item status in the Talib database.

Requirements

  • Go programming language, version 1.22.1 or higher
  • GNU Make
  • Bash
  • (Optional) Docker (for running the E2E tests)

How to use

This section describes how to use the mfx-migrator software.

Global flags:

  • -l, --logLevel string - Set the log level. Possible values are debug, info, warn, and error. Default is info.
  • --neighborghood uint - The neighborhood ID to use. Default is 0.
  • --password string - The password to use for the remote database auth. Default is an empty string.
  • --url string - The root URL of the remote database API. Default is an empty string.
  • --username string - The username to use for the remote database auth. Default is an empty string.

Claim a work item

To claim a work item, run the following command:

mfx-migrator claim

Optional flags:

  • --force - Force the claim of a work item regardless of its status.
  • --uuid string - Claim a specific work item by UUID.

This command claims a work item from the remote database and store it in a file in the current directory. The file is named [UUID].json, where [UUID] is the UUID of the work item. The work item will be locked to prevent other workers from claiming it.

Migrate a work item

To migrate a claimed work item, run the following command:

mfx-migrator migrate [UUID]

where [UUID] is the UUID of the work item.

Flags:

  • --address-prefix string - Address prefix of the MANIFEST chain. Default is manifest.
  • --bank-address string - The address of the bank account to use for the token transaction on the MANIFEST chain. Default is bank.
  • --chain-home - The root directory of the chain configuration. Default is an empty string.
  • --chain-id string - The chain ID of the MANIFEST chain. Default is manifest-1.
  • --keyring-backend string - The keyring backend to use. Default is test.
  • --node-address - The RPC endpoint of the MANIFEST chain. Default is http://localhost:26657.
  • --uuid string - The UUID of the work item to migrate. Default is an empty string.
  • --binary - The name of the chain binary used to perform the migration. The binary must be in $PATH. Default is manifestd

This command triggers a token transaction on the MANIFEST chain and updates the work item status in the remote database.

Verify a work item

To verify a work item, run the following command:

mfx-migrator verify [UUID]

where [UUID] is the UUID of the work item.

Flags:

  • --uuid string - The UUID of the work item to verify. Default is an empty string.

This command verifies the status of the work item in the remote database.

Developers

Use the provided Makefile to execute common operations

help                           Display this help screen
build                          Build the project
clean                          Clean the project
install                        Install the project
lint                           Run linter (golangci-lint)
format                         Run formatter (goimports)
govulncheck                    Run govulncheck
vet                            Run go vet
coverage                       Run coverage report
test                           Run tests

mfx-migrator's People

Contributors

fmorency avatar dependabot[bot] avatar

Watchers

 avatar Eric Bravick avatar

mfx-migrator's Issues

MFX Migrator

MFX Migrator

As a user, I want to migrate tokens from the MANY chain to the MANIFEST chain.

Flow

  • User triggers a migration from Alberto's Token Migration Portal

    • The tokens are sent to the Illegal Address on the MANY chain.
    • The transaction Memo is formatted to contain a UUID and the destination address on the MANIFEST chain
  • Talib picks up new blocks/transactions and stores them in its database

    • New HTTP /migrations/* endpoints are exposed
  • The MFX Migrator continuously claims new work items from the /migrations endpoint

  • The MFX Migrator executes the token transfer on the MANIFEST chain from some bank account to the destination address.

TODO

  • Claim a work item from the database
  • Migrate tokens
  • Verify migration (manifest side)
  • Adequate tests
  • Adequate e2e tests

Parallel claim

Running claim fetches a single work item. Allow claiming multiple work items in a single call.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.