Skip to content

Commit f80a035

Browse files
author
Max Gravitt
committed
updated hashed spec
1 parent 7ef9e04 commit f80a035

File tree

4 files changed

+64
-178
lines changed

4 files changed

+64
-178
lines changed

collator/src/chain_spec/hashed.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pub fn get_chain_spec() -> HashedChainSpec {
2121
let mut properties = sc_chain_spec::Properties::new();
2222
properties.insert("tokenSymbol".into(), "HASH".into());
2323
properties.insert("tokenDecimals".into(), 18.into());
24-
properties.insert("ss58Format".into(), 3000.into());
25-
properties.insert("prefix".into(), 3000.into());
24+
properties.insert("ss58Format".into(), 9072.into());
25+
properties.insert("prefix".into(), 9072.into());
2626
properties.insert("network".into(), "hashed".into());
2727
properties.insert("displayName".into(), "Hashed Network".into());
2828
properties.insert("standardAccount".into(),"*25519".into());
@@ -39,25 +39,25 @@ pub fn get_chain_spec() -> HashedChainSpec {
3939
// initial collators.
4040
vec![
4141
(
42-
// LocalTestnet
43-
// 5DHun9L82cdeZfR5ufzsod4tBfcU2AoQT3XJoRpCoasYefQj
44-
hex!["364e8e853de71a91892b8ce50308b4229c0c21863a7ec788d5e4f2f5f957e224"].into(),
45-
hex!["364e8e853de71a91892b8ce50308b4229c0c21863a7ec788d5e4f2f5f957e224"].unchecked_into(),
42+
// JA
43+
// haZmb2DUWLEjv3z7NDn5nArSGoMgaN6xeJdAr9TDaeQYpxe6g
44+
hex!["90150e105b07c3357d43ed5c727efb9be347699cb2b5a41a26423b559615b222"].into(),
45+
hex!["90150e105b07c3357d43ed5c727efb9be347699cb2b5a41a26423b559615b222"].unchecked_into(),
4646
),
4747
(
48-
// Coll2
49-
// 5FcANChPbU6sNa4TxGiPMAKookH8u1XdUw9K2ruS3G2SYvHR
50-
hex!["9cb28bbb15e92ab4431f3ada24b5026c8a6c00ac236dd3ebf0196718c1d2f021"].into(),
51-
hex!["9cb28bbb15e92ab4431f3ada24b5026c8a6c00ac236dd3ebf0196718c1d2f021"].unchecked_into(),
48+
// MdL
49+
// haWa1d98tnLtvNCLSrdWmSo1DYHQDiKBoM9s5xNYtScTUwJ74
50+
hex!["028c3a5c8890c3e98023b35f99a5d904b170612b78b6b9fdd8f60cbf24ab9f59"].into(),
51+
hex!["028c3a5c8890c3e98023b35f99a5d904b170612b78b6b9fdd8f60cbf24ab9f59"].unchecked_into(),
5252
),
5353
],
5454
vec![
55-
// LocalTestnet
56-
// 5DHun9L82cdeZfR5ufzsod4tBfcU2AoQT3XJoRpCoasYefQj
57-
hex!["364e8e853de71a91892b8ce50308b4229c0c21863a7ec788d5e4f2f5f957e224"].into(),
55+
// GW
56+
// haWZRqBVdT9vDAM1Wpga7B1GZ99WDWnXsLyzCBtpwrjPLaZUa
57+
hex!["021a78fcc3ec988411388ec2f8ab25fbb79a7eaacead997d13f211ebe34ce359"].into(),
5858
],
59-
hex!["364e8e853de71a91892b8ce50308b4229c0c21863a7ec788d5e4f2f5f957e224"].into(),
60-
2000.into(),
59+
hex!["021a78fcc3ec988411388ec2f8ab25fbb79a7eaacead997d13f211ebe34ce359"].into(),
60+
2093.into(),
6161
)
6262
},
6363
Vec::new(),
@@ -66,8 +66,8 @@ pub fn get_chain_spec() -> HashedChainSpec {
6666
None,
6767
Some(properties),
6868
Extensions {
69-
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
70-
para_id: 2000,
69+
relay_chain: "polkadot".into(), // You MUST set this to the correct network!
70+
para_id: 2093,
7171
},
7272
)
7373
}

