-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
687c947
commit 42d8296
Showing
6 changed files
with
104 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Contract | ||
|
||
<https://github.com/Reecepbcups/cw-juno-staking-hooks-example> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export JUNOD_NODE="tcp://localhost:26657" | ||
|
||
# upload the smart contract, then create a validator. Confirm it works | ||
|
||
FLAGS="--from=juno1 --gas=2500000 --fees=50000ujuno --node=http://localhost:26657 --yes --keyring-backend=test --home $HOME/.juno1 --chain-id=local-1 --output=json" | ||
|
||
junod tx wasm store ./contract/juno_staking_hooks_example.wasm $FLAGS | ||
|
||
sleep 5 | ||
|
||
txhash=$(junod tx wasm instantiate 1 '{}' --label=juno_staking --no-admin $FLAGS | jq -r .txhash) | ||
sleep 5 | ||
addr=$(junod q tx $txhash --output=json --node=http://localhost:26657 | jq -r .logs[0].events[2].attributes[0].value) && echo $addr | ||
|
||
# register addr to staking | ||
junod tx cw-hooks register-staking $addr $FLAGS | ||
junod q cw-hooks staking-contracts | ||
|
||
# get config | ||
junod q wasm contract-state smart $addr '{"get_config":{}}' --node=http://localhost:26657 | ||
|
||
# get last validator | ||
junod q wasm contract-state smart $addr '{"get_last_val_info":{}}' --node=http://localhost:26657 | ||
|
||
# create validator | ||
junod tx staking create-validator --amount 1ujuno --commission-rate="0.05" --commission-max-rate="1.0" --commission-max-change-rate="1.0" --moniker="test123" --from=juno2 --pubkey=$(junod tendermint show-validator --home $HOME/.juno) --min-self-delegation="1" --gas=1000000 --fees=50000ujuno --node=http://localhost:26657 --yes --keyring-backend=test --home $HOME/.juno1 --chain-id=local-1 --output=json |