Skip to content

Repository files navigation

migration-manager

Go Report Card Go Reference GitHub License

Go Verify Build Security vulnerability scan GitHub go.mod Go version (branch) GitHub Tag

TOC

Description

A utility for ensuring the migration of the state from the old to the new fabric #hlf#tool#migration#go#


Build

Go

CGO_ENABLED=0 go build -v 

Configuration yaml file

# snapshot is the path to the directory where the files with the HLF state will be located
snapshot: ./tmp

# The HLF section defines the parameters for connecting clients to HLF,
# for state requests and transaction execution
hlf:
  # config defines the path to the HLF SDK connection description
  config:    "/opt/services/etc/client.yaml"
  # org - user's organization.
  org:       org1
  # user - the name of the user from whom the connection is being made.
  user:      User1
  # channel - the channel where the chaincode is deployed.
  channel:   fiat
  # chaincode - the name of the chaincode.
  chaincode: fiat
  # exectimeout defines the maximum execution time of the Invoke or Query HLF call.
  # If this parameter is not set, the default value of 2 minutes will be applied.
  exectimeout: 2m

Run

./migration-manager import -c migration.yaml

or

You can also redefine the values from the config with env variables with the MIGRATION_ prefix.

export MIGRATION_SNAPSHOT="/etc/data/snap" &&
export MIGRATION_HLF_CHANNEL="fiat" &&
export MIGRATION_HLF_CHAINCODE="fiat" &&
./migration-manager export -c migration.yaml

Export

Get a state in chunks (1000 per chunk) with a commit in HLF.

./migration-manager export -c migration.yaml  -e 1000

Get

Get a state in chunks (1000 per chunk) without committing to HLF

./migration-manager get -c migration.yaml -e 1000

Import

Upload a state to a new HLF

./migration-manager import -c migration.yaml

License

Apache-2.0

Links

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages