Commit b145f36f authored by Hugo Trentesaux's avatar Hugo Trentesaux Committed by Hugo Trentesaux
Browse files

gtest genesis parsing (!176)

* fix clippy

* fix after rebase

* WIP example specs

* fix after rebase

* add reproducibility

* doc add missing protobuf compiler

* remove ref to genesis timestamp

* fix broken next identity index genesis

* our pallets are not coming from the framework

* fix first_ud everywhere

* remove files unwanted on main branch

* also apply renaming to gdev

* rename first_ud_value and add comments

(to put in value the absence of first_ud_time)

* use index provided in GenesisIdty

* add mold to documentation

* change gtest existential deposit

and adapt genesis parsing to real-world data

* embed raw chainspecs only when enabled

* add comments
parent 4234da98
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1661,6 +1661,7 @@ dependencies = [
 "log",
 "maplit",
 "memmap2",
 "num-format",
 "pallet-certification",
 "pallet-grandpa",
 "pallet-oneshot-account",
@@ -9914,7 +9915,7 @@ version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
 "cfg-if 1.0.0",
 "cfg-if 0.1.10",
 "digest 0.10.6",
 "rand 0.8.5",
 "static_assertions",
+3 −1
Original line number Diff line number Diff line
@@ -19,9 +19,10 @@ path = "node/src/main.rs"

[features]
default = ["gdev"]
gdev = ["gdev-runtime"] # gdev feature enables gdev runtime and gdev command line options
g1 = ["g1-runtime"]
gdev = ["gdev-runtime"]
gtest = ["gtest-runtime"]
embed = [] # embed feature enables embedding raw chainspecs that must be in ./specs/gdev-raw.json
runtime-benchmarks = [
    #'g1-runtime',
    #'g1-runtime/runtime-benchmarks',
@@ -86,6 +87,7 @@ memmap2 = "0.5.0"
serde = "1.0"
serde_json = "1.0.64"
tracing-core = "0.1.28"
num-format = "0.4.4"

# substrate dependencies
frame-benchmarking = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.32" }
+14 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ Use a terminal shell to execute the following commands:
```bash
sudo apt update
# May prompt for location information
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl protobuf-compiler
```

### Arch Linux
@@ -79,3 +79,16 @@ rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
```


### Installing mold linker to decrease build time

Mold (modern linker) (https://github.com/rui314/mold) decreases the build time. Install it through your system package for example then add the following to your `~/.cargo/config`:

```toml
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]
```

(see https://forum.duniter.org/t/decrease-duniter-build-time/10170 on the forum)
 No newline at end of file
+30 −8
Original line number Diff line number Diff line
@@ -12,17 +12,26 @@
  "identities": {
    "Alice": {
      "balance": 1000,
      "certs": ["Bob", "Charlie"],
      "certs": [
        "Bob",
        "Charlie"
      ],
      "pubkey": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
    },
    "Bob": {
      "balance": 1000,
      "certs": ["Alice", "Charlie"],
      "certs": [
        "Alice",
        "Charlie"
      ],
      "pubkey": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
    },
    "Charlie": {
      "balance": 1000,
      "certs": ["Alice", "Bob"],
      "certs": [
        "Alice",
        "Bob"
      ],
      "pubkey": "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y"
    }
  },
@@ -52,16 +61,29 @@
  },
  "smiths": {
    "Alice": {
      "certs": ["Bob", "Charlie"]
      "certs": [
        "Bob",
        "Charlie"
      ]
    },
    "Bob": {
      "certs": ["Alice", "Charlie"]
      "certs": [
        "Alice",
        "Charlie"
      ]
    },
    "Charlie": {
      "certs": ["Alice", "Bob"]
      "certs": [
        "Alice",
        "Bob"
      ]
    }
  },
  "sudo_key": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
  "technical_committee": ["Alice", "Bob", "Charlie"],
  "technical_committee": [
    "Alice",
    "Bob",
    "Charlie"
  ],
  "ud": 1000
}
 No newline at end of file
+34 −9
Original line number Diff line number Diff line
@@ -10,22 +10,34 @@
  "identities": {
    "Alice": {
      "balance": 1000,
      "certs": ["Bob", "Charlie"],
      "certs": [
        "Bob",
        "Charlie"
      ],
      "pubkey": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
    },
    "Bob": {
      "balance": 1000,
      "certs": ["Alice", "Charlie"],
      "certs": [
        "Alice",
        "Charlie"
      ],
      "pubkey": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
    },
    "Charlie": {
      "balance": 1000,
      "certs": ["Alice", "Bob"],
      "certs": [
        "Alice",
        "Bob"
      ],
      "pubkey": "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y"
    },
    "Dave": {
      "balance": 1000,
      "certs": ["Alice", "Bob"],
      "certs": [
        "Alice",
        "Bob"
      ],
      "pubkey": "5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy"
    }
  },
@@ -55,16 +67,29 @@
  },
  "smiths": {
    "Alice": {
      "certs": ["Bob", "Charlie"]
      "certs": [
        "Bob",
        "Charlie"
      ]
    },
    "Bob": {
      "certs": ["Alice", "Charlie"]
      "certs": [
        "Alice",
        "Charlie"
      ]
    },
    "Charlie": {
      "certs": ["Alice", "Bob"]
      "certs": [
        "Alice",
        "Bob"
      ]
    }
  },
  "sudo_key": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
  "technical_committee": ["Alice", "Bob", "Charlie"],
  "technical_committee": [
    "Alice",
    "Bob",
    "Charlie"
  ],
  "ud": 1000
}
 No newline at end of file
Loading