Skip to content

Commit

Permalink
introduce Gemini-3c
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas committed Jan 18, 2023
1 parent d3a8537 commit 07baf80
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 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-3b-compiled --disable-default-bootnode > chain-spec-gemini-3b.json
docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3b-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3b.json
docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3c-compiled --disable-default-bootnode > chain-spec-gemini-3c.json
docker run --rm -u root ${{ steps.build.outputs.digest }} build-spec --chain gemini-3c-compiled --disable-default-bootnode --raw > chain-spec-raw-gemini-3c.json
- name: Upload chain specifications to artifacts
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # @v3.1.1
with:
name: chain-specifications
path: |
chain-spec-gemini-3b.json
chain-spec-raw-gemini-3b.json
chain-spec-gemini-3c.json
chain-spec-raw-gemini-3c.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-3b.json", "chain-spec-raw-gemini-3b.json"]'
asset_paths: '["chain-spec-gemini-3c.json", "chain-spec-raw-gemini-3c.json"]'
18 changes: 9 additions & 9 deletions crates/subspace-node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use subspace_runtime_primitives::{AccountId, Balance, BlockNumber, SSC};
use system_domain_runtime::GenesisConfig as SystemDomainGenesisConfig;

const SUBSPACE_TELEMETRY_URL: &str = "wss://telemetry.subspace.network/submit/";
const GEMINI_3B_CHAIN_SPEC: &[u8] = include_bytes!("../res/chain-spec-raw-gemini-3b.json");
// const GEMINI_3B_CHAIN_SPEC: &[u8] = include_bytes!("../res/chain-spec-raw-gemini-3b.json");
const X_NET_2_CHAIN_SPEC: &[u8] = include_bytes!("../res/chain-spec-raw-x-net-2.json");

/// List of accounts which should receive token grants, amounts are specified in SSC.
Expand Down Expand Up @@ -70,18 +70,18 @@ struct GenesisParams {
enable_transfer: bool,
}

