- Go version >= 1.18.0
- (Optional) (for reading from LevelDB using C lib) LevelDB version >= 1.7 and snappy
go run main.goTo run with C lib support for LevelDB:
CGO_ENABLED=1 CGO_LDFLAGS="-lsnappy" go run -tags "cleveldb" main.goEnvironment variable options
INITIAL_STATE_DATA_DIR: Directory path of initial state dataINITIAL_STATE_DATA_FILENAME: ABCI initial state data file name (for JSON file data type) or directory name excluding suffix.db(for LevelDB data type). [Default:data]BACKUP_VALIDATORS_FILENAME: File name of validators backup dataCHAIN_HISTORY_FILENAME: File name of chain history data [Default:chain_history]
Specific to create-initial-state-data command
TM_HOME: Source Tendermint home directory pathABCI_DB_DIR_PATH: Source ABCI state DB directory pathINITIAL_STATE_DATA_TYPE: ABCI initial state data file type. Options areleveldbandfile.leveldbwill output as a LevelDB database directory.filewill output as a single file with JSON data format [Default:leveldb]READ_BUFFER_SIZE: Key-value read buffer size (number of keys) [Default:250000]LEVELDB_MAX_BATCH_BYTES: LevelDB write max batch size in bytes. (Only apply whenINITIAL_STATE_DATA_TYPEis set toleveldb) [Default:8388608(8 MB)]LEVELDB_WRITE_BUFFER_BYTES: LevelDB write buffer size in bytes. (Only apply whenINITIAL_STATE_DATA_TYPEis set toleveldb) [Default:268435456(256 MB)]
Specific to restore command
NDID_NODE_ID: NDID node ID [Default:NDID]KEY_DIR: NDID node key directory path [Default:./dev_keys/]TENDERMINT_RPC_HOST: Tendermint RPC host [Default:localhost]TENDERMINT_RPC_PORT: Tendermint RPC port [Default:45000]
- Run backup with command
create-initial-state-data [fromVersion] [toVersion]
Example:
go run main.go create-initial-state-data 4 5- Run restore with command
restore [toVersion]
Example:
go run main.go restore 5- Run create initial state data with command
create-initial-state-data [fromVersion] [toVersion]
Example:
go run main.go create-initial-state-data 6 7- Use created initial state data with Tendermint/ABCI for
InitChain. Refer to https://github.com/ndidplatform/smart-contract for usage.