From cf6273233d3032a7d0a6e78db602ed3910cd581c Mon Sep 17 00:00:00 2001 From: rabbit something <350354+grepsuzette@users.noreply.github.com> Date: Sat, 4 Mar 2023 18:58:13 +0800 Subject: [PATCH 1/6] Create restart-on-block-1-to-read-the-genesis-again.md add how to restart at block 1 to read the genesis file again --- ...rt-on-block-1-to-read-the-genesis-again.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md diff --git a/docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md b/docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md new file mode 100644 index 0000000..f621e60 --- /dev/null +++ b/docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md @@ -0,0 +1,36 @@ +In order to obtain GNOT tokens for your tests, it's often said you can **edit the genesis** file. + +However if you launched `build/gnoland` locally already, you won't get any token. +That's because it starts again at whatever block it was, and at this point the genesis file isn't read anymore. + +`$ gnokey query auth/accounts/g1fjh9y7ausp27dqsdq0qrcsnmgvwm6829v2au7d` + +Response: +``` +height: 0 +data: null +``` + +In order to begin at the genesis again, just remove the testdir folder and start gnoland again: + +1. edit `gnoland/genesis/genesis_balances.txt` adding your address +2. `mv testdir testdir.old` +3. `build/gnoland` + +Now the blockchain restarts on block 1. + +`$ gnokey query auth/accounts/g1fjh9y7ausp27dqsdq0qrcsnmgvwm6829v2au7d` + +should work: +``` +height: 0 +data: { + "BaseAccount": { + "address": "g1fjh9y7ausp27dqsdq0qrcsnmgvwm6829v2au7d", + "coins": "10000000000ugnot", + "public_key": null, + "account_number": "5", + "sequence": "0" + } +} +``` From 015c4892820c3e825ee0c93da3e8f0ac8ef69186 Mon Sep 17 00:00:00 2001 From: rabbit something <350354+grepsuzette@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:03:08 +0800 Subject: [PATCH 2/6] update index.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5a8a635..04a6708 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ You can read the docs in [Gitbook](https://onbloc.gitbook.io/gnoland-developer-p * [Environment Setup](docs/environment-setup/) * [Initial Setup](docs/environment-setup/initial-setup.md) * [Build the Local Testnet](docs/environment-setup/build-the-local-testnet.md) + * [Restart on block 1 to read the genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) * [CLI](docs/cli/) * [Common Parameters](docs/cli/common-parameters.md) * [gnokey](docs/cli/gnokey.md) From 27121bfdecff82fc60932ebf402d7b8a4d202bd7 Mon Sep 17 00:00:00 2001 From: rabbit something <350354+grepsuzette@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:04:17 +0800 Subject: [PATCH 3/6] update docs/environment-setup/README.md --- docs/environment-setup/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/environment-setup/README.md b/docs/environment-setup/README.md index 697cf7b..45525b5 100644 --- a/docs/environment-setup/README.md +++ b/docs/environment-setup/README.md @@ -4,3 +4,4 @@ This section guides on how to set up development environments. * [Initial Setup](initial-setup.md) * [Build the Local Testnet](build-the-local-testnet.md) +* [Restart on block 1 to read the genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) From 85c35cfcb2d462effa1dc292b4e5217c92dc2725 Mon Sep 17 00:00:00 2001 From: rabbit something <350354+grepsuzette@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:05:17 +0800 Subject: [PATCH 4/6] Shorten title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 04a6708..35f00c2 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You can read the docs in [Gitbook](https://onbloc.gitbook.io/gnoland-developer-p * [Environment Setup](docs/environment-setup/) * [Initial Setup](docs/environment-setup/initial-setup.md) * [Build the Local Testnet](docs/environment-setup/build-the-local-testnet.md) - * [Restart on block 1 to read the genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) + * [Read the Genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) * [CLI](docs/cli/) * [Common Parameters](docs/cli/common-parameters.md) * [gnokey](docs/cli/gnokey.md) From 0f69ea330cbda007b269338a353057da52988f65 Mon Sep 17 00:00:00 2001 From: rabbit something <350354+grepsuzette@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:05:50 +0800 Subject: [PATCH 5/6] Update README.md --- docs/environment-setup/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment-setup/README.md b/docs/environment-setup/README.md index 45525b5..d812a1c 100644 --- a/docs/environment-setup/README.md +++ b/docs/environment-setup/README.md @@ -4,4 +4,4 @@ This section guides on how to set up development environments. * [Initial Setup](initial-setup.md) * [Build the Local Testnet](build-the-local-testnet.md) -* [Restart on block 1 to read the genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) +* [Read the genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) From 5869f4a2070b7f32492417b8a42571ae6c6cf49e Mon Sep 17 00:00:00 2001 From: rabbit something <350354+grepsuzette@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:06:20 +0800 Subject: [PATCH 6/6] Update README.md --- docs/environment-setup/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment-setup/README.md b/docs/environment-setup/README.md index d812a1c..b7495d1 100644 --- a/docs/environment-setup/README.md +++ b/docs/environment-setup/README.md @@ -4,4 +4,4 @@ This section guides on how to set up development environments. * [Initial Setup](initial-setup.md) * [Build the Local Testnet](build-the-local-testnet.md) -* [Read the genesis again](docs/environment-setup/restart-on-block-1-to-read-the-genesis-again.md) +* [Read the genesis again](restart-on-block-1-to-read-the-genesis-again.md)