Skip to content

klayrHQ/klayr-migrator

 
 

Repository files navigation

Logo

Klayr Migrator

Klayr Migrator is a command line tool to migrate the blockchain data to the latest protocol when hard fork.

License: Apache 2.0 Code coverage DeepScan grade GitHub tag (latest by date) GitHub repo size GitHub issues GitHub closed issues

Installation

Dependencies

The following dependencies need to be installed in order to run applications created with the Klayr SDK:

Dependencies Version
NodeJS ^18.20.2
NPM 9.8.1 or later
Lisk Core 4.0.1 or later

NOTE: It is important that NodeJS is installed using NVM. Please refer our documentation here.

System requirements

The following system requirements are recommended to run Klayr Migrator v2.0.9:

Memory

  • Machines with a minimum of 4 GB RAM.

Storage

  • Machines with a minimum of 40 GB HDD.

Setup

Follow our Klayr Documentation guide for setting up the Klayr migrator.

Build Distributions (Linux, Darwin) from source

Clone the Klayr Migrator repository using Git and initialize the modules.

$ git clone https://github.com/klayrhq/klayr-migrator
$ cd klayr-migrator
$ git checkout $tag
$ nvm install $(cat .nvmrc)
$ npm install --global yarn
$ yarn; yarn build;
$ PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
$ ARCH=$(uname -m | sed 's/x86_64/x64/')
$ npx oclif-dev pack --targets=$PLATFORM-$ARCH

Using the Migrator

After building the binaries, please extract the appropriate tarball and add it the the PATH environment variable as shown below to continue with the usage.

Requires jq. If not already installed, please check https://jqlang.github.io/jq/download on how to install.

$ MIGRATOR_VERSION=$(jq -r .version < package.json)
$ PLATFORM=$(uname | tr '[:upper:]' '[:lower:]')
$ ARCH=$(uname -m | sed 's/x86_64/x64/')
$ mkdir ~/klayr-migrator-extract
$ find ./dist -name klayr-migrator-v$MIGRATOR_VERSION-$PLATFORM-$ARCH.tar.gz -exec cp {} ~/klayr-migrator-extract \;
$ tar -C ~/klayr-migrator-extract -xf ~/klayr-migrator-extract/klayr-migrator-v$MIGRATOR_VERSION-$PLATFORM-$ARCH.tar.gz
$ export PATH="$PATH:$HOME/klayr-migrator-extract/klayr-migrator/bin"
$ npm install -g klayr-migrator
$ lisk-migrator COMMAND
running command...
$ klayr-migrator (-v|--version|version)
klayr-migrator/2.0.9 darwin-arm64 node-v18.20.1
$ klayr-migrator --help [COMMAND]
USAGE
  $ klayr-migrator COMMAND
...

NOTE: To verify the final results, please run the following command: cat genesis_block.blob.SHA256 under the output directory and compare the results with other participants on Discord.

Command Topics

Running Tests

Klayr Migrator has an extensive set of unit tests. To run the tests, please install Klayr Migrator from source, and then run the command:

$ npm test

Migrating from Lisk Core v4.0.x to Klayr core v4.0.x

The migration guide explains the transition process from Lisk Core v4.0.1 (or later) to Klayr Core v4.0.x using Klayr Migrator v3.

Get Involved

Reason How
Want to chat with our community Reach them on Discord
Found a bug Open a new issue
Want to develop with us Create a fork

License

Copyright 2024 Klayr Holding BV. Copyright 2016-2024 Lisk Foundation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Packages

No packages published

Languages

  • TypeScript 97.8%
  • JavaScript 1.8%
  • Other 0.4%