docs/parachain/quick-start-hashed.md

Lines changed: 3 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
1-
# Quick Start
2-
This is a quick guide on connecting the parachain to a local testnet relay chain.
31

4-
# Launch the Relay Chain
5-
```bash
6-
cd ~/github.com/paritytech
7-
8-
git clone https://github.com/paritytech/polkadot
9-
cd polkadot
10-
11-
cargo build --release
12-
13-
# Generate a raw chain spec
14-
./target/release/polkadot build-spec --chain rococo-local --disable-default-bootnode --raw > ~/github.com/paritytech/polkadot/rococo-custom-2-raw.json
15-
16-
# Alice
17-
./target/release/polkadot --alice --validator --base-path /tmp/relay/alice --chain ~/github.com/paritytech/polkadot/rococo-custom-2-raw.json --port 30333 --ws-port 9944
18-
19-
# Bob (In a separate terminal)
20-
./target/release/polkadot --bob --validator --base-path /tmp/relay/bob --chain ~/github.com/paritytech/polkadot/rococo-custom-2-raw.json --port 30334 --ws-port 9945
21-
```
22-
23-
# Reserve the Para ID
24-
Go to https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/parachains/parathreads
25-
26-
and Click `+ParaID`
27-
28-
# Launch the Parachain
2+
# Building the Hashed Parachain Spec
293
```bash
304

315
cd ~/github.com/hashed-io
@@ -35,41 +9,14 @@ cd hashed-substrate
359

3610
cargo build --release
3711

38-
./target/release/hashed-parachain build-spec --chain hashed --disable-default-bootnode > hashed-local-parachain.json
12+
./target/release/hashed-parachain build-spec --chain hashed --disable-default-bootnode > resources/hashed-spec.json
3913

40-
./target/release/hashed-parachain build-spec --chain hashed --disable-default-bootnode > hashed-local-parachain.json
4114
```
4215

43-
# Add the ParaID
44-
Update `md5-local-parachain.json` and change the parachain ID to 2000 in two places.
45-
46-
```json
47-
// --snip--
48-
"para_id": 2000,
49-
// --snip--
50-
"parachainInfo": {
51-
"parachainId": 2000
52-
},
53-
// --snip--
54-
```
55-
56-
# Change amount for endowed account to
57-
58-
1000000000000000000000000000
59-
60-
1 billion with 18 decimal places
61-
6216
# Build the Raw Spec File
6317
```bash
6418
# build raw spec
65-
./target/release/hashed-parachain build-spec --chain hashed-local-parachain.json --raw --disable-default-bootnode > hashed-local-parachain-raw.json
66-
```
67-
68-
# Building genesis state and wasm files
69-
```bash
70-
./target/release/hashed-parachain export-genesis-state --chain hashed-local-parachain-raw.json > hashed-genesis-head
71-
72-
./target/release/hashed-parachain export-genesis-wasm --chain hashed-local-parachain-raw.json > hashed-wasm-upgrade
19+
./target/release/hashed-parachain build-spec --chain hashed --raw --disable-default-bootnode > hashed-parachain-raw.json
7320
```
7421

