Skip to content

Commit ce6793d

Browse files
authored
Merge pull request #493 from opentensor/fix/chainspecs
fix: chainspec irregularities
2 parents f62d824 + 0ce8638 commit ce6793d

15 files changed

+104235
-255853
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Update Chainspecs
2+
3+
concurrency:
4+
group: update-chainspec-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [main, testnet, staging, staging-ready]
10+
11+
workflow_dispatch:
12+
inputs:
13+
verbose:
14+
description: "Output more information when triggered manually"
15+
required: false
16+
default: ""
17+
18+
env:
19+
CARGO_TERM_COLOR: always
20+
VERBOSE: ${{ github.events.input.verbose }}
21+
22+
jobs:
23+
update-chainspecs:
24+
runs-on: SubtensorCI
25+
permissions:
26+
contents: write
27+
28+
strategy:
29+
matrix:
30+
rust-branch:
31+
- nightly-2024-03-05
32+
rust-target:
33+
- x86_64-unknown-linux-gnu
34+
os:
35+
- ubuntu-latest
36+
include:
37+
- os: ubuntu-latest
38+
env:
39+
RELEASE_NAME: development
40+
RUSTV: ${{ matrix.rust-branch }}
41+
RUST_BACKTRACE: full
42+
RUST_BIN_DIR: target/${{ matrix.rust-target }}
43+
TARGET: ${{ matrix.rust-target }}
44+
steps:
45+
- name: Check-out repository under $GITHUB_WORKSPACE
46+
uses: actions/checkout@v2
47+
48+
- name: Install dependencies
49+
run: |
50+
sudo apt-get update &&
51+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
52+
53+
- name: Install Rust ${{ matrix.rust-branch }}
54+
uses: actions-rs/toolchain@v1.0.6
55+
with:
56+
toolchain: ${{ matrix.rust-branch }}
57+
components: rustfmt, clippy
58+
profile: minimal
59+
60+
- name: Utilize Shared Rust Cache
61+
uses: Swatinem/rust-cache@v2.2.1
62+
with:
63+
key: ${{ matrix.os }}-${{ env.RUST_BIN_DIR }}
64+
65+
- name: Build chainspecs
66+
run: ./scripts/build_all_chainspecs.sh
67+
68+
- uses: stefanzweifel/git-auto-commit-action@v5
69+
name: Commit any updated chainspecs
70+
with:
71+
commit_message: Update chainspecs

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ COPY Cargo.lock Cargo.toml /subtensor/
3838

3939
# Specs
4040
COPY ./snapshot.json /subtensor/snapshot.json
41-
COPY ./raw_spec.json /subtensor/raw_spec.json
42-
COPY ./raw_testspec.json /subtensor/raw_testspec.json
41+
COPY ./raw_spec_testfinney.json /subtensor/raw_spec_testfinney.json
42+
COPY ./raw_spec_finney.json /subtensor/raw_spec_finney.json
4343

4444
# Copy our sources
4545
COPY ./node /subtensor/node
@@ -59,6 +59,6 @@ EXPOSE 30333 9933 9944
5959
FROM $BASE_IMAGE AS subtensor
6060

6161
COPY --from=builder /subtensor/snapshot.json /
62-
COPY --from=builder /subtensor/raw_spec.json /
63-
COPY --from=builder /subtensor/raw_testspec.json /
62+
COPY --from=builder /subtensor/raw_spec_testfinney.json /
63+
COPY --from=builder /subtensor/raw_spec_finney.json /
6464
COPY --from=builder /subtensor/target/production/node-subtensor /usr/local/bin

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3.8'
1+
version: "3.8"
22

33
volumes:
44
mainnet-lite-volume:
@@ -38,7 +38,7 @@ services:
3838
- |
3939
node-subtensor \
4040
--base-path /tmp/blockchain \
41-
--chain raw_spec.json \
41+
--chain raw_spec_finney.json \
4242
--rpc-external --rpc-cors all \
4343
--no-mdns \
4444
--in-peers 500 --out-peers 500 \
@@ -56,7 +56,7 @@ services:
5656
- |
5757
node-subtensor \
5858
--base-path /tmp/blockchain \
59-
--chain raw_spec.json \
59+
--chain raw_spec_finney.json \
6060
--rpc-external --rpc-cors all \
6161
--no-mdns \
6262
--in-peers 500 --out-peers 500 \
@@ -74,7 +74,7 @@ services:
7474
- |
7575
node-subtensor \
7676
--base-path /tmp/blockchain \
77-
--chain raw_testspec.json \
77+
--chain raw_spec_testfinney.json \
7878
--rpc-external --rpc-cors all \
7979
--no-mdns \
8080
--in-peers 500 --out-peers 500 \
@@ -94,7 +94,7 @@ services:
9494
- |
9595
node-subtensor \
9696
--base-path /tmp/blockchain \
97-
--chain raw_testspec.json \
97+
--chain raw_spec_testfinney.json \
9898
--rpc-external --rpc-cors all \
9999
--no-mdns \
100100
--in-peers 500 --out-peers 500 \

