new chain info, left todo links in
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
# Interacting with Nyx Chain and Smart Contracts
|
||||
|
||||
There are two options for interacting with the blockchain to send tokens or interact with deployed smart contracts:
|
||||
* [`Nym-CLI`](../tools/nym-cli.md) tool
|
||||
There are two options for interacting with the blockchain to send tokens or interact with deployed smart contracts:
|
||||
* [`Nym-CLI`](../tools/nym-cli.md) tool
|
||||
* `nyxd` binary
|
||||
|
||||
## Nym-CLI tool (recommended in most cases)
|
||||
The `nym-cli` tool is a binary offering a simple interface for interacting with deployed smart contract (for instance, bonding and unbonding a mix node from the CLI), as well as creating and managing accounts and keypairs, sending tokens, and querying the blockchain.
|
||||
## Nym-CLI tool (recommended in most cases)
|
||||
The `nym-cli` tool is a binary offering a simple interface for interacting with deployed smart contract (for instance, bonding and unbonding a mix node from the CLI), as well as creating and managing accounts and keypairs, sending tokens, and querying the blockchain.
|
||||
|
||||
Instructions on how to do so can be found on the [`nym-cli` docs page](../tools/nym-cli.md), and there are example commands in the [integrations FAQ](https://nymtech.net/developers/faq/integrations-faq.html).
|
||||
|
||||
## Nyxd binary
|
||||
The `nyxd` binary, although more complex to compile and use, offers the full range of commands availiable to users of CosmosSDK chains. Use this if you are (e.g.) wanting to perform more granular queries about transactions from the CLI.
|
||||
|
||||
You can use the instructions on how to do this on from the [`gaiad` docs page](https://hub.cosmos.network/main/delegators/delegator-guide-cli.html#querying-the-state), and there are example commands in the [integrations FAQ](https://nymtech.net/developers/faq/integrations-faq.html).
|
||||
Instructions on how to do so can be found on the [`nym-cli` docs page](./tools/nym-cli)
|
||||
|
||||
## Nyxd binary
|
||||
The `nyxd` binary, although more complex to compile and use, offers the full range of commands availiable to users of CosmosSDK chains. Use this if you are (e.g.) wanting to perform more granular queries about transactions from the CLI.
|
||||
|
||||
You can use the instructions on how to do this on from the [`gaiad` docs page](https://hub.cosmos.network/main/delegators/delegator-guide-cli.html#querying-the-state).
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# CLI Wallet
|
||||
|
||||
If you have already read our validator setup and maintenance [documentation](https://nymtech.net/operators/nodes/validator-setup.html) you will have seen that we compile and use the `nyxd` binary primarily for our validators. This binary can however be used for many other tasks, such as creating and using keypairs for wallets, or automated setups that require the signing and broadcasting of transactions.
|
||||
If you have already read our [validator setup and maintenance documentation]() TODO LINK AFTER MERGE you will have seen that we compile and use the `nyxd` binary primarily for our validators. This binary can however be used for many other tasks, such as creating and using keypairs for wallets, or automated setups that require the signing and broadcasting of transactions.
|
||||
|
||||
### Using `nyxd` binary as a CLI wallet
|
||||
You can use the `nyxd` as a minimal CLI wallet if you want to set up an account (or multiple accounts). Just compile the binary as per the documentation, **stopping after** the [building your validator](https://nymtech.net/operators/nodes/validator-setup.html#building-your-validator) step is complete. You can then run `nyxd keys --help` to see how you can set up and store different keypairs with which to interact with the Nyx blockchain.
|
||||
|
||||
For more on interacting with the chain, see the [Interacting with Nyx Chain and Smart Contracts](../nyx/interacting-with-chain.md) page.
|
||||
### Using `nyxd` binary as a CLI wallet
|
||||
You can use the `nyxd` as a minimal CLI wallet if you want to set up an account (or multiple accounts). Just compile the binary as per the documentation, **stopping after** the [building your validator]() TODO LINK AFTER MERGE step is complete. You can then run `nyxd keys --help` to see how you can set up and store different keypairs with which to interact with the Nyx blockchain.
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
# Ledger Live Support
|
||||
|
||||
Use the following instructions to interact with the Nyx blockchain - either with deployed smart contracts, or just to send tokens - using your Ledger device to sign transactions.
|
||||
Use the following instructions to interact with the Nyx blockchain - either with deployed smart contracts, or just to send tokens - using your Ledger device to sign transactions.
|
||||
|
||||
## Prerequisites
|
||||
* Download and install [Ledger Live](https://www.ledger.com/ledger-live).
|
||||
* Compile the `nyxd` binary as per the instructions [here](https://nymtech.net/operators/nodes/validator-setup.html#building-the-nym-validator). Stop after you can successfully run `nyxd` and get the helptext in your console output.
|
||||
## Prerequisites
|
||||
* Download and install [Ledger Live](https://www.ledger.com/ledger-live).
|
||||
* Compile the `nyxd` binary as per the instructions [here]() TODO LINK AFTER MERGE. Stop after you can successfully run `nyxd` and get the helptext in your console output.
|
||||
|
||||
## Prepare your Ledger App
|
||||
* Plug in your Ledger device
|
||||
* Install the `Cosmos (ATOM)` app by following the instructions [here](https://hub.cosmos.network/main/resources/ledger.html). This app allows you to interact with **any** Cosmos SDK chain - you can manage your ATOM, OSMOSIS, NYM tokens, etc.
|
||||
* On the device, navigate to the Cosmos app and open it
|
||||
## Prepare your Ledger App
|
||||
* Plug in your Ledger device
|
||||
* Install the `Cosmos (ATOM)` app by following the instructions [here](https://hub.cosmos.network/main/resources/ledger.html). This app allows you to interact with **any** Cosmos SDK chain - you can manage your ATOM, OSMOSIS, NYM tokens, etc.
|
||||
* On the device, navigate to the Cosmos app and open it
|
||||
|
||||
## Create a keypair
|
||||
Add a reference to the ledger device on your local machine by running the following command in the same directory as your `nyxd` binary:
|
||||
## Create a keypair
|
||||
Add a reference to the ledger device on your local machine by running the following command in the same directory as your `nyxd` binary:
|
||||
|
||||
```
|
||||
nyxd keys add ledger_account --ledger
|
||||
```
|
||||
nyxd keys add ledger_account --ledger
|
||||
```
|
||||
|
||||
## Command help with `nyxd`
|
||||
More information about each command is available by consulting the help section (`--help`) at each layer of `nyxd`'s commands:
|
||||
@@ -25,7 +25,7 @@ More information about each command is available by consulting the help section
|
||||
# logging top level command help
|
||||
nyxd --help
|
||||
|
||||
# logging top level command help for transaction commands
|
||||
# logging top level command help for transaction commands
|
||||
nyxd tx --help
|
||||
|
||||
# logging top level command help for transaction commands utilising the 'bank' module
|
||||
@@ -33,7 +33,7 @@ nyxd tx bank --help
|
||||
```
|
||||
|
||||
## Sending tokens between addresses
|
||||
Perform a transaction from the CLI with `nyxd`, appending the `--ledger` option to the command.
|
||||
Perform a transaction from the CLI with `nyxd`, appending the `--ledger` option to the command.
|
||||
|
||||
As an example, the below command will send 1 `NYM` from the ledger account to the `$DESTINATION_ACCOUNT`:
|
||||
|
||||
@@ -44,36 +44,35 @@ nyxd tx bank send ledger_account $DESTINATION_ACCOOUNT 1000000unym --ledger --no
|
||||
> When a command is run, the transaction will appear on the Ledger device and will require physical confirmation from the device before being signed.
|
||||
|
||||
## Nym-specific transactions
|
||||
Nym-specific commands and queries, like bonding a mix node or delegating unvested tokens, are available in the `wasm` module, and follow the following pattern:
|
||||
Nym-specific commands and queries, like bonding a mix node or delegating unvested tokens, are available in the `wasm` module, and follow the following pattern:
|
||||
|
||||
```
|
||||
# Executing commands
|
||||
nyxd tx wasm execute $CONTRACT_ADDRESS $JSON_MSG
|
||||
|
||||
# Querying the state of a smart contract
|
||||
# Querying the state of a smart contract
|
||||
nyxd query wasm contract-state smart $CONTRACT_ADDRESS $JSON_MSG
|
||||
```
|
||||
|
||||
You can find the value of `$CONTRACT_ADDRESS` in the [`network defaults`](https://github.com/nymtech/nym/blob/release/v1.1.7/common/network-defaults/src/mainnet.rs) file.
|
||||
You can find the value of `$CONTRACT_ADDRESS` in the [`network defaults`](https://github.com/nymtech/nym/blob/master/common/network-defaults/src/mainnet.rs) file.
|
||||
|
||||
The value of `$JSON_MSG` will be a blog of `json` formatted as defined for each command and query. You can find these definitions for the mixnet smart contract [here](https://github.com/nymtech/nym/blob/develop/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs) and for the vesting contract [here](https://github.com/nymtech/nym/blob/develop/common/cosmwasm-smart-contracts/vesting-contract/src/messages.rs) under `ExecuteMsg` and `QueryMsg`.
|
||||
The value of `$JSON_MSG` will be a blog of `json` formatted as defined for each command and query. You can find these definitions for the mixnet smart contract [here](https://github.com/nymtech/nym/blob/master/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs) and for the vesting contract [here](https://github.com/nymtech/nym/blob/master/common/cosmwasm-smart-contracts/vesting-contract/src/messages.rs) under `ExecuteMsg` and `QueryMsg`.
|
||||
|
||||
### Example command execution:
|
||||
### Example command execution:
|
||||
#### Delegate to a mix node
|
||||
You can delegate to a mix node from the CLI using `nyxd` and signing the transaction with your ledger by filling in the values of this example:
|
||||
You can delegate to a mix node from the CLI using `nyxd` and signing the transaction with your ledger by filling in the values of this example:
|
||||
```
|
||||
CONTRACT_ADDRESS=mixnet_contract_address
|
||||
|
||||
./nyxd tx wasm execute $CONTRACT_ADDRESS '{"delegate_to_mixnode":{"mix_identity":"MIX_NODE_IDENTITY","amount":{"amount":"100000000000","denom":"unym"}}}' --ledger --from admin --node https://rpc.dev.nymte.ch:443 --gas-prices 0.025unymt --gas auto -b block
|
||||
```
|
||||
|
||||
> By replacing the value of `CONTRACT_ADDRESS` with the address of the vesting contract, you could use the above command to use tokens held in the vesting contract.
|
||||
> By replacing the value of `CONTRACT_ADDRESS` with the address of the vesting contract, you could use the above command to use tokens held in the vesting contract.
|
||||
|
||||
#### Query a vesting schedule
|
||||
You can query for (e.g.) seeing the current vesting period of an address by filling in the values of the following:
|
||||
#### Query a vesting schedule
|
||||
You can query for (e.g.) seeing the current vesting period of an address by filling in the values of the following:
|
||||
```
|
||||
CONTRACT_ADDRESS=vesting_contract_address
|
||||
|
||||
nyxd query wasm contract-state smart $CONTRACT_ADDRESS '{"get_current_vesting_period"}:{"address": "address_to_query_for"}' --ledger --from admin --node https://rpc.dev.nymte.ch:443 --chain-id qa-net --gas-prices 0.025unymt --gas auto -b block
|
||||
nyxd query wasm contract-state smart $CONTRACT_ADDRESS '{"get_current_vesting_period"}:{"address": "address_to_query_for"}' --ledger --from admin --node https://rpc.dev.nymte.ch:443 --chain-id qa-net --gas-prices 0.025unymt --gas auto -b block
|
||||
```
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# RPC Nodes
|
||||
|
||||
RPC Nodes (which might otherwise be referred to as 'Lite Nodes' or just 'Full Nodes') differ from Validators in that they hold a copy of the Nyx blockchain, but do **not** participate in consensus / block-production.
|
||||
RPC Nodes (which might otherwise be referred to as 'Lite Nodes' or just 'Full Nodes') differ from Validators in that they hold a copy of the Nyx blockchain, but do **not** participate in consensus / block-production.
|
||||
|
||||
You may want to set up an RPC Node for querying the blockchain, or in order to have an endpoint that your app can use to send transactions.
|
||||
You may want to set up an RPC Node for querying the blockchain, or in order to have an endpoint that your app can use to send transactions.
|
||||
|
||||
In order to set up an RPC Node, simply follow the instructions to set up a [Validator](https://nymtech.net/operators/nodes/validator-setup.html), but **exclude the `nyxd tx staking create-validator` command**.
|
||||
In order to set up an RPC Node, simply follow the instructions to set up a [Validator]() TODO LINK AFTER MERGE, but **exclude the `nyxd tx staking create-validator` command**.
|
||||
|
||||
If you want to fast-sync your node, check out the Polkachu snapshot and their other [resources](https://polkachu.com/seeds/nym).
|
||||
|
||||
Reference in New Issue
Block a user