cosmos-sdk/docs/run-node/interact-node.md
Amaury Martiny 71166c8949
docs: Add new section "Running a Node" (#7701)
* docs: Add new section "Running a Node"

* Add running-node

* Add docker compose

* Update title

* Typos

* Wording

* Fix links

* Update docs/run-node/keyring.md

Co-authored-by: Cory <cjlevinson@gmail.com>

* Update docs/run-node/run-node.md

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* Address reviews

* rc2

* Update docs/run-node/keyring.md

Co-authored-by: Cory <cjlevinson@gmail.com>

* Address more comments

* Reviews

* Fix run node

* Fix todo

Co-authored-by: Cory <cjlevinson@gmail.com>
Co-authored-by: Robert Zaremba <robert@zaremba.ch>
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2020-11-04 14:02:22 +00:00

1.7 KiB

Interacting with the Node

Pre-requisite Readings

Via CLI

Now that your chain is running, it is time to try sending tokens from the first account you created to a second account. In a new terminal window, start by running the following query command:

simd query account $MY_VALIDATOR_ADDRESS --chain-id my-test-chain

You should see the current balance of the account you created, equal to the original balance of stake you granted it minus the amount you delegated via the gentx. Now, create a second account:

simd keys add recipient

# Put the generated address in a variable for later use.
RECIPIENT=$(simd keys show recipient -a)

The command above creates a local key-pair that is not yet registered on the chain. An account is created the first time it receives tokens from another account. Now, run the following command to send tokens to the recipient account:

simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake --chain-id my-test-chain

# Check that the recipient account did receive the tokens.
simd query account $RECIPIENT --chain-id my-test-chain

Finally, delegate some of the stake tokens sent to the recipient account to the validator:

simd tx staking delegate $(simd keys show my_validator --bech val -a) 500stake --from recipient --chain-id my-test-chain

# Query the total delegations to `validator`.
simd query staking delegations-to $(simd keys show my_validator --bech val -a) --chain-id my-test-chain

You should see two delegations, the first one made from the gentx, and the second one you just performed from the recipient account.