For legacy setup, with voting required and binary swaps, see ../singleval-vote
Allows to take a network state snapshot, devnetify to run it locally with multi validators (4), and perform an upgrade handler. This allows to test upgrade handler locally for both testnet and mainnet live state.
NOTE:
Docker images always have a version tag, you can build image locally and make a special version tag. Meanwhile, locally avaialable binaries (injectived), are not tagged, it uses whatever binary is available.
# after cloning repo don't forget to initialize LFS
git lfs install
git lfs pullSTEPS:
- (optionally) Re-generate target validators dirs and keys using
make gen-4if target version changes. Uses chain-stresser binary. - Download the latest mainnet state snapshot from Polkachu, put archive into
injective-1/dir. - Run
make unpack, it will decompress and copy data into all 4 validators. - Run
make devnetify, wait for it to finish. Tip: setUPGRADE_HANDLER_VERSIONandDOCKER_IMAGEin ./injective-1/.env file. - Tada! If it exited with 0, you have a multi-validator state with 4 validators, ready to be used for testing.
- Run
make injectived-startto start docker compose network of 4 validators, running continuously. - Run
make injectived-stopto stop the docker compose network and clean up. - (optionally) Run
make cleanto remove all data and rollback to Step 1. (archive not removed, can domake unpacknext).
Access the first node using CLI (via Docker container) ./injective-1/cli/injectived-cli-v1.16.4.sh or via local binary ./injective-1/cli/injectived-cli-local.sh
Use this to debug any step of devnetify process. All endpoints are pointing to the first node inside compose.
Last proposal
http://localhost:10337/cosmos/gov/v1beta1/proposals?pagination.limit=1&pagination.reverse=trueVoting params
http://localhost:10337/cosmos/gov/v1/params/votingValidators set
http://localhost:10337/cosmos/staking/v1beta1/validatorsThere is a handy Makefile to automate the process.
Default environment values:
CHAIN_ID=1 # set the chain id
VERSION_TO=v1.16.4 # set the version to
DOCKER_IMAGE?=injectivelabs/injective-core:$(VERSION_TO)(meanwhile also need to tweak variables ./injective-1/.env file, as I tweak the pipeline still)
Targets:
make devnetify # devnetify the state using docker compose (all 4 validators need to start immediately)
make injectived-start # run (4) injectived nodes with docker compose
make injectived-stop # stop the docker compose network and clean up
make clean # clean up the data and wasm directories
make unpack # unpack the snapshot from the tar.lz4 fileThere is also a unpack target to unpack the snapshot from any *.tar.lz4 file. Just download the snapshot from Polkachu to the target chain dir and run make unpack. Use CHAIN_ID to set the valid chain dir prefix, e.g. CHAIN_ID=1 make unpack.