From 2b7d8e92133f67063d6674419e23f2507d16d5df Mon Sep 17 00:00:00 2001 From: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> Date: Thu, 27 May 2021 21:09:02 -0700 Subject: [PATCH 1/5] fix document order --- docs/run-node/README.md | 11 ++++++----- docs/run-node/cosmovisor.md | 4 ++++ docs/run-node/rosetta.md | 4 ++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/run-node/README.md b/docs/run-node/README.md index 27ee9726508a..67ec9243081f 100644 --- a/docs/run-node/README.md +++ b/docs/run-node/README.md @@ -9,8 +9,9 @@ parent: This folder contains documentation on how to run a node and interact with it. 1. [Setting up the keyring](./keyring.md) -1. [Running a Node](./run-node.md) -1. [Interacting with a Node](./interact-node.md) -1. [Generating, Signing and Broadcasting Transactions](./txs.md) -1. [Cosmos Upgrade Manager](./cosmovisor.md) -1. [Rosetta API](./rosetta.md) +2. [Running a Node](./run-node.md) +3. [Interacting with a Node](./interact-node.md) +4. [Generating, Signing and Broadcasting Transactions](./txs.md) +5. [Cosmos Upgrade Manager](./cosmovisor.md) +6. [Rosetta API](./rosetta.md) +7. [Simapp Testnet](./simapp-testnet.md) diff --git a/docs/run-node/cosmovisor.md b/docs/run-node/cosmovisor.md index 6c54eb9e5c22..fb4d57402b8a 100644 --- a/docs/run-node/cosmovisor.md +++ b/docs/run-node/cosmovisor.md @@ -1,3 +1,7 @@ + + # Cosmosvisor Quick Start `cosmovisor` is a small process manager around Cosmos SDK binaries that monitors the governance module via stdout to see if there's a chain upgrade proposal coming in. If it see a proposal that gets approved it can be run manually or automatically to download the new code, stop the node, run the migration script, replace the node binary, and start with the new genesis file. diff --git a/docs/run-node/rosetta.md b/docs/run-node/rosetta.md index 98121867cfb7..398d9a9f47e5 100644 --- a/docs/run-node/rosetta.md +++ b/docs/run-node/rosetta.md @@ -1,3 +1,7 @@ + + # Rosetta Package rosetta implements the rosetta API for the current cosmos sdk release series. From 38330e506301c9d6dfd11ec4da1d96ddb396945f Mon Sep 17 00:00:00 2001 From: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> Date: Thu, 27 May 2021 21:09:20 -0700 Subject: [PATCH 2/5] add run-testnet doc --- docs/run-node/run-testnet.md | 97 ++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 docs/run-node/run-testnet.md diff --git a/docs/run-node/run-testnet.md b/docs/run-node/run-testnet.md new file mode 100644 index 000000000000..049216c122b4 --- /dev/null +++ b/docs/run-node/run-testnet.md @@ -0,0 +1,97 @@ + + +# Running a Testnet + +The `simd testing` subcommand makes it easy to initialize and start test networks. {synopsis} + +In addition to the commands for [running a node](/run-node/run-node.html), the `simd` binary also includes a `testnet` command that allows you to start an in-process simulated test network or to initialize files for a simulated test network that runs in a separate process. + +The `testnet` command is used within the Cosmos SDK for testing purposes. The command can also be implemented in the CLI for other blockchain applications built with the Cosmos SDK to achieve the same functionality. + +## Initialize Files + +First, let's take a look at the `init-files` subcommand. + +This is similar to the `init` command when initializing a single node, but in this case we are initializing multiple nodes, generating the genesis transactions for each node, and then collecting those transactions. + +The `init-files` subcommand initializes a test network that will run in a separate process. It is not a prerequisite for the `start` subcommand ([see below](#start-testnet)). + +In order to initialize the files, run the following: + +```bash +simd testnet init-files +``` + +You should see the following output in your terminal: + +```bash +Successfully initialized 4 node directories +``` + +The default output directory is a relative `.testnets` directory. Let's take a look at the files created within the `.testnets` directory. + +### gentxs + +Within the `.testnets` directory, you will find a `gentxs` directory that includes a genesis transaction for each node. The default number of nodes is `4`, so you should see four `.json` files that include JSON encoded genesis transactions. + +### nodes + +Within the `.testnets` directory, you will also find a `node` directory for each node. This includes the configuration and data for each node. + +Within each `node` directory, you will find a `simd` directory. The `simd` directory for each node includes the same configuration and data files that you would find in the `~/.simapp` directory when running the `simd` command for a single node. + +## Start Testnet + +Now, let's take a look at the `start` subcommand. + +The `start` subcommand both initializes and starts an in-process test network. This is the fastest way to spin up a local test network for testing purposes. + +You can start the local test network by running the following command: + +```bash +simd testnet start +``` + +You should see something similar to the following: + +```bash +acquiring test network lock +preparing test network with chain-id "chain-mtoD9v" + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ THIS MNEMONIC IS FOR TESTING PURPOSES ONLY ++ +++ DO NOT USE IN PRODUCTION ++ +++ ++ +++ sustain know debris minute gate hybrid stereo custom ++ +++ divorce cross spoon machine latin vibrant term oblige ++ +++ moment beauty laundry repeat grab game bronze truly ++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + +starting test network... +started test network +press the Enter Key to terminate +``` + +The test network is running in-process, which means the test network will terminate once you either close the terminal window or press the Enter key. + +## Custom Testnets + +You can customize the testnet by adding flags. In order to see the flag options, you can append the `--help` flag to each command. For example, to see the flag options for the `init-files` subcommand, you can run the following: + +```bash +simd testnet init-files --help +``` + +One of the flag options is the `--v` flag. This flag allows you to set the number of validators that the test network will have (.i.e the number of nodes to initialize and genesis transactions to generate). The default value for the `--v` flag is `4`, which is why four node directories were initialized in the example above. + +You can also add the `--help` flag to the `start` command: + +```bash +simd testnet start --help +``` + +A few of the flag options are `--api.address`, `--grpc.address`, and `--rpc.address`, which allow you to set the addresses for the API, gRPC, and RPC respectively. From 77cae0f349d5ffa8be26e49a5b0ffee4e57910ab Mon Sep 17 00:00:00 2001 From: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> Date: Thu, 27 May 2021 21:50:49 -0700 Subject: [PATCH 3/5] fix link and typo --- docs/run-node/README.md | 2 +- docs/run-node/run-testnet.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/run-node/README.md b/docs/run-node/README.md index 67ec9243081f..995882c0b691 100644 --- a/docs/run-node/README.md +++ b/docs/run-node/README.md @@ -14,4 +14,4 @@ This folder contains documentation on how to run a node and interact with it. 4. [Generating, Signing and Broadcasting Transactions](./txs.md) 5. [Cosmos Upgrade Manager](./cosmovisor.md) 6. [Rosetta API](./rosetta.md) -7. [Simapp Testnet](./simapp-testnet.md) +7. [Running a Testnet](./run-testnet.md) diff --git a/docs/run-node/run-testnet.md b/docs/run-node/run-testnet.md index 049216c122b4..4ee7c57c9eeb 100644 --- a/docs/run-node/run-testnet.md +++ b/docs/run-node/run-testnet.md @@ -4,7 +4,7 @@ order: 7 # Running a Testnet -The `simd testing` subcommand makes it easy to initialize and start test networks. {synopsis} +The `simd testnet` subcommand makes it easy to initialize and start test networks. {synopsis} In addition to the commands for [running a node](/run-node/run-node.html), the `simd` binary also includes a `testnet` command that allows you to start an in-process simulated test network or to initialize files for a simulated test network that runs in a separate process. From 901d501ee311eede0ecf1455f9ae3fa85f0b14d6 Mon Sep 17 00:00:00 2001 From: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> Date: Tue, 13 Jul 2021 11:26:05 -0700 Subject: [PATCH 4/5] revisions --- docs/run-node/run-testnet.md | 44 ++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/docs/run-node/run-testnet.md b/docs/run-node/run-testnet.md index 4ee7c57c9eeb..0cc032e1edc1 100644 --- a/docs/run-node/run-testnet.md +++ b/docs/run-node/run-testnet.md @@ -4,11 +4,9 @@ order: 7 # Running a Testnet -The `simd testnet` subcommand makes it easy to initialize and start test networks. {synopsis} +The `simd testnet` subcommand makes it easy to initialize and start a simulated test network for testing purposes. {synopsis} -In addition to the commands for [running a node](/run-node/run-node.html), the `simd` binary also includes a `testnet` command that allows you to start an in-process simulated test network or to initialize files for a simulated test network that runs in a separate process. - -The `testnet` command is used within the Cosmos SDK for testing purposes. The command can also be implemented in the CLI for other blockchain applications built with the Cosmos SDK to achieve the same functionality. +In addition to the commands for [running a node](/run-node/run-node.html), the `simd` binary also includes a `testnet` command that allows you to start a simulated test network in-process or to initialize files for a simulated test network that runs in a separate process. ## Initialize Files @@ -18,7 +16,7 @@ This is similar to the `init` command when initializing a single node, but in th The `init-files` subcommand initializes a test network that will run in a separate process. It is not a prerequisite for the `start` subcommand ([see below](#start-testnet)). -In order to initialize the files, run the following: +In order to initialize the files for a test network, run the following command: ```bash simd testnet init-files @@ -34,13 +32,11 @@ The default output directory is a relative `.testnets` directory. Let's take a l ### gentxs -Within the `.testnets` directory, you will find a `gentxs` directory that includes a genesis transaction for each node. The default number of nodes is `4`, so you should see four `.json` files that include JSON encoded genesis transactions. +Within the `.testnets` directory, there is a `gentxs` directory that includes a genesis transaction for each validator node. The default number of nodes is `4`, so you should see four files that include JSON encoded genesis transactions. ### nodes -Within the `.testnets` directory, you will also find a `node` directory for each node. This includes the configuration and data for each node. - -Within each `node` directory, you will find a `simd` directory. The `simd` directory for each node includes the same configuration and data files that you would find in the `~/.simapp` directory when running the `simd` command for a single node. +Within the `.testnets` directory, there is a `node` directory for each node. Within each `node` directory, there is a `simd` directory. The `simd` directory is the home directory for each node (i.e. each `simd` directory includes the same configuration and data files as the default `~/.simapp` directory when running a single node). ## Start Testnet @@ -76,22 +72,32 @@ started test network press the Enter Key to terminate ``` -The test network is running in-process, which means the test network will terminate once you either close the terminal window or press the Enter key. +The test network is running in-process, which means the test network will terminate once you either close the terminal window or you press the Enter key. -## Custom Testnets +In order to test the test network, use the `simd` binary. The first node uses the same default addresses when starting a single node network. -You can customize the testnet by adding flags. In order to see the flag options, you can append the `--help` flag to each command. For example, to see the flag options for the `init-files` subcommand, you can run the following: +Check the status of the first node: -```bash -simd testnet init-files --help ``` +simd status +``` + +Import the key from the provided mnemonic: -One of the flag options is the `--v` flag. This flag allows you to set the number of validators that the test network will have (.i.e the number of nodes to initialize and genesis transactions to generate). The default value for the `--v` flag is `4`, which is why four node directories were initialized in the example above. +``` +simd keys add test --recover --keyring-backend test +``` -You can also add the `--help` flag to the `start` command: +Check the balance of the account address: -```bash -simd testnet start --help ``` +simd q bank balances [address] +``` + +Use this test account to execute transactions. + +## Testnet Options + +You can customize the configuration of the testnet with flags. In order to see all flag options, append the `--help` flag to each command. -A few of the flag options are `--api.address`, `--grpc.address`, and `--rpc.address`, which allow you to set the addresses for the API, gRPC, and RPC respectively. +One of the flag options is the `--v` flag. This flag allows you to set the number of validators that the test network will have (i.e. the number of nodes to initialize and genesis transactions to generate). The default value for the `--v` flag is `4`, which is why four node directories were initialized in the example above. \ No newline at end of file From 8474945e572c1af433fd988ea762e626572f887a Mon Sep 17 00:00:00 2001 From: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:01:41 -0700 Subject: [PATCH 5/5] revisions --- docs/run-node/run-testnet.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/run-node/run-testnet.md b/docs/run-node/run-testnet.md index 0cc032e1edc1..3f8478b4689d 100644 --- a/docs/run-node/run-testnet.md +++ b/docs/run-node/run-testnet.md @@ -6,7 +6,7 @@ order: 7 The `simd testnet` subcommand makes it easy to initialize and start a simulated test network for testing purposes. {synopsis} -In addition to the commands for [running a node](/run-node/run-node.html), the `simd` binary also includes a `testnet` command that allows you to start a simulated test network in-process or to initialize files for a simulated test network that runs in a separate process. +In addition to the commands for [running a node](./run-node.html), the `simd` binary also includes a `testnet` command that allows you to start a simulated test network in-process or to initialize files for a simulated test network that runs in a separate process. ## Initialize Files @@ -14,7 +14,7 @@ First, let's take a look at the `init-files` subcommand. This is similar to the `init` command when initializing a single node, but in this case we are initializing multiple nodes, generating the genesis transactions for each node, and then collecting those transactions. -The `init-files` subcommand initializes a test network that will run in a separate process. It is not a prerequisite for the `start` subcommand ([see below](#start-testnet)). +The `init-files` subcommand initializes the necessary files to run a test network in a separate process (i.e. using a Docker container). Running this command is not a prerequisite for the `start` subcommand ([see below](#start-testnet)). In order to initialize the files for a test network, run the following command: @@ -32,11 +32,11 @@ The default output directory is a relative `.testnets` directory. Let's take a l ### gentxs -Within the `.testnets` directory, there is a `gentxs` directory that includes a genesis transaction for each validator node. The default number of nodes is `4`, so you should see four files that include JSON encoded genesis transactions. +The `gentxs` directory includes a genesis transaction for each validator node. Each file includes a JSON encoded genesis transaction used to register a validator node at the time of genesis. The genesis transactions are added to the `genesis.json` file within each node directory during the initilization process. ### nodes -Within the `.testnets` directory, there is a `node` directory for each node. Within each `node` directory, there is a `simd` directory. The `simd` directory is the home directory for each node (i.e. each `simd` directory includes the same configuration and data files as the default `~/.simapp` directory when running a single node). +A node directory is created for each validator node. Within each node directory is a `simd` directory. The `simd` directory is the home directory for each node, which includes the configuration and data files for that node (i.e. the same files included in the default `~/.simapp` directory when running a single node). ## Start Testnet @@ -72,11 +72,9 @@ started test network press the Enter Key to terminate ``` -The test network is running in-process, which means the test network will terminate once you either close the terminal window or you press the Enter key. +The first validator node is now running in-process, which means the test network will terminate once you either close the terminal window or you press the Enter key. In the output, the mnemonic phrase for the first validator node is provided for testing purposes. The validator node is using the same default addresses being used when initializing and starting a single node (no need to provide a `--node` flag). -In order to test the test network, use the `simd` binary. The first node uses the same default addresses when starting a single node network. - -Check the status of the first node: +Check the status of the first validator node: ``` simd status @@ -94,10 +92,8 @@ Check the balance of the account address: simd q bank balances [address] ``` -Use this test account to execute transactions. +Use this test account to manually test against the test network. ## Testnet Options -You can customize the configuration of the testnet with flags. In order to see all flag options, append the `--help` flag to each command. - -One of the flag options is the `--v` flag. This flag allows you to set the number of validators that the test network will have (i.e. the number of nodes to initialize and genesis transactions to generate). The default value for the `--v` flag is `4`, which is why four node directories were initialized in the example above. \ No newline at end of file +You can customize the configuration of the test network with flags. In order to see all flag options, append the `--help` flag to each command.