forked from cosmos/gravity-bridge
-
Notifications
You must be signed in to change notification settings - Fork 27
Working with a Peggy node CLI
Alexander Peters edited this page Sep 15, 2020
·
4 revisions
This page contains some commands and queries that can become handy when testing or developing in the project.
🚧 This is all WIP. Commands and arguments may change 🚧
- Create a new test key
# validator is the name of the key
peggycli keys add validator
- Prepare validator node
# local is the moniker
peggyd init --chain-id=testing local
peggyd add-genesis-account validator 1000000000stake
peggyd gentx --name validator --amount 1000000000stake
peggyd collect-gentxs
- Start the server
peggyd start --rpc.laddr tcp://0.0.0.0:26657 --trace
- Generate and print new ETH key to the console
peggycli tx peggy unsafe_testing gen_eth_key
- Submit new eth key for orchestrator
# 0xb8662f35f9de8720424e82b232e8c98d15399490adae9ca993f5ef1dc4883690 is the key. NOTE the mandatory `0x` prefix
peggycli tx peggy update-eth-addr 0xb8662f35f9de8720424e82b232e8c98d15399490adae9ca993f5ef1dc4883690 --from validator --chain-id=testing -b block -y
- Create a request to start the process
peggycli tx peggy valset-request --from validator --chain-id=testing -b block -y
- View the new request data
# nonce=height: 101
peggycli q peggy valset-request 101
- Sign and confirm
# nonce=height: 101
peggycli tx peggy valset-confirm 101 0xb8662f35f9de8720424e82b232e8c98d15399490adae9ca993f5ef1dc4883690 --from validator --chain-id=testing -b block -y
- View confirmation data
# nonce=height: 101
peggycli q peggy valset-confirm 101 $(peggycli keys show validator -a) -o json
- Show current
Orchestrator Set
peggycli q peggy current-valset
- Show address of an cosmos key
peggycli keys show validator -a
- Start Server
peggycli rest-server --laddr tcp://0.0.0.0:1317 --trust-node
- Query current
Orchestrator Set
curl http://localhost:1317/peggy/current_valset -H "Content-Type: application/json"
- List most recent requests for the
MultiSig Set
update. Limited to 5 elements
curl http://localhost:1317/peggy/valset_requests -H "Content-Type: application/json"
- View single request data for the
MultiSig Set
update
# nonce=height: 101
curl http://localhost:1317/peggy/valset_request/101 -H "Content-Type: application/json"
- View all signed update confirmation for a nonce
# nonce=height: 101
curl http://localhost:1317/peggy/valset_confirm/101 -H "Content-Type: application/json"
- View single signed update confirmation
# nonce=height: 101
# validatorAddress: cosmos12flmaejjvzdtz58s4m5avx30wm8uffe7ycj4l9
curl -X POST http://localhost:1317/peggy/query_valset_confirm -H "Content-Type: application/json" -d '{"nonce":"101", "address":"cosmos12flmaejjvzdtz58s4m5avx30wm8uffe7ycj4l9"}'
- Query last pending valset update request
# cosmos12flmaejjvzdtz58s4m5avx30wm8uffe7ycj4l9 : cosmos address of the orchestrator
curl http://localhost:1317/peggy/pending_valset_requests/cosmos12flmaejjvzdtz58s4m5avx30wm8uffe7ycj4l9 -H "Content-Type: application/json"