mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-25 11:59:56 +00:00
Final tweaks for PoC-2 runtime upgrade (#348)
* Final tweaks for PoC-2 runtime upgrade * Address grumble * Avoid slow wasm * New poc-2-era bootnodes * Fix warning * Typo * Fix for allocation in wasm * Fix & runtimes. * PoC-1 should be default. * Name testnet Krumme Lanke, update README * YML update * Use the right port
This commit is contained in:
1 parent
428682d3b5
commit
07fbd871d9
22 files changed
+76
-51
No files matched your search
+17
-17
@@ -12,15 +12,26 @@ curl https://sh.rustup.rs -sSf | sh
|
|||||||
sudo apt install make clang
|
sudo apt install make clang
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, install Polkadot PoC-1:
|
Then, install Polkadot PoC-2:
|
||||||
|
|
||||||
```
|
```
|
||||||
cargo install --git https://github.com/paritytech/polkadot.git --branch v0.1
|
cargo install --git https://github.com/paritytech/polkadot.git --branch v0.2
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll now have a `polkadot` binary installed to your `PATH`. You can drop the
|
You'll now have a `polkadot` binary installed to your `PATH`. You can drop the
|
||||||
`--branch v0.1` or run `cargo install --git https://github.com/paritytech/polkadot.git polkadot`
|
`--branch v0.2` or run `cargo install --git https://github.com/paritytech/polkadot.git polkadot`
|
||||||
to get the very latest version of Polkadot, but these instructions will not work in that case.
|
to get the very latest version of Polkadot, but these instructions might not work in that case.
|
||||||
|
|
||||||
|
### Krumme Lanke Testnet
|
||||||
|
|
||||||
|
You will connect to the global Krumme Lanke testnet by default. To do this, just use:
|
||||||
|
|
||||||
|
```
|
||||||
|
polkadot
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to do anything on it (not that there's much to do), then you'll need
|
||||||
|
to get some Krumme Lanke DOTs. Ask in the Polkadot watercooler.
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|
||||||
@@ -28,22 +39,11 @@ You can run a simple single-node development "network" on your machine by
|
|||||||
running in a terminal:
|
running in a terminal:
|
||||||
|
|
||||||
```
|
```
|
||||||
polkadot --chain=dev --validator --key Alice
|
polkadot --dev
|
||||||
```
|
```
|
||||||
|
|
||||||
You can muck around by cloning and building the http://github.com/paritytech/polka-ui and http://github.com/paritytech/polkadot-ui or just heading to https://polkadot.js.org/apps.
|
You can muck around by cloning and building the http://github.com/paritytech/polka-ui and http://github.com/paritytech/polkadot-ui or just heading to https://polkadot.js.org/apps.
|
||||||
|
|
||||||
### PoC-1 Testnet
|
|
||||||
|
|
||||||
You can also connect to the global PoC-1 testnet. To do this, just use:
|
|
||||||
|
|
||||||
```
|
|
||||||
polkadot --chain=poc-1
|
|
||||||
```
|
|
||||||
|
|
||||||
If you want to do anything on it (not that there's much to do), then you'll need
|
|
||||||
to get some PoC-1 testnet DOTs. Ask in the Polkadot watercooler.
|
|
||||||
|
|
||||||
## Local Two-node Testnet
|
## Local Two-node Testnet
|
||||||
|
|
||||||
If you want to see the multi-node consensus algorithm in action locally, then
|
If you want to see the multi-node consensus algorithm in action locally, then
|
||||||
@@ -99,5 +99,5 @@ cargo test --all
|
|||||||
You can start a development chain with:
|
You can start a development chain with:
|
||||||
|
|
||||||
```
|
```
|
||||||
cargo run -- --chain=dev --validator --key Alice
|
cargo run -- --dev
|
||||||
```
|
```
|
||||||
Generated
+1
@@ -847,6 +847,7 @@ name = "substrate-runtime-primitives"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
||||||
|
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
BIN
Binary file not shown.
Binary file not shown.
@@ -27,8 +27,8 @@ pub enum ChainSpec {
|
|||||||
Development,
|
Development,
|
||||||
/// Whatever the current runtime is, with simple Alice/Bob auths.
|
/// Whatever the current runtime is, with simple Alice/Bob auths.
|
||||||
LocalTestnet,
|
LocalTestnet,
|
||||||
/// The PoC-1 testnet.
|
/// The PoC-1 & PoC-2 era testnet.
|
||||||
PoC1Testnet,
|
KrummeLanke,
|
||||||
/// Whatever the current runtime is with the "global testnet" defaults.
|
/// Whatever the current runtime is with the "global testnet" defaults.
|
||||||
StagingTestnet,
|
StagingTestnet,
|
||||||
/// Custom Genesis file.
|
/// Custom Genesis file.
|
||||||
@@ -39,7 +39,7 @@ pub enum ChainSpec {
|
|||||||
impl ChainSpec {
|
impl ChainSpec {
|
||||||
pub(crate) fn load(self) -> Result<service::ChainSpec, String> {
|
pub(crate) fn load(self) -> Result<service::ChainSpec, String> {
|
||||||
Ok(match self {
|
Ok(match self {
|
||||||
ChainSpec::PoC1Testnet => service::chain_spec::poc_1_testnet_config()?,
|
ChainSpec::KrummeLanke => service::chain_spec::poc_1_testnet_config()?,
|
||||||
ChainSpec::Development => service::chain_spec::development_config(),
|
ChainSpec::Development => service::chain_spec::development_config(),
|
||||||
ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(),
|
ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(),
|
||||||
ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(),
|
ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(),
|
||||||
@@ -53,7 +53,8 @@ impl<'a> From<&'a str> for ChainSpec {
|
|||||||
match s {
|
match s {
|
||||||
"dev" => ChainSpec::Development,
|
"dev" => ChainSpec::Development,
|
||||||
"local" => ChainSpec::LocalTestnet,
|
"local" => ChainSpec::LocalTestnet,
|
||||||
"poc-1" => ChainSpec::PoC1Testnet,
|
"poc-1" => ChainSpec::KrummeLanke,
|
||||||
|
"krummelanke" => ChainSpec::KrummeLanke,
|
||||||
"staging" => ChainSpec::StagingTestnet,
|
"staging" => ChainSpec::StagingTestnet,
|
||||||
s => ChainSpec::Custom(s.into()),
|
s => ChainSpec::Custom(s.into()),
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,7 @@ impl From<ChainSpec> for String {
|
|||||||
match s {
|
match s {
|
||||||
ChainSpec::Development => "dev".into(),
|
ChainSpec::Development => "dev".into(),
|
||||||
ChainSpec::LocalTestnet => "local".into(),
|
ChainSpec::LocalTestnet => "local".into(),
|
||||||
ChainSpec::PoC1Testnet => "poc-1".into(),
|
ChainSpec::KrummeLanke => "krummelanke".into(),
|
||||||
ChainSpec::StagingTestnet => "staging".into(),
|
ChainSpec::StagingTestnet => "staging".into(),
|
||||||
ChainSpec::Custom(f) => format!("custom ({})", f),
|
ChainSpec::Custom(f) => format!("custom ({})", f),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ args:
|
|||||||
- chain:
|
- chain:
|
||||||
long: chain
|
long: chain
|
||||||
value_name: CHAIN_SPEC
|
value_name: CHAIN_SPEC
|
||||||
help: Specify the chain specification (one of poc-1, dev, local or staging)
|
help: Specify the chain specification (one of krummelanke, dev, local or staging)
|
||||||
takes_value: true
|
takes_value: true
|
||||||
- pruning:
|
- pruning:
|
||||||
long: pruning
|
long: pruning
|
||||||
@@ -118,7 +118,7 @@ subcommands:
|
|||||||
- chain:
|
- chain:
|
||||||
long: chain
|
long: chain
|
||||||
value_name: CHAIN_SPEC
|
value_name: CHAIN_SPEC
|
||||||
help: Specify the chain specification (one of poc-1, dev, local or staging)
|
help: Specify the chain specification (one of krummelanke, dev, local or staging)
|
||||||
takes_value: true
|
takes_value: true
|
||||||
- export-blocks:
|
- export-blocks:
|
||||||
about: Export blocks to a file
|
about: Export blocks to a file
|
||||||
|
|||||||
@@ -111,9 +111,9 @@ impl substrate_rpc::system::SystemApi for SystemConfiguration {
|
|||||||
fn load_spec(matches: &clap::ArgMatches) -> Result<(service::ChainSpec, bool), String> {
|
fn load_spec(matches: &clap::ArgMatches) -> Result<(service::ChainSpec, bool), String> {
|
||||||
let chain_spec = matches.value_of("chain")
|
let chain_spec = matches.value_of("chain")
|
||||||
.map(ChainSpec::from)
|
.map(ChainSpec::from)
|
||||||
.unwrap_or_else(|| if matches.is_present("dev") { ChainSpec::Development } else { ChainSpec::StagingTestnet });
|
.unwrap_or_else(|| if matches.is_present("dev") { ChainSpec::Development } else { ChainSpec::KrummeLanke });
|
||||||
let is_global = match chain_spec {
|
let is_global = match chain_spec {
|
||||||
ChainSpec::PoC1Testnet | ChainSpec::StagingTestnet => true,
|
ChainSpec::KrummeLanke | ChainSpec::StagingTestnet => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
let spec = chain_spec.load()?;
|
let spec = chain_spec.load()?;
|
||||||
|
|||||||
+1
@@ -847,6 +847,7 @@ name = "substrate-runtime-primitives"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
||||||
|
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+9
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "PoC-1 Testnet",
|
"name": "Krumme Lanke",
|
||||||
"id": "poc-1-testnet",
|
"id": "krummelanke",
|
||||||
"genesis": {"raw": {
|
"genesis": {"raw": {
|
||||||
"0x9768f3cbdd14c1a63474dfbdbe052f42": "0x80f4030000000000",
|
"0x9768f3cbdd14c1a63474dfbdbe052f42": "0x80f4030000000000",
|
||||||
"0x3b700687fecdff5ec1c4a5b714521eb6": "0x0000000000000000",
|
"0x3b700687fecdff5ec1c4a5b714521eb6": "0x0000000000000000",
|
||||||
@@ -40,5 +40,11 @@
|
|||||||
"0x3a636f6465": "0x0061736d010000000197011760027f7f0060057f7f7f7f7f017f60017f017f60037f7f7f017f60017f0060000060037f7f7f0060047f7f7f7f006000017e60027f7f017f60027f7e0060037e7f7f0060017f017e600a7f7f7f7f7f7f7f7f7f7f0060017e0060067f7f7f7f7f7f0060047f7f7f7f017f60047f7f7f7f017e60067f7f7f7f7f7f017f60057f7f7f7f7f0060027f7f017e60027f7e017f60037f7f7e0002f1031603656e76146578745f6765745f73746f726167655f696e746f000103656e760a6578745f6d616c6c6f63000203656e76086578745f66726565000403656e760c6578745f74776f785f313238000603656e760f6578745f7365745f73746f72616765000703656e76116578745f636c6561725f73746f72616765000003656e760a6578745f6d656d636d70000303656e76186578745f656e756d6572617465645f747269655f726f6f74000703656e760e6578745f7072696e745f75746638000003656e760d6578745f7072696e745f6e756d000e03656e760a6578745f6d656d637079000303656e760b6578745f6d656d6d6f7665000303656e760a6578745f6d656d736574000303656e76166578745f73616e64626f785f6d656d6f72795f6e6577000903656e76176578745f73616e64626f785f696e7374616e7469617465001203656e76126578745f73616e64626f785f696e766f6b65001003656e76166578745f73616e64626f785f6d656d6f72795f676574001003656e76166578745f73616e64626f785f6d656d6f72795f736574001003656e760e6578745f626c616b65325f323536000603656e760d6578745f7072696e745f686578000003656e76106578745f73746f726167655f726f6f74000403656e76126578745f656432353531395f766572696679001003d001ce010003040505050500030000020404050400060000060505000804040900000505040004030004060a040b0005000c0c00040405060404060d0504050002040400050505050505050505050505050505050505040504050405050405040505040504050405040504050405040506060000060007070f070f0710070707071107130906000409060000040500140014061404140a06041414140002060a15000000000400000004040000040c000405070a1400000000000413060706160704140616060000060000000000000000090405017001161605030100110609017f0141d0c3c0000b07a8010b066d656d6f7279020011727573745f626567696e5f756e77696e64004d066d616c6c6f630052046672656500530b617574686f72697469657300a10110696e697469616c6973655f626c6f636b00a3010f6170706c795f65787472696e73696300a5010d657865637574655f626c6f636b00a7010e66696e616c6973655f626c6f636b00ab010f76616c696461746f725f636f756e7400ac010a76616c696461746f727300ad010930010041010b158f019001910192019301cc01cd01ce01c601cf01d001d101c701d30195019b01d4019401d501d6019c010abbe40cce01ea0403067f017e057f230041106b220224002002410036020020012001280208220341002001280200220420012802042205200241042003100022032003417f461b2203410420034104491b6a22063602080240024002400240200341034d0d0020022802002207ad420c7e2208422088a70d022008a72203417f4c0d01024002402003450d002003100122090d010c050b410421090b20022007360204200220093602002002410036020802402007450d00200141086a210a4100210b4100210c03402002410036020c200a4100200420052002410c6a41042006100022012001417f461b2201410420014104491b20066a2206360200024002400240200141034d0d00200228020c2201417f4c0d01024002402001450d00200110012203450d0a20034100200110171a0c010b410121030b200a20014100200420052003200120061000220d200d417f461b220d200d20014b1b20066a220636020002402001200d4b0d002003450d01200c41016a210c2001ad22084220862008842108200b2002280204470d0320021018200241086a280200210b200228020021090c030b200310020b200228020021060240200b450d00200b410c6c21032006210103400240200141046a280200450d00200128020010020b2001410c6a2101200341746a22030d000b0b2002280204450d04200610020c040b1019000b2009200b410c6c6a2201200837020420012003360200200241086a200b41016a220b360200200c2007490d000b200228020021090b2009450d002000200229020437020420002009360200200241106a24000f0b20004100360200200241106a24000f0b101a000b101b000b101c000b0a00200020012002100c0b810101057f410421010240024002400240200041046a2802002202450d00200241186c2201417f4c0d0320002802002103200110012204450d022004200320012002410c6c2205200520014b1b101e1a20031002200241017421010c010b413010012204450d010b20002004360200200041046a20013602000f0b101c000b1073000b05001041000b05001041000b05001041000b0500104e000bc11105097f037e017f017e027f230041a0026b220224002001280200210320024180026a20012802042204412020044120491b22056a41004100412020056b2005411f4b1b10171a20024180026a20032005101e1a2001200420056b22063602042001200320056a22053602000240024002400240024002400240024002402004411f4d0d00200241e0016a41186a220420024180026a41186a2203290300370300200241e0016a41106a220720024180026a41106a2208290300370300200241e0016a41086a220920024180026a41086a220a29030037030020022002290380023703e00120032004290300220b37030020082007290300220c370300200a2009290300220d370300200241c0006a41086a2204200d370300200241c0006a41106a2203200c370300200241c0006a41186a2207200b370300200220022903e001220b3703402002200b37038002200241206a41186a2007290300370300200241206a41106a2003290300370300200241206a41086a200429030037030020022002290340370320200242003703800220024180026a20052006410820064108491b2204101e1a200141046a2207200620046b22033602002001200520046a2204360200200641074d0d01200229038002210c20024180026a2003412020034120491b22056a41004100412020056b2005411f4b1b10171a20024180026a20042005101e1a2007200320056b22063602002001200420056a22043602002003411f4d0d02200241e0016a41186a220320024180026a41186a2207290300370300200241eLine truncated
|
"0x3a636f6465": "0x0061736d010000000197011760027f7f0060057f7f7f7f7f017f60017f017f60037f7f7f017f60017f0060000060037f7f7f0060047f7f7f7f006000017e60027f7f017f60027f7e0060037e7f7f0060017f017e600a7f7f7f7f7f7f7f7f7f7f0060017e0060067f7f7f7f7f7f0060047f7f7f7f017f60047f7f7f7f017e60067f7f7f7f7f7f017f60057f7f7f7f7f0060027f7f017e60027f7e017f60037f7f7e0002f1031603656e76146578745f6765745f73746f726167655f696e746f000103656e760a6578745f6d616c6c6f63000203656e76086578745f66726565000403656e760c6578745f74776f785f313238000603656e760f6578745f7365745f73746f72616765000703656e76116578745f636c6561725f73746f72616765000003656e760a6578745f6d656d636d70000303656e76186578745f656e756d6572617465645f747269655f726f6f74000703656e760e6578745f7072696e745f75746638000003656e760d6578745f7072696e745f6e756d000e03656e760a6578745f6d656d637079000303656e760b6578745f6d656d6d6f7665000303656e760a6578745f6d656d736574000303656e76166578745f73616e64626f785f6d656d6f72795f6e6577000903656e76176578745f73616e64626f785f696e7374616e7469617465001203656e76126578745f73616e64626f785f696e766f6b65001003656e76166578745f73616e64626f785f6d656d6f72795f676574001003656e76166578745f73616e64626f785f6d656d6f72795f736574001003656e760e6578745f626c616b65325f323536000603656e760d6578745f7072696e745f686578000003656e76106578745f73746f726167655f726f6f74000403656e76126578745f656432353531395f766572696679001003d001ce010003040505050500030000020404050400060000060505000804040900000505040004030004060a040b0005000c0c00040405060404060d0504050002040400050505050505050505050505050505050505040504050405050405040505040504050405040504050405040506060000060007070f070f0710070707071107130906000409060000040500140014061404140a06041414140002060a15000000000400000004040000040c000405070a1400000000000413060706160704140616060000060000000000000000090405017001161605030100110609017f0141d0c3c0000b07a8010b066d656d6f7279020011727573745f626567696e5f756e77696e64004d066d616c6c6f630052046672656500530b617574686f72697469657300a10110696e697469616c6973655f626c6f636b00a3010f6170706c795f65787472696e73696300a5010d657865637574655f626c6f636b00a7010e66696e616c6973655f626c6f636b00ab010f76616c696461746f725f636f756e7400ac010a76616c696461746f727300ad010930010041010b158f019001910192019301cc01cd01ce01c601cf01d001d101c701d30195019b01d4019401d501d6019c010abbe40cce01ea0403067f017e057f230041106b220224002002410036020020012001280208220341002001280200220420012802042205200241042003100022032003417f461b2203410420034104491b6a22063602080240024002400240200341034d0d0020022802002207ad420c7e2208422088a70d022008a72203417f4c0d01024002402003450d002003100122090d010c050b410421090b20022007360204200220093602002002410036020802402007450d00200141086a210a4100210b4100210c03402002410036020c200a4100200420052002410c6a41042006100022012001417f461b2201410420014104491b20066a2206360200024002400240200141034d0d00200228020c2201417f4c0d01024002402001450d00200110012203450d0a20034100200110171a0c010b410121030b200a20014100200420052003200120061000220d200d417f461b220d200d20014b1b20066a220636020002402001200d4b0d002003450d01200c41016a210c2001ad22084220862008842108200b2002280204470d0320021018200241086a280200210b200228020021090c030b200310020b200228020021060240200b450d00200b410c6c21032006210103400240200141046a280200450d00200128020010020b2001410c6a2101200341746a22030d000b0b2002280204450d04200610020c040b1019000b2009200b410c6c6a2201200837020420012003360200200241086a200b41016a220b360200200c2007490d000b200228020021090b2009450d002000200229020437020420002009360200200241106a24000f0b20004100360200200241106a24000f0b101a000b101b000b101c000b0a00200020012002100c0b810101057f410421010240024002400240200041046a2802002202450d00200241186c2201417f4c0d0320002802002103200110012204450d022004200320012002410c6c2205200520014b1b101e1a20031002200241017421010c010b413010012204450d010b20002004360200200041046a20013602000f0b101c000b1073000b05001041000b05001041000b05001041000b0500104e000bc11105097f037e017f017e027f230041a0026b220224002001280200210320024180026a20012802042204412020044120491b22056a41004100412020056b2005411f4b1b10171a20024180026a20032005101e1a2001200420056b22063602042001200320056a22053602000240024002400240024002400240024002402004411f4d0d00200241e0016a41186a220420024180026a41186a2203290300370300200241e0016a41106a220720024180026a41106a2208290300370300200241e0016a41086a220920024180026a41086a220a29030037030020022002290380023703e00120032004290300220b37030020082007290300220c370300200a2009290300220d370300200241c0006a41086a2204200d370300200241c0006a41106a2203200c370300200241c0006a41186a2207200b370300200220022903e001220b3703402002200b37038002200241206a41186a2007290300370300200241206a41106a2003290300370300200241206a41086a200429030037030020022002290340370320200242003703800220024180026a20052006410820064108491b2204101e1a200141046a2207200620046b22033602002001200520046a2204360200200641074d0d01200229038002210c20024180026a2003412020034120491b22056a41004100412020056b2005411f4b1b10171a20024180026a20042005101e1a2007200320056b22063602002001200420056a22043602002003411f4d0d02200241e0016a41186a220320024180026a41186a2207290300370300200241eLine truncated
|
||||||
"0x0346fb0f1ce64e1a02c4959d38ebad38": "0x00000000"
|
"0x0346fb0f1ce64e1a02c4959d38ebad38": "0x00000000"
|
||||||
}},
|
}},
|
||||||
"bootNodes": []
|
"bootNodes": [
|
||||||
|
"/ip4/104.211.54.233/tcp/30333/p2p/QmRMGcQh69t8a8YwzHkofVo9SFr7ffggUwhAYjVSTChmrd",
|
||||||
|
"/ip4/104.211.48.51/tcp/30333/p2p/QmWCnXrhM1in1qPqVT3rDXQEJHedAzbPDMimdjqy2P9fGn",
|
||||||
|
"/ip4/104.211.48.247/tcp/30333/p2p/QmYPx99i3H8EKXrvYHTBwqz3jjFC1kBfkvmSKd2h9zwQFr",
|
||||||
|
"/ip4/40.114.120.164/tcp/30333/p2p/QmWzYU5X1NpFrprD1YZF5Lcj9aE5WF4QEg5FpvQx5XGWG7",
|
||||||
|
"/ip4/40.117.153.33/tcp/30333/p2p/QmSz8qCADMmi92QB8dTqMPu56JYQQKZBAHz7y8KXjvqcvW"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ use polkadot_runtime::{GenesisConfig, ConsensusConfig, CouncilConfig, DemocracyC
|
|||||||
use service::ChainSpec;
|
use service::ChainSpec;
|
||||||
|
|
||||||
pub fn poc_1_testnet_config() -> Result<ChainSpec<GenesisConfig>, String> {
|
pub fn poc_1_testnet_config() -> Result<ChainSpec<GenesisConfig>, String> {
|
||||||
ChainSpec::from_embedded(include_bytes!("../res/poc-1.json"))
|
ChainSpec::from_embedded(include_bytes!("../res/krummelanke.json"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn staging_testnet_config_genesis() -> GenesisConfig {
|
fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ use std::cmp::Ordering;
|
|||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use wasmi::{
|
use wasmi::{
|
||||||
Module, ModuleInstance, MemoryInstance, MemoryRef, TableRef, ImportsBuilder,
|
Module, ModuleInstance, MemoryInstance, MemoryRef, TableRef, ImportsBuilder, self
|
||||||
};
|
};
|
||||||
use wasmi::RuntimeValue::{I32, I64};
|
use wasmi::RuntimeValue::{I32, I64};
|
||||||
use wasmi::memory_units::{Pages, Bytes};
|
use wasmi::memory_units::{Pages, Bytes};
|
||||||
@@ -28,7 +28,7 @@ use state_machine::{Externalities, CodeExecutor};
|
|||||||
use error::{Error, ErrorKind, Result};
|
use error::{Error, ErrorKind, Result};
|
||||||
use wasm_utils::UserError;
|
use wasm_utils::UserError;
|
||||||
use primitives::{blake2_256, twox_128, twox_256};
|
use primitives::{blake2_256, twox_128, twox_256};
|
||||||
use primitives::hexdisplay::{HexDisplay, ascii_format};
|
use primitives::hexdisplay::HexDisplay;
|
||||||
use primitives::sandbox as sandbox_primitives;
|
use primitives::sandbox as sandbox_primitives;
|
||||||
use triehash::ordered_trie_root;
|
use triehash::ordered_trie_root;
|
||||||
use sandbox;
|
use sandbox;
|
||||||
@@ -200,9 +200,9 @@ impl_function_executor!(this: FunctionExecutor<'e, E>,
|
|||||||
let key = this.memory.get(key_data, key_len as usize).map_err(|_| UserError("Invalid attempt to determine key in ext_set_storage"))?;
|
let key = this.memory.get(key_data, key_len as usize).map_err(|_| UserError("Invalid attempt to determine key in ext_set_storage"))?;
|
||||||
let value = this.memory.get(value_data, value_len as usize).map_err(|_| UserError("Invalid attempt to determine value in ext_set_storage"))?;
|
let value = this.memory.get(value_data, value_len as usize).map_err(|_| UserError("Invalid attempt to determine value in ext_set_storage"))?;
|
||||||
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
||||||
debug_trace!(target: "wasm-trace", "*** Setting storage: %{} -> {} [k={}]", ascii_format(&_preimage), HexDisplay::from(&value), HexDisplay::from(&key));
|
debug_trace!(target: "wasm-trace", "*** Setting storage: %{} -> {} [k={}]", ::primitives::hexdisplay::ascii_format(&_preimage), HexDisplay::from(&value), HexDisplay::from(&key));
|
||||||
} else {
|
} else {
|
||||||
debug_trace!(target: "wasm-trace", "*** Setting storage: {} -> {} [k={}]", ascii_format(&key), HexDisplay::from(&value), HexDisplay::from(&key));
|
debug_trace!(target: "wasm-trace", "*** Setting storage: {} -> {} [k={}]", ::primitives::hexdisplay::ascii_format(&key), HexDisplay::from(&value), HexDisplay::from(&key));
|
||||||
}
|
}
|
||||||
this.ext.set_storage(key, value);
|
this.ext.set_storage(key, value);
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -211,9 +211,9 @@ impl_function_executor!(this: FunctionExecutor<'e, E>,
|
|||||||
let key = this.memory.get(key_data, key_len as usize).map_err(|_| UserError("Invalid attempt to determine key in ext_clear_storage"))?;
|
let key = this.memory.get(key_data, key_len as usize).map_err(|_| UserError("Invalid attempt to determine key in ext_clear_storage"))?;
|
||||||
debug_trace!(target: "wasm-trace", "*** Clearing storage: {} [k={}]",
|
debug_trace!(target: "wasm-trace", "*** Clearing storage: {} [k={}]",
|
||||||
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
||||||
format!("%{}", ascii_format(&_preimage))
|
format!("%{}", ::primitives::hexdisplay::ascii_format(&_preimage))
|
||||||
} else {
|
} else {
|
||||||
format!(" {}", ascii_format(&key))
|
format!(" {}", ::primitives::hexdisplay::ascii_format(&key))
|
||||||
}, HexDisplay::from(&key));
|
}, HexDisplay::from(&key));
|
||||||
this.ext.clear_storage(&key);
|
this.ext.clear_storage(&key);
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -234,9 +234,9 @@ impl_function_executor!(this: FunctionExecutor<'e, E>,
|
|||||||
|
|
||||||
debug_trace!(target: "wasm-trace", "*** Getting storage: {} == {} [k={}]",
|
debug_trace!(target: "wasm-trace", "*** Getting storage: {} == {} [k={}]",
|
||||||
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
||||||
format!("%{}", ascii_format(&_preimage))
|
format!("%{}", ::primitives::hexdisplay::ascii_format(&_preimage))
|
||||||
} else {
|
} else {
|
||||||
format!(" {}", ascii_format(&key))
|
format!(" {}", ::primitives::hexdisplay::ascii_format(&key))
|
||||||
},
|
},
|
||||||
if let Some(ref b) = maybe_value {
|
if let Some(ref b) = maybe_value {
|
||||||
format!("{}", HexDisplay::from(b))
|
format!("{}", HexDisplay::from(b))
|
||||||
@@ -264,9 +264,9 @@ impl_function_executor!(this: FunctionExecutor<'e, E>,
|
|||||||
let maybe_value = this.ext.storage(&key);
|
let maybe_value = this.ext.storage(&key);
|
||||||
debug_trace!(target: "wasm-trace", "*** Getting storage: {} == {} [k={}]",
|
debug_trace!(target: "wasm-trace", "*** Getting storage: {} == {} [k={}]",
|
||||||
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
if let Some(_preimage) = this.hash_lookup.get(&key) {
|
||||||
format!("%{}", ascii_format(&_preimage))
|
format!("%{}", ::primitives::hexdisplay::ascii_format(&_preimage))
|
||||||
} else {
|
} else {
|
||||||
format!(" {}", ascii_format(&key))
|
format!(" {}", ::primitives::hexdisplay::ascii_format(&key))
|
||||||
},
|
},
|
||||||
if let Some(ref b) = maybe_value {
|
if let Some(ref b) = maybe_value {
|
||||||
format!("{}", HexDisplay::from(b))
|
format!("{}", HexDisplay::from(b))
|
||||||
@@ -557,7 +557,7 @@ impl WasmExecutor {
|
|||||||
|
|
||||||
let size = data.len() as u32;
|
let size = data.len() as u32;
|
||||||
let offset = fec.heap.allocate(size);
|
let offset = fec.heap.allocate(size);
|
||||||
memory.set(offset, &data).expect("heap always gives a sensible offset to write");
|
memory.set(offset, &data).map_err(|_: wasmi::Error| Error::from(ErrorKind::PleaseRetry))?;
|
||||||
|
|
||||||
let result = instance.invoke_export(
|
let result = instance.invoke_export(
|
||||||
method,
|
method,
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -68,11 +68,11 @@ pub fn clear_storage(key: &[u8]) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear the storage of some particular key.
|
/// Check whether a given `key` exists in storage.
|
||||||
pub fn exists_storage(key: &[u8]) {
|
pub fn exists_storage(key: &[u8]) -> bool {
|
||||||
ext::with(|ext|
|
ext::with(|ext|
|
||||||
ext.exists_storage(key)
|
ext.exists_storage(key)
|
||||||
);
|
).unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear the storage entries key of which starts with the given prefix.
|
/// Clear the storage entries key of which starts with the given prefix.
|
||||||
|
|||||||
@@ -101,12 +101,12 @@ pub fn clear_storage(key: &[u8]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear the storage of some particular key.
|
/// Determine whether a particular key exists in storage.
|
||||||
pub fn exists_storage(key: &[u8]) {
|
pub fn exists_storage(key: &[u8]) -> bool {
|
||||||
unsafe {
|
unsafe {
|
||||||
ext_exists_storage(
|
ext_exists_storage(
|
||||||
key.as_ptr(), key.len() as u32
|
key.as_ptr(), key.len() as u32
|
||||||
) != 0;
|
) != 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,22 @@ impl<'a> Input for IncrementalInput<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: only introduce this wrapper for types where it makes sense, ideally have it within the module declaration.
|
||||||
|
|
||||||
|
struct AppendZeroes<'a, I: Input + 'a> {
|
||||||
|
input: &'a mut I,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a, I: Input + 'a> Input for AppendZeroes<'a, I> {
|
||||||
|
fn read(&mut self, into: &mut [u8]) -> usize {
|
||||||
|
let r = self.input.read(into);
|
||||||
|
for z in &mut into[r..] {
|
||||||
|
*z = 0;
|
||||||
|
};
|
||||||
|
into.len()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Return the value of the item in storage under `key`, or `None` if there is no explicit entry.
|
/// Return the value of the item in storage under `key`, or `None` if there is no explicit entry.
|
||||||
pub fn get<T: Codec + Sized>(key: &[u8]) -> Option<T> {
|
pub fn get<T: Codec + Sized>(key: &[u8]) -> Option<T> {
|
||||||
let key = twox_128(key);
|
let key = twox_128(key);
|
||||||
@@ -47,7 +63,7 @@ pub fn get<T: Codec + Sized>(key: &[u8]) -> Option<T> {
|
|||||||
key: &key[..],
|
key: &key[..],
|
||||||
pos: 0,
|
pos: 0,
|
||||||
};
|
};
|
||||||
Decode::decode(&mut input).expect("storage is not null, therefore must be a valid type")
|
Decode::decode(&mut AppendZeroes { input: &mut input } ).expect("storage is not null, therefore must be a valid type")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,8 +119,7 @@ pub fn take_or_else<T: Codec + Sized, F: FnOnce() -> T>(key: &[u8], default_valu
|
|||||||
|
|
||||||
/// Check to see if `key` has an explicit entry in storage.
|
/// Check to see if `key` has an explicit entry in storage.
|
||||||
pub fn exists(key: &[u8]) -> bool {
|
pub fn exists(key: &[u8]) -> bool {
|
||||||
let mut x = [0u8; 0];
|
runtime_io::exists_storage(&twox_128(key)[..])
|
||||||
runtime_io::read_storage(&twox_128(key)[..], &mut x[..], 0).is_some()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Ensure `key` has no explicit entry in storage.
|
/// Ensure `key` has no explicit entry in storage.
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ impl<G: Serialize + DeserializeOwned + BuildStorage> Configuration<G> {
|
|||||||
pruning: PruningMode::ArchiveAll,
|
pruning: PruningMode::ArchiveAll,
|
||||||
execution_strategy: ExecutionStrategy::Both,
|
execution_strategy: ExecutionStrategy::Both,
|
||||||
min_heap_pages: 8,
|
min_heap_pages: 8,
|
||||||
max_heap_pages: 512,
|
max_heap_pages: 1024,
|
||||||
};
|
};
|
||||||
configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec();
|
configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec();
|
||||||
configuration
|
configuration
|
||||||
|
|||||||
@@ -700,6 +700,7 @@ name = "substrate-runtime-primitives"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
"integer-sqrt 0.1.0 (git+https://github.com/paritytech/integer-sqrt-rs.git)",
|
||||||
|
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_derive 1.0.64 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
Reference in new issue
Block a user