From 0126e174a1814bfc6bc9a809e3d595ac2c50fdf4 Mon Sep 17 00:00:00 2001 From: "Alisher A. Khassanov" Date: Mon, 18 Dec 2023 17:48:10 +0600 Subject: [PATCH] chore: PR #201 is backported --- docs/genesis-state.md | 7 ++++++- node/service/chain-specs/example.json | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/genesis-state.md b/docs/genesis-state.md index 587683b62..0e1c8b98f 100644 --- a/docs/genesis-state.md +++ b/docs/genesis-state.md @@ -1,4 +1,4 @@ -# State preset +# Genesis state Sometimes we use the blockchain as a part of a test environment. Those tests typically want a certain state of the blockchain. @@ -22,6 +22,11 @@ And a _raw_ form with key-value pairs which will be written to the database. 1. Set genesis state for each module. There is an example in `node/service/example.json`, you can copy everything except the `code` field value from it to the `plain.json`. + > Special note for a `ddcNodes.storageNodes.host` field. + > In the `example.json` it is set as: + > `"host": [ 49, 50, 55, 46, 48, 46, 48, 46, 49 ]`. + > Where the array is an encoded `127.0.0.1` value. + 1. Create a raw form chain spec. ```console diff --git a/node/service/chain-specs/example.json b/node/service/chain-specs/example.json index a9394d98b..fcec23193 100644 --- a/node/service/chain-specs/example.json +++ b/node/service/chain-specs/example.json @@ -175,7 +175,17 @@ "provider_id": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", "cluster_id": "0x0000000000000000000000000000000000000001", "props": { - "host": [], + "host": [ + 49, + 50, + 55, + 46, + 48, + 46, + 48, + 46, + 49 + ], "http_port": 8080, "grpc_port": 8081, "p2p_port": 8082