Skip to content

Commit

Permalink
Added NodeOps playground try it now feature in specific sections (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
emperorjm authored Mar 15, 2024
1 parent eaed825 commit a7c3ac3
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 46 deletions.
17 changes: 17 additions & 0 deletions content/2.developers/1.getting-started/4.understanding-gas-fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ $(archwayd q rewards estimate-fees 1 --node 'https://rpc.mainnet.archway.io:443'

::

Try it:

::tryItButton

```bash
$(archwayd q rewards estimate-fees 1 --node 'https://rpc.mainnet.archway.io:443' --output json | jq -r '.gas_unit_price | (.amount + .denom)')
```
::

#title1
testnet

Expand All @@ -51,7 +60,15 @@ testnet
$(archwayd q rewards estimate-fees 1 --node 'https://rpc.constantine.archway.io:443' --output json | jq -r '.gas_unit_price | (.amount + .denom)')
```

::

Try it:

::tryItButton

```bash
$(archwayd q rewards estimate-fees 1 --node 'https://rpc.constantine.archway.io:443' --output json | jq -r '.gas_unit_price | (.amount + .denom)')
```
::

::
Expand Down
87 changes: 54 additions & 33 deletions content/2.developers/2.developer-tools/3.daemon.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ archwayd query bank balances <account-address> --node "https://rpc.mainnet.archw
::
Try it:
::tryItButton
```bash
archwayd query bank balances archway1e2ntjy39x4gqn3tqu09ztjpjp4hf9q6u47w30u --node "https://rpc.mainnet.archway.io:443" --chain-id archway-1
```
::
#title1
testnet
Expand All @@ -199,6 +208,15 @@ archwayd query bank balances <account-address> --node "https://rpc.constantine.a
::
Try it:
::tryItButton
```bash
archwayd query bank balances archway1e2ntjy39x4gqn3tqu09ztjpjp4hf9q6u47w30u --node "https://rpc.constantine.archway.io:443" --chain-id constantine-3
```
::
::
### Deploy a contract
Expand Down Expand Up @@ -416,6 +434,15 @@ archwayd query wasm contract <contract-address> --node https://rpc.mainnet.archw
::
Try it:
::tryItButton
```bash
archwayd query wasm contract archway17gg4az440aj892ngex3kerc798d7lnwuuhe2v2dw5j7ezqhzn7hsh4dhzw --node https://rpc.mainnet.archway.io:443 --chain-id archway-1
```
::
#title1
testnet
Expand All @@ -430,6 +457,15 @@ archwayd query wasm contract <contract-address> --node https://rpc.constantine.a
::
Try it:
::tryItButton
```bash
archwayd query wasm contract archway1fk0kf28uqu7jvqkh8ge0wre38ksx8f325flld44nz8ked5pp2d7sd7eccx --node https://rpc.constantine.archway.io:443 --chain-id constantine-3
```
::
::
by replacing <**contract-address**> with your own value.
Expand All @@ -454,6 +490,15 @@ archwayd query wasm contract-history <contract-address> --node https://rpc.mainn

::

Try it:

::tryItButton

```bash
archwayd query wasm contract-history archway17gg4az440aj892ngex3kerc798d7lnwuuhe2v2dw5j7ezqhzn7hsh4dhzw --node https://rpc.mainnet.archway.io:443 --chain-id archway-1
```
::

#title1
testnet

Expand All @@ -467,6 +512,15 @@ archwayd query wasm contract-history <contract-address> --node https://rpc.const

::

Try it:

::tryItButton

```bash
archwayd query wasm contract-history archway1fk0kf28uqu7jvqkh8ge0wre38ksx8f325flld44nz8ked5pp2d7sd7eccx --node https://rpc.constantine.archway.io:443 --chain-id constantine-3
```
::

::
#### Find the contract address of a specific Code ID:

Expand Down Expand Up @@ -498,37 +552,4 @@ archwayd query wasm list-contract-by-code <code-id> --node https://rpc.constanti

::

::

## Run script with Playground:

::tryItButton

```bash
## Set bash to debug mod
set -xe
## Delete existing keys in test keyring
rm -rf ~/.archway
## Set mnemonics and RPC url
MNEMONICS1="decade arrive thrive slim leopard waste rare orbit bring decade shadow focus purity until cinnamon captain baby pencil soldier brain palace inch can humor"
MNEMONICS2="damage ivory barely grab suggest unique digital rifle fire child year grid stuff puzzle story goddess swear polar such yard random cost lock name"
RPC_URL=https://rpc.constantine.archway.tech:443
## set the key
echo -e "$MNEMONICS1\n\n" | archwayd keys add test_ac_1 --keyring-backend test --recover
echo -e "$MNEMONICS2\n\n" | archwayd keys add test_ac_2 --keyring-backend test --recover
archwayd keys list --keyring-backend test
## Query balance before TX
archwayd query bank balances $(archwayd keys show test_ac_1 -a --keyring-backend test) --node=$RPC_URL
archwayd query bank balances $(archwayd keys show test_ac_2 -a --keyring-backend test) --node=$RPC_URL
## Do tx
archwayd tx bank send test_ac_1 $(archwayd keys show test_ac_2 -a --keyring-backend test) 1000000aconst --gas auto --gas-adjustment 1.5 --fees 196383300000000000aconst --from test_ac_1 -b block --node=$RPC_URL --keyring-backend test --yes --chain-id constantine-3
## Sleep
sleep 6
## Query balance after TX
archwayd query bank balances $(archwayd keys show test_ac_1 -a --keyring-backend test) --node=$RPC_URL
archwayd query bank balances $(archwayd keys show test_ac_2 -a --keyring-backend test) --node=$RPC_URL
## Detele keys
archwayd keys delete test_ac_1 --keyring-backend test
archwayd keys delete test_ac_2 --keyring-backend test
```
::
29 changes: 18 additions & 11 deletions content/2.developers/2.developer-tools/7.FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,8 @@ archwayd query txs --events 'wasm._contract_address=<contract-address>&message.s

::









You can also filter based on the RPC API query using the following:




::tab-card{noOfTabs=2}
#title0
mainnet
Expand Down Expand Up @@ -104,6 +93,15 @@ archwayd query txs --events 'message.action=/cosmos.bank.v1beta1.MsgSend' --node
```
::

Try it:

::tryItButton

```bash
archwayd query txs --events 'message.action=/cosmos.bank.v1beta1.MsgSend' --node https://rpc.mainnet.archway.io:443
```
::

#title1
testnet

Expand All @@ -116,6 +114,15 @@ archwayd query txs --events 'message.action=/cosmos.bank.v1beta1.MsgSend' --node
```
::

Try it:

::tryItButton

```bash
archwayd query txs --events 'message.action=/cosmos.bank.v1beta1.MsgSend' --node https://rpc.constantine.archway.io:443
```
::

::


Expand Down
22 changes: 20 additions & 2 deletions content/2.developers/2.rewards/2.managing-rewards.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ The **RewardsRecord** object is used to track the rewards that have been calcula
### Example Request - RewardsRecord

You can use the following command to query the rewards record for a specific address:


::highlight-card

```bash
Expand All @@ -65,8 +67,6 @@ archwayd q rewards rewards-records "${rewards_address}" --node "${node_url}" --o
::




::tab-card{noOfTabs=2}
#title0
mainnet
Expand All @@ -78,6 +78,15 @@ archwayd q rewards rewards-records archway12reqvcenxgv5s7z96pkytzajtl4lf2epyfman
```
::

Try it:

::tryItButton

```bash
archwayd q rewards rewards-records archway12reqvcenxgv5s7z96pkytzajtl4lf2epyfman2 --node https://rpc.mainnet.archway.io:443 --chain-id archway-1 --output json | jq .
```
::

#title1
testnet

Expand All @@ -91,6 +100,15 @@ archwayd q rewards rewards-records archway12reqvcenxgv5s7z96pkytzajtl4lf2epyfman

::

Try it:

::tryItButton

```bash
archwayd q rewards rewards-records archway12reqvcenxgv5s7z96pkytzajtl4lf2epyfman2 --node https://rpc.constantine-3.archway.tech:443 --chain-id constantine-3 --output json | jq .
```
::

::

### Example Response
Expand Down
18 changes: 18 additions & 0 deletions content/2.developers/2.rewards/4.consensus-fee.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ archwayd q rewards estimate-fees 1 --node https://rpc.mainnet.archway.io:443 --c

::

Try it:

::tryItButton

```bash
archwayd q rewards estimate-fees 1 --node https://rpc.mainnet.archway.io:443 --chain-id archway-1 --output json | jq -r '.gas_unit_price | (.amount + .denom)'
```
::

#title1
testnet

Expand All @@ -67,4 +76,13 @@ archwayd q rewards estimate-fees 1 --node https://rpc.constantine-3.archway.tech

::

Try it:

::tryItButton

```bash
archwayd q rewards estimate-fees 1 --node https://rpc.constantine-3.archway.tech:443 --chain-id constantine-3 --output json | jq -r '.gas_unit_price | (.amount + .denom)'
```
::

::
46 changes: 46 additions & 0 deletions content/3.community/4.governance/1.governance.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,32 @@ Mainnet
<p style="padding:0 20px">archwayd q gov params --node https://rpc.mainnet.archway.io:443</p>
::

Try it:

::tryItButton

```bash
archwayd q gov params --node https://rpc.mainnet.archway.io:443
```
::

#title1
Constantine

#desc1
::highlight-card
<p style="padding:0 20px">archwayd q gov params --node https://rpc.constantine.archway.io:443</p>
::

Try it:

::tryItButton

```bash
archwayd q gov params --node https://rpc.constantine.archway.io:443
```
::

::

As of this writing the following are the governance parameters for Mainnet and Constantine (Testnet):
Expand Down Expand Up @@ -215,18 +234,45 @@ To query proposals via the CLI, you would use one of the following commands:
archwayd q gov proposals --node https://rpc.mainnet.archway.io:443
```

Try it:

::tryItButton

```bash
archwayd q gov proposals --node https://rpc.mainnet.archway.io:443
```
::

Or query a specific proposal id, for example:

```shell
archwayd q gov proposal 8 --node https://rpc.mainnet.archway.io:443
```

Try it:

::tryItButton

```bash
archwayd q gov proposal 8 --node https://rpc.mainnet.archway.io:443
```
::

If there are issues with the proposal transaction, you can still query the transaction ID. For example:

```shell
archwayd q tx 39EB4C85EC00281BB54EEE6BC87F17038F3528D5E54BF7FFBDF13E7C15DF92FE --node https://rpc.mainnet.archway.io:443
```

Try it:

::tryItButton

```bash
archwayd q tx 39EB4C85EC00281BB54EEE6BC87F17038F3528D5E54BF7FFBDF13E7C15DF92FE --node https://rpc.mainnet.archway.io:443
```
::

and check the value of the `raw_log` field for useful information.


Expand Down
Loading

0 comments on commit a7c3ac3

Please sign in to comment.