-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from LimeChain/modules/grandpa
Grandpa commit
- Loading branch information
Showing
27 changed files
with
283 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
npm install -g yarn | ||
sudo npm install -g yarn | ||
yarn install | ||
npm run build | ||
node ./cli/dist/src/index.js spec --to=./chain-spec.json | ||
node ./cli/dist/src/index.js spec --src=./chain-spec.json | ||
npm uninstall -g yarn | ||
sudo npm uninstall -g yarn |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
lsof -n | grep LISTEN > /dev/null | ||
curl --location --request POST '0.0.0.0:9933' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{ | ||
"jsonrpc": "2.0", | ||
"method": "author_insertKey", | ||
"params": ["aura","clip organ olive upper oak void inject side suit toilet stick narrow","0x9effc1668ca381c242885516ec9fa2b19c67b6684c02a8a3237b6862e5c8cd7e"], | ||
"id": 1 | ||
}' | ||
lsof -n | grep LISTEN > /dev/null | ||
curl --location --request POST '0.0.0.0:9933' \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw '{ | ||
"jsonrpc": "2.0", | ||
"method": "author_insertKey", | ||
"params": ["gran","clip organ olive upper oak void inject side suit toilet stick narrow","0xb48004c6e1625282313b07d1c9950935e86894a2e4f21fb1ffee9854d180c781"], | ||
"id": 1 | ||
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ByteArray } from "as-scale-codec"; | ||
import { Storage, Utils } from "subsembly-core"; | ||
|
||
/** | ||
* @descritption Storage entries for Grandpa | ||
*/ | ||
export namespace GrandpaStorageEntries { | ||
} | ||
|
||
/** | ||
* @description Class representing GRANDPA module | ||
*/ | ||
export class Grandpa { | ||
public static readonly GRANDPA_AUTHORITIES: string = ":grandpa_authorities"; | ||
|
||
/** | ||
* @description Get GRANDPA authorities from the storage | ||
* concatenated list of Grandpa authorities | ||
*/ | ||
static _authorities(): u8[] { | ||
const entry = Storage.get(Utils.stringsToBytes([this.GRANDPA_AUTHORITIES], false)); | ||
const auths = entry.isSome() ? (<ByteArray>entry.unwrap()).unwrap() : [0]; | ||
// first byte is option byte | ||
return auths; | ||
} | ||
|
||
/** | ||
* @description Set GRANDPA authorities | ||
* @param auths list of Grandpa authorities | ||
*/ | ||
static _setAuthorities(auths: u8[]): void { | ||
Storage.set(Utils.stringsToBytes([this.GRANDPA_AUTHORITIES], false), auths); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export * from "./aura/aura"; | ||
export * from "./balances/balances"; | ||
export * from "./grandpa/grandpa"; | ||
export * from "./timestamp/timestamp"; | ||
export * from "./transaction-payment/transaction-payment"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.