DataHighway Node. A blockchain being built with Substrate to become a parachain on the Polkadot network. Planned features include a decentralized LPWAN roaming hub for LoRaWAN IoT devices and network operator roaming agreements, participative mining, an inter-chain data market, and DAO governance. http://www.datahighway.com
Uses Substrate commit 4d28ebeb8b027ca0227fe7779c5beb70a7b56467 for dependencies, since that's what the Substrate Node Template is up to.
Only using one (1) initial authority for all chains in the chain_spec.rs, since when the chain is run without the other initial authorities using Aura, and session keys are inserted, and then validator nodes are all reset so they finalise blocks, then if this script is run then there should not be any delay between some block headers (which is an issue we're always experiencing with Babe, but not experiencing with Aura as long as there are only 1 or 2 initial authorities in the chain_spec.rs), the duration between some block headers should all be consistent with the block time https://github.com/DataHighway-DHX/open-polkadot-js-library/tree/main/block-delay
Steps to setup validator nodes on brickable chain to test block time consistency:
[X] - balances are not appearing, even after i import Sudo account and setBalance of 10 BRI to all five authorities account addresses (both stash and controller accounts), it still only shows that 1 BRI is bonded by authority 1, and even after i add our custom_types.json at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/settings/developer, there are no browser console errors.
note: this also happens in branch 'luke/MMD-1309/update-substrate-3'
it happens even after updating to latest Metadata in the Polkadot.js UI settings
it must be a Polkadot.js API UI version issue.
when i start with --dev and go to Polkadot.js accounts page, it displays error in UI console:
DRR: Unable to decode storage system.account: entry 0:: createType(AccountInfo):: {"nonce":"Index","consumers":"RefCount","providers":"RefCount","data":"AccountData"}:: Decoded input doesn't match input, received 0x010000000000000001000000000000000000e8890423c78a0000000000000000…0000000000000000000000000000000000000000000000000000000000000000 (80 bytes), created 0x010000000000000001000000000000000000e8890423c78a0000000000000000…0000000000000000000000000000000000000000000000000000000000000000
Update: This was fixed after we modified custom_types.json
[X] - possibly an issue with democracy. using democracy to create a preimage (i.e. to increase ideal validator count to 6), and proposal, then seconding it, so it becomes a referendum. but when it's finished processing, the validator count doesn't change.
update: it's necessary for supermajority to have at least 50% of the total supply Aye or Nay (see https://github.com/polkadot-js/apps/blob/master/packages/page-democracy/src/Overview/Referendum.tsx#L66), so first Sudo > balances > setBalance > 29000000 for one of the accounts, then in democracy, create preimage using staking > setValidatorCount to 7, copy the preimage hash, then create proposal and past the preimage hash, then Second the proposal, then when it's a referenda, vote on it using 28000000 from that account, refresh the page to see updated tally of Ayes and Nays.
ISSUE: even though voted with an account having at least 90% of total supply, it isn't storing the BRI tokens associated with the vote, so the referendum isn't passing
Update: This was fixed after we modified custom_types.json
[X] - after finish all necessary changes, generate chain spec and "raw" chain definition based on final changes in this PR for brickable, harbour, and westlake, and regenerated forkless upgrade wasm file and store in ./node/src/chain_built
Summary of changes
Steps to setup validator nodes on brickable chain to test block time consistency:
Remove old temporarily brickable chain data so starts from genesis
Run the five (5) initial authorities in separate terminal tabs on the local machine
Insert session keys for Grandpa and Aura to separate ports running the initial validators
Restart all of the initial validator nodes so the blocks start finalising
Run script https://github.com/DataHighway-DHX/open-polkadot-js-library/tree/main/block-delay to check if the block time for each subscribed block is the same, or if any are delayed. They should all be the same as the block time.
Run tests
Configure runtime for faster debugging to check functionality still works
Since we want to elect the additional validator intentions, we want to the sessions and eras to go by faster, so we can change these runtime values:
For faster democracy proposals and referendums:
After making changes, build
cargo build --release
Add additional nodes as validators
Outstanding issues
[X] - balances are not appearing, even after i import Sudo account and setBalance of 10 BRI to all five authorities account addresses (both stash and controller accounts), it still only shows that 1 BRI is bonded by authority 1, and even after i add our custom_types.json at https://polkadot.js.org/apps/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/settings/developer, there are no browser console errors. note: this also happens in branch 'luke/MMD-1309/update-substrate-3' it happens even after updating to latest Metadata in the Polkadot.js UI settings it must be a Polkadot.js API UI version issue. when i start with
--dev
and go to Polkadot.js accounts page, it displays error in UI console:Update: This was fixed after we modified custom_types.json [X] - possibly an issue with democracy. using democracy to create a preimage (i.e. to increase ideal validator count to 6), and proposal, then seconding it, so it becomes a referendum. but when it's finished processing, the validator count doesn't change.
update: it's necessary for supermajority to have at least 50% of the total supply Aye or Nay (see https://github.com/polkadot-js/apps/blob/master/packages/page-democracy/src/Overview/Referendum.tsx#L66), so first Sudo > balances > setBalance > 29000000 for one of the accounts, then in democracy, create preimage using staking > setValidatorCount to 7, copy the preimage hash, then create proposal and past the preimage hash, then Second the proposal, then when it's a referenda, vote on it using 28000000 from that account, refresh the page to see updated tally of Ayes and Nays. ISSUE: even though voted with an account having at least 90% of total supply, it isn't storing the BRI tokens associated with the vote, so the referendum isn't passing Update: This was fixed after we modified custom_types.json [X] - after finish all necessary changes, generate chain spec and "raw" chain definition based on final changes in this PR for brickable, harbour, and westlake, and regenerated forkless upgrade wasm file and store in ./node/src/chain_built