7522
# Building genesis state and wasm files
@@ -100,45 +47,7 @@ Update `md5-local-parachain.json` and change the parachain ID to 2000 in two pla
10047
![image](https://user-images.githubusercontent.com/2915325/99548884-1be13580-2987-11eb-9a8b-20be658d34f9.png)
10148

10249

103-
# Generate new WASM
104-
```bash
105-
./target/release/hashed-parachain export-genesis-wasm --chain hashed > hashed-wasm-upgrade
106-
```
107-
108-
# Start Second Collator
109-
```bash
110-
./target/release/hashed-parachain \
111-
--bob \
112-
--collator \
113-
--force-authoring \
114-
--chain hashed \
115-
--base-path /tmp/parachain/bob \
116-
--port 40334 \
117-
--ws-port 8845 \
118-
-- \
119-
--execution wasm \
120-
--chain ~/github.com/paritytech/polkadot/rococo-custom-2-raw.json \
121-
--port 30344 \
122-
--ws-port 9978
123-
124-
```
125-
12650
## Insert second collator key
12751
```bash
12852
./target/release/hashed key insert --scheme sr25519 --keystore-path /tmp/parachain/hashed-local/chains/hashed/keystore --key-type aura --suri ""
12953
```
130-
131-
### Purging the Chains
132-
```bash
133-
# Purge a chain
134-
./target/release/hashed-parachain \
135-
purge-chain \
136-
--base-path /tmp/parachain/alice \
137-
--chain ~/github.com/hashed-io/hashed-parachain/md5-local-parachain-raw.json
138-
139-
# Purge relay chain
140-
./target/release/polkadot purge-chain --base-path /tmp/relay/alice --chain ~/github.com/paritytech/polkadot/rococo-custom-2-raw.json
141-
142-
# Sometimes I use this:
143-
rm -rf /tmp/relay && rm -rf /tmp/parachain
144-
```

resources/hashed-spec.json

Lines changed: 29 additions & 60 deletions
Large diffs are not rendered by default.

scripts/address-checker/index.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ const { encodeAddress } = require("@polkadot/util-crypto");
33
const sudoAddress = "0x5cf8957922e4058a953281f82fdced2e4d389fe37c77f41a0fd2379df0caf877";
44
const coll1Address = "0x1cfc7e49e91696b84bf8e931c16375ea634c3997b36155657faf7dc4716e273e";
55
const coll2Address = "0x84ce3f0bc9ae73d8497c6161927e9e04f39f4bc54579689532d048188c10a77c";
6+
7+
const hashedSudo = "0x021a78fcc3ec988411388ec2f8ab25fbb79a7eaacead997d13f211ebe34ce359";
8+
const hashedColl1 = "0x90150e105b07c3357d43ed5c727efb9be347699cb2b5a41a26423b559615b222";
9+
const hashedColl2 = "0x028c3a5c8890c3e98023b35f99a5d904b170612b78b6b9fdd8f60cbf24ab9f59";
10+
611
const hashedPrefix = '9072';
712
const luhnPrefix = '11486';
8-
const address = coll2Address;
13+
const address = hashedSudo;
914
const maxSS58AddressPrefixesCount = 16383;
1015

1116
function printAddress(label, _address, prefix) {
@@ -31,8 +36,8 @@ function findSS58AddressPrefixes(address) {
3136
for (let prefix = 0; prefix <= maxSS58AddressPrefixesCount; prefix++) {
3237
if (!reservedSS58Formats.includes(prefix)) {
3338
let ss58Address = encodeAddress(address, prefix);
34-
// if (ss58Address.charAt(0) == 'h' && ss58Address.charAt(1) == 'a' && ss58Address.charAt(2) == 'X') {
35-
if (ss58Address.charAt(0) == 'u' && ss58Address.charAt(1) == 'h') {
39+
if (ss58Address.charAt(0) == 'h' && ss58Address.charAt(1) == 'a' ) {
40+
// if (ss58Address.charAt(0) == 'u' && ss58Address.charAt(1) == 'h') {
3641
console.log(`${prefix}`, ss58Address);
3742
foundSS58AddressPrefixes.push(prefix);
3843
}
@@ -46,12 +51,15 @@ let foundSS58AddressPrefixes = findSS58AddressPrefixes(address);
4651
console.log('count: ', foundSS58AddressPrefixes.length);
4752
console.log('foundSS58AddressPrefixes: ', foundSS58AddressPrefixes);
4853

49-
printKnown (sudoAddress);
50-
printKnown (coll1Address);
51-
printKnown (coll2Address);
54+
// printKnown (sudoAddress);
55+
// printKnown (coll1Address);
56+
// printKnown (coll2Address);
5257

5358
printAddress('Luhn Network Sudo :', sudoAddress, luhnPrefix);
5459
printAddress('Luhn Network Collator #1 :', coll1Address, luhnPrefix);
5560
printAddress('Luhn Network Collator #2 :', coll2Address, luhnPrefix);
61+
console.log ();
5662

57-
63+
printAddress('Hashed Network Sudo :', hashedSudo, hashedPrefix);
64+
printAddress('Hashed Network Collator #1 :', hashedColl1, hashedPrefix);
65+
printAddress('Hashed Network Collator #2 :', hashedColl2, hashedPrefix);

0 commit comments

Comments
 (0)