finney_plain_spec.json

Lines changed: 0 additions & 103931 deletions
This file was deleted.

node/src/chain_spec/finney.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
6262
let mut properties = sc_service::Properties::new();
6363
properties.insert("tokenSymbol".into(), "TAO".into());
6464
properties.insert("tokenDecimals".into(), 9.into());
65-
properties.insert("ss58Format".into(), 13116.into());
65+
properties.insert("ss58Format".into(), 42.into());
6666

6767
Ok(ChainSpec::builder(
6868
wasm_binary,
@@ -72,8 +72,14 @@ pub fn finney_mainnet_config() -> Result<ChainSpec, String> {
7272
},
7373
)
7474
.with_name("Bittensor")
75+
.with_protocol_id("bittensor")
7576
.with_id("bittensor")
7677
.with_chain_type(ChainType::Live)
78+
.with_boot_nodes(vec![
79+
"/dns/bootnode.finney.chain.opentensor.ai/tcp/30333/ws/p2p/12D3KooWRwbMb85RWnT8DSXSYMWQtuDwh4LJzndoRrTDotTR5gDC"
80+
.parse()
81+
.unwrap(),
82+
])
7783
.with_genesis_config_patch(finney_genesis(
7884
// Initial PoA authorities (Validators)
7985
// aura | grandpa
@@ -193,9 +199,9 @@ fn finney_genesis(
193199
.collect::<Vec<_>>(),
194200
},
195201
"sudo": { "key": Some(<AccountId32 as Ss58Codec>::from_ss58check("5FCM3DBXWiGcwYYQtT8z4ZD93TqYpYxjaAfgv6aMStV1FTCT").unwrap()) },
196-
"subtensor_module": {
202+
"subtensorModule": {
197203
"stakes": stakes,
198-
"balances_issuance": balances_issuance,
204+
"balancesIssuance": balances_issuance,
199205
}
200206
})
201207
}

node/src/chain_spec/localnet.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
1010
let mut properties = sc_service::Properties::new();
1111
properties.insert("tokenSymbol".into(), "TAO".into());
1212
properties.insert("tokenDecimals".into(), 9.into());
13-
properties.insert("ss58Format".into(), 13116.into());
13+
properties.insert("ss58Format".into(), 42.into());
1414

1515
Ok(ChainSpec::builder(
1616
wasm_binary,
@@ -26,6 +26,7 @@ pub fn localnet_config() -> Result<ChainSpec, String> {
2626
},
2727
)
2828
.with_name("Bittensor")
29+
.with_protocol_id("bittensor")
2930
.with_id("bittensor")
3031
.with_chain_type(ChainType::Development)
3132
.with_genesis_config_patch(localnet_genesis(

node/src/chain_spec/testnet.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
6262
let mut properties = sc_service::Properties::new();
6363
properties.insert("tokenSymbol".into(), "TAO".into());
6464
properties.insert("tokenDecimals".into(), 9.into());
65-
properties.insert("ss58Format".into(), 13116.into());
65+
properties.insert("ss58Format".into(), 42.into());
6666

6767
Ok(ChainSpec::builder(
6868
wasm_binary,
@@ -72,6 +72,12 @@ pub fn finney_testnet_config() -> Result<ChainSpec, String> {
7272
},
7373
)
7474
.with_name("Bittensor")
75+
.with_boot_nodes(vec![
76+
"/dns/bootnode.test.chain.opentensor.ai/tcp/30333/p2p/12D3KooWPM4mLcKJGtyVtkggqdG84zWrd7Rij6PGQDoijh1X86Vr"
77+
.parse()
78+
.unwrap(),
79+
])
80+
.with_protocol_id("bittensor")
7581
.with_id("bittensor")
7682
.with_chain_type(ChainType::Development)
7783
.with_genesis_config_patch(testnet_genesis(

plain_spec_finney.json

Lines changed: 104030 additions & 104038 deletions
Large diffs are not rendered by default.

plain_spec_testfinney.json

Lines changed: 55 additions & 58 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)