Skip to content

Commit

Permalink
Merge pull request #1832 from subspace/gemini-3f
Browse files Browse the repository at this point in the history
add gemini-3f and update compiled chainspec
  • Loading branch information
nazar-pc authored Aug 16, 2023
2 parents 6628790 + 9cce1f1 commit f379c65
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 196 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/chain-spec-snapshot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ jobs:

- name: Generate testnet chain specifications
run: |
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
docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3f-compiled --disable-default-bootnode > chain-spec-gemini-3f.json
docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3f-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3f.json
- name: Upload chain specifications to artifacts
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # @v3.1.1
with:
name: chain-specifications
path: |
chain-spec-gemini-3e.json
chain-spec-raw-gemini-3e.json
chain-spec-gemini-3f.json
chain-spec-raw-gemini-3f.json
if-no-files-found: error

- name: Upload chain specifications to assets
uses: alexellis/upload-assets@259de5111cb56966d046ced998941e93f91d2c93 # @0.4.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["chain-spec-gemini-3e.json", "chain-spec-raw-gemini-3e.json"]'
asset_paths: '["chain-spec-gemini-3f.json", "chain-spec-raw-gemini-3f.json"]'
164 changes: 0 additions & 164 deletions crates/subspace-node/res/chain-spec-raw-gemini-3e.json

This file was deleted.

15 changes: 7 additions & 8 deletions crates/subspace-node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use subspace_runtime_primitives::{AccountId, Balance, BlockNumber, SSC};

const SUBSPACE_TELEMETRY_URL: &str = "wss://telemetry.subspace.network/submit/";
const DEVNET_CHAIN_SPEC: &[u8] = include_bytes!("../res/chain-spec-raw-devnet.json");
const GEMINI_3E_CHAIN_SPEC: &[u8] = include_bytes!("../res/chain-spec-raw-gemini-3e.json");

