A utility for ensuring the migration of the state from the old to the new fabric #hlf#tool#migration#go#
CGO_ENABLED=0 go build -v # 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./migration-manager import -c migration.yamlor
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.yamlGet a state in chunks (1000 per chunk) with a commit in HLF.
./migration-manager export -c migration.yaml -e 1000Get a state in chunks (1000 per chunk) without committing to HLF
./migration-manager get -c migration.yaml -e 1000Upload a state to a new HLF
./migration-manager import -c migration.yamlApache-2.0