From 8ec95e87ae9e4addf16c91f727d9943688e2d6a8 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Thu, 29 Jun 2023 17:19:34 +0300 Subject: [PATCH] Prepare for Gemini 3e chain spec creation --- .../workflows/chain-spec-snapshot-build.yml | 10 ++++----- crates/subspace-node/src/chain_spec.rs | 12 +++++----- .../src/domain/evm_chain_spec.rs | 12 +++++----- crates/subspace-node/src/lib.rs | 2 +- docs/farming.md | 22 +++++++++---------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/chain-spec-snapshot-build.yml b/.github/workflows/chain-spec-snapshot-build.yml index 6abd3767b9..025577a0dc 100644 --- a/.github/workflows/chain-spec-snapshot-build.yml +++ b/.github/workflows/chain-spec-snapshot-build.yml @@ -28,16 +28,16 @@ jobs: - name: Generate testnet chain specifications run: | - docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3d-compiled --disable-default-bootnode > chain-spec-gemini-3d.json - docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3d-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3d.json + docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3e-compiled --disable-default-bootnode > chain-spec-gemini-3e.json + docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3e-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3e.json - name: Upload chain specifications to artifacts uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # @v3.1.1 with: name: chain-specifications path: | - chain-spec-gemini-3d.json - chain-spec-raw-gemini-3d.json + chain-spec-gemini-3e.json + chain-spec-raw-gemini-3e.json if-no-files-found: error - name: Upload chain specifications to assets @@ -45,4 +45,4 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - asset_paths: '["chain-spec-gemini-3d.json", "chain-spec-raw-gemini-3d.json"]' + asset_paths: '["chain-spec-gemini-3e.json", "chain-spec-raw-gemini-3e.json"]' diff --git a/crates/subspace-node/src/chain_spec.rs b/crates/subspace-node/src/chain_spec.rs index 7716fa9803..b99dd243e4 100644 --- a/crates/subspace-node/src/chain_spec.rs +++ b/crates/subspace-node/src/chain_spec.rs @@ -82,16 +82,16 @@ struct GenesisParams { confirmation_depth_k: u32, } -pub fn gemini_3d_compiled() -> Result, String> { +pub fn gemini_3e_compiled() -> Result, String> { Ok(ConsensusChainSpec::from_genesis( // Name - "Subspace Gemini 3d", + "Subspace Gemini 3e", // ID - "subspace_gemini_3d", - ChainType::Custom("Subspace Gemini 3d".to_string()), + "subspace_gemini_3e", + ChainType::Custom("Subspace Gemini 3e".to_string()), || { let sudo_account = - AccountId::from_ss58check("5CZy4hcmaVZUMZLfB41v1eAKvtZ8W7axeWuDvwjhjPwfhAqt") + AccountId::from_ss58check("5DNwQTHfARgKoa2NdiUM51ZUow7ve5xG9S2yYdSbVQcnYxBA") .expect("Wrong root account address"); let mut balances = vec![(sudo_account.clone(), 1_000 * SSC)]; @@ -158,7 +158,7 @@ pub fn gemini_3d_compiled() -> Result, String> .map_err(|error| error.to_string())?, ), // Protocol ID - Some("subspace-gemini-3d"), + Some("subspace-gemini-3e"), None, // Properties Some(chain_spec_properties()), diff --git a/crates/subspace-node/src/domain/evm_chain_spec.rs b/crates/subspace-node/src/domain/evm_chain_spec.rs index fdfa8922c8..bdd0338fc2 100644 --- a/crates/subspace-node/src/domain/evm_chain_spec.rs +++ b/crates/subspace-node/src/domain/evm_chain_spec.rs @@ -115,12 +115,12 @@ pub fn local_testnet_config() -> ExecutionChainSpec { ) } -pub fn gemini_3d_config() -> ExecutionChainSpec { +pub fn gemini_3e_config() -> ExecutionChainSpec { ExecutionChainSpec::from_genesis( // Name - "Subspace Gemini 3d EVM Domain", + "Subspace Gemini 3e EVM Domain", // ID - "subspace_gemini_3d_evm_domain", + "subspace_gemini_3e_evm_domain", ChainType::Live, move || { let sudo_account = AccountId::from_str("f31e60022e290708c17d6997c34de6a30d09438f") @@ -143,7 +143,7 @@ pub fn gemini_3d_config() -> ExecutionChainSpec { // Telemetry None, // Protocol ID - Some("subspace-gemini-3d-evm-domain"), + Some("subspace-gemini-3e-evm-domain"), None, // Properties Some(chain_spec_properties()), @@ -193,10 +193,10 @@ pub fn devnet_config() -> ExecutionChainSpec { ) } -pub fn load_chain_spec(spec_id: &str) -> std::result::Result, String> { +pub fn load_chain_spec(spec_id: &str) -> Result, String> { let chain_spec = match spec_id { "dev" => development_config(), - "gemini-3d" => gemini_3d_config(), + "gemini-3e" => gemini_3e_config(), "devnet" => devnet_config(), "" | "local" => local_testnet_config(), path => ChainSpec::from_json_file(std::path::PathBuf::from(path))?, diff --git a/crates/subspace-node/src/lib.rs b/crates/subspace-node/src/lib.rs index 4c2323e101..57106933aa 100644 --- a/crates/subspace-node/src/lib.rs +++ b/crates/subspace-node/src/lib.rs @@ -281,7 +281,7 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> Result, String> { let mut chain_spec = match id { - "gemini-3d-compiled" => chain_spec::gemini_3d_compiled()?, + "gemini-3e-compiled" => chain_spec::gemini_3e_compiled()?, "gemini-3d" => chain_spec::gemini_3d_config()?, "devnet" => chain_spec::devnet_config()?, "devnet-compiled" => chain_spec::devnet_config_compiled()?, diff --git a/docs/farming.md b/docs/farming.md index 070e60e1c7..1e3f68caef 100644 --- a/docs/farming.md +++ b/docs/farming.md @@ -44,7 +44,7 @@ If you're connected directly without any router, then again nothing needs to be # Replace `INSERT_YOUR_ID` with a nickname you choose # Copy all of the lines below, they are all part of the same command .\NODE_FILE_NAME.exe ` ---chain gemini-3d ` +--chain gemini-3e ` --execution wasm ` --blocks-pruning archive ` --state-pruning archive ` @@ -58,7 +58,7 @@ If you're connected directly without any router, then again nothing needs to be 2022-02-03 10:52:23 Subspace 2022-02-03 10:52:23 ✌️ version 0.1.0-35cf6f5-x86_64-windows 2022-02-03 10:52:23 ❤️ by Subspace Labs , 2021-2022 -2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 3b +2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 3e 2022-02-03 10:52:23 🏷 Node name: YOUR_FANCY_NAME 2022-02-03 10:52:23 👤 Role: AUTHORITY 2022-02-03 10:52:23 💾 Database: RocksDb at C:\Users\X\AppData\Local\subspace-node-windows-x86_64-snapshot-2022-jan-05.exe\data\chains\subspace_test\db\full @@ -96,7 +96,7 @@ If you're connected directly without any router, then again nothing needs to be # Replace `INSERT_YOUR_ID` with a nickname you choose # Copy all of the lines below, they are all part of the same command ./NODE_FILE_NAME \ - --chain gemini-3d \ + --chain gemini-3e \ --execution wasm \ --blocks-pruning archive \ --state-pruning archive \ @@ -110,7 +110,7 @@ If you're connected directly without any router, then again nothing needs to be 2022-02-03 10:52:23 Subspace 2022-02-03 10:52:23 ✌️ version 0.1.0-35cf6f5-x86_64-ubuntu 2022-02-03 10:52:23 ❤️ by Subspace Labs , 2021-2022 -2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 3b +2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 3e 2022-02-03 10:52:23 🏷 Node name: YOUR_FANCY_NAME 2022-02-03 10:52:23 👤 Role: AUTHORITY 2022-02-03 10:52:23 💾 Database: RocksDb at /home/X/.local/share/subspace-node-x86_64-ubuntu-20.04-snapshot-2022-jan-05/chains/subspace_test/db/full @@ -151,7 +151,7 @@ After this, simply repeat the step you prompted for (step 4 or 6). This time, cl # Replace `INSERT_YOUR_ID` with a nickname you choose # Copy all of the lines below, they are all part of the same command ./NODE_FILE_NAME \ - --chain gemini-3d \ + --chain gemini-3e \ --execution wasm \ --blocks-pruning archive \ --state-pruning archive \ @@ -165,7 +165,7 @@ After this, simply repeat the step you prompted for (step 4 or 6). This time, cl 2022-02-03 10:52:23 Subspace 2022-02-03 10:52:23 ✌️ version 0.1.0-35cf6f5-x86_64-macos 2022-02-03 10:52:23 ❤️ by Subspace Labs , 2021-2022 -2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 3b +2022-02-03 10:52:23 📋 Chain specification: Subspace Gemini 3e 2022-02-03 10:52:23 🏷 Node name: YOUR_FANCY_NAME 2022-02-03 10:52:23 👤 Role: AUTHORITY 2022-02-03 10:52:23 💾 Database: RocksDb at /Users/X/Library/Application Support/subspace-node-x86_64-macos-11-snapshot-2022-jan-05/chains/subspace_test/db/full @@ -214,7 +214,7 @@ services: - "0.0.0.0:30433:30433" restart: unless-stopped command: [ - "--chain", "gemini-3d", + "--chain", "gemini-3e", "--base-path", "/var/subspace", "--execution", "wasm", "--blocks-pruning", "archive", @@ -286,7 +286,7 @@ You can read logs with `docker-compose logs --tail=1000 -f`, for the rest read [ ## Checking results and interacting with the network -Visit [Polkadot.js explorer](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Feu-0.gemini-3d.subspace.network%2Fws#/explorer), from there you can interact with Subspace Network as any Substrate-based blockchain. +Visit [Polkadot.js explorer](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Feu-0.gemini-3e.subspace.network%2Fws#/explorer), from there you can interact with Subspace Network as any Substrate-based blockchain. ## Switching from older/different versions of Subspace @@ -297,7 +297,7 @@ If you were running a node previously, and want to switch to a new snapshot, ple # Replace `FARMER_FILE_NAME` with the name of the node file you downloaded from releases ./FARMER_FILE_NAME wipe # Replace `NODE_FILE_NAME` with the name of the node file you downloaded from releases -./NODE_FILE_NAME purge-chain --chain gemini-3d +./NODE_FILE_NAME purge-chain --chain gemini-3e ``` Does not matter if the node/farmer executable is the previous one or from the new snapshot, both will work :) The reason we require this is, with every snapshot change, the network might get partitioned, and you may be on a different genesis than the current one. @@ -319,8 +319,8 @@ Below are some helpful samples: - `./FARMER_FILE_NAME --base-path /path/to/data farm ...` : will store data in `/path/to/data` instead of default location - `./FARMER_FILE_NAME --base-path /path/to/data wipe` : erases everything related to farmer if data were stored in `/path/to/data` -- `./NODE_FILE_NAME --base-path /path/to/data --chain gemini-3d ...` : start node and store data in `/path/to/data` instead of default location -- `./NODE_FILE_NAME purge-chain --base-path /path/to/data --chain gemini-3d` : erases data related to the node if data were stored in `/path/to/data` +- `./NODE_FILE_NAME --base-path /path/to/data --chain gemini-3e ...` : start node and store data in `/path/to/data` instead of default location +- `./NODE_FILE_NAME purge-chain --base-path /path/to/data --chain gemini-3e` : erases data related to the node if data were stored in `/path/to/data` Examples: ```bash