To see what happens in the network its sufficient to connect to any validator log stream, e.g. one you are deploying to. But any validator will do, as all of them receive blocks and replay content. So, let's listen for node0. To not overload output, better remove some noisy messages.
curl --no-buffer -s http://node0.testnet.rchain-dev.tk:8181/logs/name:rnode | grep -v "Must wait for more blocks from other validators\|Streamed packet\|Streaming packet\|Received request for block"
Validators propose sequentially round robin, starting from node0 and ending with node9. We need this because merging is not implemented yet in CA. Because of this it will took some time for particular validator to propose. You should see repeating messages "Seen X senders", which gives a hint, which validator proposed last. As we are looking into node0, the seq. number of node that is proposing at the moment = X+1. So to minimise waiting time, it's reasonable to deploy to validator X+2 or X+3 and observe replay results on a node you are listening to.
Alice owns wallet with private key 4021c7b19e7442cd299b5d541761ab86af34fcb74f24f5cd44360838d19618b7 and address 11112KDmzrKHjGRv43JqL1H7NiuwViQVx99EwacQdsPKBEm7xZgyVk. She has some of REV in that wallet sent by a friend (around 10^6 nanoREV). Worth mentioning that balances are stored on chain in nanoREVs, so when checking the balance, the unit of amount printed is REV*10^-9.
Alice checks the wallet balance by deploying contract, that contains printing of wallet balance to stdout, to e.g. validator node0.testnet.rchain-dev.tk (choose validator that should propose soon to minimise waiting time).
rnode --grpc-host node0.testnet.rchain-dev.tk deploy --phlo-limit 100000 --phlo-price 1 --private-key 4021c7b19e7442cd299b5d541761ab86af34fcb74f24f5cd44360838d19618b7 alice_checks_balance.rho
new rl(`rho:registry:lookup`), stdout(`rho:io:stdout`), revVaultCh, vaultCh, balanceCh, log in { rl!(`rho:rchain:revVault`, *revVaultCh) | for (@(_, revVault) <- revVaultCh) { match "11112KDmzrKHjGRv43JqL1H7NiuwViQVx99EwacQdsPKBEm7xZgyVk" { revAddress => { @revVault!("findOrCreate", revAddress, *vaultCh) | for (@(true, vault) <- vaultCh) { @vault!("balance", *balanceCh) | for (@balance <- balanceCh) { log!("Balance of " ++ revAddress ++ " is ${balance}."%%{"balance":balance}) } } } } } | contract log(@data) = { stdout!("COST ACCOUNTING TEST: Alice deploys. " ++ data) } } |
Alice's friend, Bob, who has no REVs and even do not have a wallet, ask her to create wallet for him with address 1111iNXW2k2S3S5bWL3W8w87itK1ky3y1ywySFBt9DkfPiZYo3KNU, so Alice deploys
new rl(`rho:registry:lookup`), stdout(`rho:io:stdout`), revVaultCh, vaultCh, balanceCh, log in { rl!(`rho:rchain:revVault`, *revVaultCh) | for (@(_, revVault) <- revVaultCh) { match "1111iNXW2k2S3S5bWL3W8w87itK1ky3y1ywySFBt9DkfPiZYo3KNU" { revAddress => { @revVault!("findOrCreate", revAddress, *vaultCh) | for (@(true, vault) <- vaultCh) { @vault!("balance", *balanceCh) | for (@balance <- balanceCh) { log!("Wallet " ++ revAddress ++ " created. Balance is ${balance}."%%{"balance":balance}) } } } } } | contract log(@data) = { stdout!("COST ACCOUNTING TEST: Alice creates wallet for Bob. " ++ data) } } |
You should observe in logs, that wallet with zero balance is created.
Bob now owns wallet with private key 29f65cfc9a513d5b3ec542be590b9756fad3da173e6af3714cfe600595f812c8 and address 1111iNXW2k2S3S5bWL3W8w87itK1ky3y1ywySFBt9DkfPiZYo3KNU. He has 0 REV in that wallet.
rnode --grpc-host node0.testnet.rchain-dev.tk deploy --phlo-limit 100000 --phlo-price 1 --private-key 4021c7b19e7442cd299b5d541761ab86af34fcb74f24f5cd44360838d19618b7 bob_checks_balance.rho
new rl(`rho:registry:lookup`), stdout(`rho:io:stdout`), revVaultCh, vaultCh, balanceCh, log in { rl!(`rho:rchain:revVault`, *revVaultCh) | for (@(_, revVault) <- revVaultCh) { match "1111iNXW2k2S3S5bWL3W8w87itK1ky3y1ywySFBt9DkfPiZYo3KNU" { revAddress => { @revVault!("findOrCreate", revAddress, *vaultCh) | for (@(true, vault) <- vaultCh) { @vault!("balance", *balanceCh) | for (@balance <- balanceCh) { log!("Balance of " ++ revAddress ++ " is ${balance}."%%{"balance":balance}) } } } } } | contract log(@data) = { stdout!("COST ACCOUNTING TEST: Bob deploys. " ++ data) } } |