This is a guide to test claims on a local testnet for wallet integrations.
Clone the chainspec generator and follow the instructions in the README. You only need to run up to ./scripts/polkadot-genesis.sh
, and you will get the chainspec that was used for Polkadot genesis.
This will output a polkadot.json
file; rename it to something like modified-polkadot.json
.
You will have to modify and compile a Polkadot client.
- Clone the Polkadot repo.
- Check out the version that corresponds to the current runtime. E.g., if Polkadot is on v14, check out
v0.8.14
. - Go to the
/service/src/chain_spec.rs
file. You need to setendowed_accounts
, otherwise generating the code will panic. Inv0.8.14
, this is line 118. Set this to:
let endowed_accounts = vec![
hex!["e5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a"].into(),
];
- Compile (
cargo build --release
) and go get a coffee or a beer. - Once that is done, run
./target/release/polkadot build-spec --chain polkadot-staging > staging.json
.
Go into staging.json
and find the long hex blob under the "code"
key. This is the most up-to-date runtime. Copy this into the modified-polkadot.json
file.
Now that you have the correct runtime code, you can add some custom accounts to your modified-polkadot.json
file. Scroll to the end of the file and you will see a lot of claims in the spec, just add your own that you want to test. Claims take the form of:
[
ethereum address,
number of tokens,
polkadot address (may be `null`),
sale agreement ("Regular" or "Saft"),
]
A Polkadot address of null
means that the person did not pre-claim and needs to submit a claims.claimAttest
transaction, which will require a signature from the Ethereum key. A non-null
Polkadot address means that the person did pre-claim and will need to submit a claims.attest
transaction.
Examples:
A non-pre-claimed address with 23 DOTs.
[
"0xBa3fb82687f28ce414dCb4803D05EacAcb697DB4",
23000000000000,
null,
"Regular"
],
A pre-claimed address with 82 DOTs.
[
"0x4bD120e887Cc82285AFF8408DC208eD32B132Bb3",
82000000000000,
"12uMj2RetfZtkoezt4pJwS79rfbJcxmGHMXT5mw7QnxreAqV",
"Regular"
],
Start your chain with ./target/release/polkadot --chain modified-polkadot.json --validator --alice
. You can now access this via Polkadot JS Apps or any other way you'd interact with the chain.