/// List of accounts which should receive token grants, amounts are specified in SSC.
const TOKEN_GRANTS: &[(&str, u128)] = &[
Expand Down Expand Up @@ -86,13 +85,13 @@ struct GenesisParams {
confirmation_depth_k: u32,
}

pub fn gemini_3e_compiled() -> Result<ConsensusChainSpec<GenesisConfig>, String> {
pub fn gemini_3f_compiled() -> Result<ConsensusChainSpec<GenesisConfig>, String> {
Ok(ConsensusChainSpec::from_genesis(
// Name
"Subspace Gemini 3e",
"Subspace Gemini 3f",
// ID
"subspace_gemini_3e",
ChainType::Custom("Subspace Gemini 3e".to_string()),
"subspace_gemini_3f",
ChainType::Custom("Subspace Gemini 3f".to_string()),
|| {
let sudo_account =
AccountId::from_ss58check("5DNwQTHfARgKoa2NdiUM51ZUow7ve5xG9S2yYdSbVQcnYxBA")
Expand Down Expand Up @@ -163,7 +162,7 @@ pub fn gemini_3e_compiled() -> Result<ConsensusChainSpec<GenesisConfig>, String>
.map_err(|error| error.to_string())?,
),
// Protocol ID
Some("subspace-gemini-3e"),
Some("subspace-gemini-3f"),
None,
// Properties
Some(chain_spec_properties()),
Expand All @@ -172,8 +171,8 @@ pub fn gemini_3e_compiled() -> Result<ConsensusChainSpec<GenesisConfig>, String>
))
}

pub fn gemini_3e_config() -> Result<ConsensusChainSpec<GenesisConfig>, String> {
ConsensusChainSpec::from_json_bytes(GEMINI_3E_CHAIN_SPEC)
pub fn gemini_3f_config() -> Result<ConsensusChainSpec<GenesisConfig>, String> {
Err("Gemini 3f chainspec is yet to be compiled".to_string())
}

pub fn devnet_config() -> Result<ConsensusChainSpec<GenesisConfig>, String> {
Expand Down
17 changes: 9 additions & 8 deletions crates/subspace-node/src/domain/evm_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,22 @@ pub fn local_testnet_config<F: Fn() -> GenesisConfig + 'static + Send + Sync>(
)
}

pub fn gemini_3e_config<F: Fn() -> GenesisConfig + 'static + Send + Sync>(
pub fn gemini_3f_config<F: Fn() -> GenesisConfig + 'static + Send + Sync>(
constructor: F,
) -> ExecutionChainSpec<GenesisConfig> {
ExecutionChainSpec::from_genesis(
// Name
"Subspace Gemini 3e EVM Domain",
"Subspace Gemini 3f EVM Domain",
// ID
"subspace_gemini_3e_evm_domain",
"subspace_gemini_3f_evm_domain",
ChainType::Live,
constructor,
// Bootnodes
vec![],
// Telemetry
None,
// Protocol ID
Some("subspace-gemini-3e-evm-domain"),
Some("subspace-gemini-3f-evm-domain"),
None,
// Properties
Some(chain_spec_properties()),
Expand Down Expand Up @@ -153,7 +153,7 @@ pub fn load_chain_spec(spec_id: &str) -> Result<Box<dyn sc_cli::ChainSpec>, Stri

let chain_spec = match spec_id {
"dev" => development_config(move || constructor(SpecId::Dev)),
"gemini-3e" => gemini_3e_config(move || constructor(SpecId::Gemini)),
"gemini-3f" => gemini_3f_config(move || constructor(SpecId::Gemini)),
"devnet" => devnet_config(move || constructor(SpecId::DevNet)),
"" | "local" => local_testnet_config(move || constructor(SpecId::Local)),
path => ChainSpec::from_json_file(std::path::PathBuf::from(path))?,
Expand Down Expand Up @@ -208,8 +208,9 @@ pub fn get_testnet_genesis_by_spec_id(spec_id: SpecId) -> (GenesisConfig, Genesi
1002,
),
GenesisDomainParams {
// TODO: needs to be updated for new Gemini net
operator_signing_key: get_public_key_from_seed::<OperatorPublicKey>("Alice"),
operator_signing_key: OperatorPublicKey::unchecked_from(hex!(
"aa3b05b4d649666723e099cf3bafc2f2c04160ebe0e16ddc82f72d6ed97c4b6b"
)),
},
)
}
Expand Down Expand Up @@ -279,7 +280,7 @@ fn load_chain_spec_with(

let chain_spec = match spec_id {
"dev" => development_config(constructor),
"gemini-3e" => gemini_3e_config(constructor),
"gemini-3f" => gemini_3f_config(constructor),
"devnet" => devnet_config(constructor),
"" | "local" => local_testnet_config(constructor),
path => ChainSpec::from_json_file(std::path::PathBuf::from(path))?,
Expand Down
6 changes: 3 additions & 3 deletions crates/subspace-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ pub struct Cli {
pub enable_subspace_block_relay: bool,

/// Assigned PoT role for this node.
#[arg(long, default_value="none", value_parser(EnumValueParser::<CliPotRole>::new()))]
#[arg(long, default_value = "none", value_parser(EnumValueParser::< CliPotRole >::new()))]
pub pot_role: CliPotRole,
}

Expand Down Expand Up @@ -307,8 +307,8 @@ impl SubstrateCli for Cli {

fn load_spec(&self, id: &str) -> Result<Box<dyn ChainSpec>, String> {
let mut chain_spec = match id {
"gemini-3e-compiled" => chain_spec::gemini_3e_compiled()?,
"gemini-3e" => chain_spec::gemini_3e_config()?,
"gemini-3f-compiled" => chain_spec::gemini_3f_compiled()?,
"gemini-3f" => chain_spec::gemini_3f_config()?,
"devnet" => chain_spec::devnet_config()?,
"devnet-compiled" => chain_spec::devnet_config_compiled()?,
"dev" => chain_spec::dev_config()?,
Expand Down
16 changes: 8 additions & 8 deletions docs/farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-3e `
--chain gemini-3f `
--execution wasm `
--blocks-pruning 256 `
--state-pruning archive `
Expand Down Expand Up @@ -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-3e \
--chain gemini-3f \
--execution wasm \
--blocks-pruning 256 \
--state-pruning archive \
Expand Down Expand Up @@ -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-3e \
--chain gemini-3f \
--execution wasm \
--blocks-pruning 256 \
--state-pruning archive \
Expand Down Expand Up @@ -214,7 +214,7 @@ services:
- "0.0.0.0:30433:30433"
restart: unless-stopped
command: [
"--chain", "gemini-3e",
"--chain", "gemini-3f",
"--base-path", "/var/subspace",
"--execution", "wasm",
"--blocks-pruning", "256",
Expand Down Expand Up @@ -283,7 +283,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-3e.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-3f.subspace.network%2Fws#/explorer), from there you can interact with Subspace Network as any Substrate-based blockchain.

## Switching from older/different versions of Subspace

Expand All @@ -294,7 +294,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 --farm path=PATH_TO_PLOT,size=PLOT_SIZE wipe
# Replace `NODE_FILE_NAME` with the name of the node file you downloaded from releases
./NODE_FILE_NAME purge-chain --chain gemini-3e
./NODE_FILE_NAME purge-chain --chain gemini-3f
```
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.
Expand All @@ -316,8 +316,8 @@ Below are some helpful samples:

- `./FARMER_FILE_NAME --farm path=PATH_TO_PLOT,size=PLOT_SIZE farm ...` : will store data in `PATH_TO_PLOT` instead of default location
- `./FARMER_FILE_NAME --farm path=PATH_TO_PLOT,size=PLOT_SIZE wipe` : erases everything related to farmer if data were stored in `PATH_TO_PLOT`
- `./NODE_FILE_NAME --base-path PATH_TO_PLOT --chain gemini-3e ...` : start node and store data in `PATH_TO_PLOT` instead of default location
- `./NODE_FILE_NAME purge-chain --base-path PATH_TO_PLOT --chain gemini-3e` : erases data related to the node if data were stored in `PATH_TO_PLOT`
- `./NODE_FILE_NAME --base-path PATH_TO_PLOT --chain gemini-3f ...` : start node and store data in `PATH_TO_PLOT` instead of default location
- `./NODE_FILE_NAME purge-chain --base-path PATH_TO_PLOT --chain gemini-3f` : erases data related to the node if data were stored in `PATH_TO_PLOT`

Examples:
```bash
Expand Down

0 comments on commit f379c65

Please sign in to comment.