pub fn gemini_3b() -> Result<ConsensusChainSpec<GenesisConfig, SystemDomainGenesisConfig>, String> {
ConsensusChainSpec::from_json_bytes(GEMINI_3B_CHAIN_SPEC)
pub fn gemini_3c() -> Result<ConsensusChainSpec<GenesisConfig, SystemDomainGenesisConfig>, String> {
unimplemented!("please run gemini-3c compiled chain")
}

pub fn gemini_3b_compiled(
pub fn gemini_3c_compiled(
) -> Result<ConsensusChainSpec<GenesisConfig, SystemDomainGenesisConfig>, String> {
Ok(ConsensusChainSpec::from_genesis(
// Name
"Subspace Gemini 3b",
"Subspace Gemini 3c",
// ID
"subspace_gemini_3b",
ChainType::Custom("Subspace Gemini 3b".to_string()),
"subspace_gemini_3c",
ChainType::Custom("Subspace Gemini 3c".to_string()),
|| {
let sudo_account =
AccountId::from_ss58check("5CXTmJEusve5ixyJufqHThmy4qUrrm6FyLCR7QfE4bbyMTNC")
Expand Down Expand Up @@ -150,13 +150,13 @@ pub fn gemini_3b_compiled(
.map_err(|error| error.to_string())?,
),
// Protocol ID
Some("subspace-gemini-3b"),
Some("subspace-gemini-3c"),
None,
// Properties
Some(chain_spec_properties()),
// Extensions
ChainSpecExtensions {
execution_chain_spec: system_domain::chain_spec::gemini_3b_config(),
execution_chain_spec: system_domain::chain_spec::gemini_3c_config(),
},
))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-node/src/core_domain/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl SubstrateCli for CoreDomainCli {
let chain_spec = match self.domain_id {
DomainId::CORE_PAYMENTS => match id {
"dev" => core_payments_chain_spec::development_config(),
"gemini-3b" => core_payments_chain_spec::gemini_3b_config(),
"gemini-3c" => core_payments_chain_spec::gemini_3c_config(),
"" | "local" => core_payments_chain_spec::local_testnet_config(),
path => core_payments_chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ pub fn local_testnet_config() -> ExecutionChainSpec<GenesisConfig> {
)
}

pub fn gemini_3b_config() -> ExecutionChainSpec<GenesisConfig> {
pub fn gemini_3c_config() -> ExecutionChainSpec<GenesisConfig> {
ExecutionChainSpec::from_genesis(
// Name
"Subspace Gemini 3b Core Payments Domain",
"Subspace Gemini 3c Core Payments Domain",
// ID
"subspace_gemini_3b_core_payments_domain",
"subspace_gemini_3c_core_payments_domain",
ChainType::Local,
move || {
let sudo_account =
Expand All @@ -136,7 +136,7 @@ pub fn gemini_3b_config() -> ExecutionChainSpec<GenesisConfig> {
// Telemetry
None,
// Protocol ID
Some("subspace-gemini-3b-core-payments-domain"),
Some("subspace-gemini-3c-core-payments-domain"),
None,
// Properties
Some(chain_spec_properties()),
Expand Down
4 changes: 2 additions & 2 deletions crates/subspace-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ impl SubstrateCli for Cli {

fn load_spec(&self, id: &str) -> Result<Box<dyn ChainSpec>, String> {
let mut chain_spec = match id {
"gemini-3b" => chain_spec::gemini_3b()?,
"gemini-3b-compiled" => chain_spec::gemini_3b_compiled()?,
"gemini-3c" => chain_spec::gemini_3c()?,
"gemini-3c-compiled" => chain_spec::gemini_3c_compiled()?,
"x-net-2" => chain_spec::x_net_2_config()?,
"x-net-2-compiled" => chain_spec::x_net_2_config_compiled()?,
"dev" => chain_spec::dev_config()?,
Expand Down
8 changes: 4 additions & 4 deletions crates/subspace-node/src/system_domain/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ pub fn local_testnet_config() -> ExecutionChainSpec<GenesisConfig> {
)
}

pub fn gemini_3b_config() -> ExecutionChainSpec<GenesisConfig> {
pub fn gemini_3c_config() -> ExecutionChainSpec<GenesisConfig> {
ExecutionChainSpec::from_genesis(
// Name
"Subspace Gemini 3b System Domain",
"Subspace Gemini 3c System Domain",
// ID
"subspace_gemini_3b_system_domain",
"subspace_gemini_3c_system_domain",
ChainType::Local,
move || {
let sudo_account =
Expand Down Expand Up @@ -217,7 +217,7 @@ pub fn gemini_3b_config() -> ExecutionChainSpec<GenesisConfig> {
// Telemetry
None,
// Protocol ID
Some("subspace-gemini-3b-system-domain"),
Some("subspace-gemini-3c-system-domain"),
None,
// Properties
Some(chain_spec_properties()),
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-3b `
--chain gemini-3c `
--execution wasm `
--blocks-pruning archive `
--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-3b \
--chain gemini-3c \
--execution wasm \
--blocks-pruning archive \
--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-3b \
--chain gemini-3c \
--execution wasm \
--blocks-pruning archive \
--state-pruning archive \
Expand Down Expand Up @@ -214,7 +214,7 @@ services:
- "0.0.0.0:30433:30433"
restart: unless-stopped
command: [
"--chain", "gemini-3b",
"--chain", "gemini-3c",
"--base-path", "/var/subspace",
"--execution", "wasm",
"--blocks-pruning", "archive",
Expand Down Expand Up @@ -289,7 +289,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-3b.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-3c.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 @@ -300,7 +300,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-3b
./NODE_FILE_NAME purge-chain --chain gemini-3c
```
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 @@ -322,8 +322,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-3b ...` : 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-3b` : erases data related to the node if data were stored in `/path/to/data`
- `./NODE_FILE_NAME --base-path /path/to/data --chain gemini-3c ...` : 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-3c` : erases data related to the node if data were stored in `/path/to/data`

Examples:
```bash
Expand Down

0 comments on commit 07baf80

Please sign in to comment.