forked from ghostchain/ghost-node
Compare commits
10 Commits
pallet-slo
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fa5e5ed97 | |||
| 58c5f1f33d | |||
| 2cf4637d0c | |||
| 8123295f91 | |||
| 75268b4c0a | |||
| 275567ef79 | |||
| fc2e4e6bff | |||
| fae0fa4d7b | |||
| 71eb90a5fb | |||
| 25fcfed586 |
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -1186,7 +1186,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "casper-runtime"
|
name = "casper-runtime"
|
||||||
version = "3.5.33"
|
version = "3.5.36"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"casper-runtime-constants",
|
"casper-runtime-constants",
|
||||||
"frame-benchmarking",
|
"frame-benchmarking",
|
||||||
@ -3836,7 +3836,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ghost-slow-clap"
|
name = "ghost-slow-clap"
|
||||||
version = "0.3.47"
|
version = "0.3.53"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"frame-benchmarking",
|
"frame-benchmarking",
|
||||||
"frame-support",
|
"frame-support",
|
||||||
|
|||||||
126
README.md
126
README.md
@ -150,28 +150,8 @@ rustup default stable
|
|||||||
rustup update
|
rustup update
|
||||||
```
|
```
|
||||||
|
|
||||||
Add the nightly release and the nightly WebAssembly (wasm) targets
|
|
||||||
to your development environment by running the following commands:
|
|
||||||
```bash
|
```bash
|
||||||
rustup update nightly
|
rustup target add wasm32-unknown-unknown --toolchain stable
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
rustup target add wasm32-unknown-unknown --toolchain nightly
|
|
||||||
```
|
|
||||||
|
|
||||||
```bash
|
|
||||||
rustup target add wasm32-unknown-unknown --toolchain stable-x86_64-unknown-linux-gnu
|
|
||||||
```
|
|
||||||
|
|
||||||
If you are trying to install WebAssembly (wasm) on an ARM-based processor like the ones in Raspberry Pi try this instead:
|
|
||||||
```bash
|
|
||||||
rustup target add wasm32-unknown-unknown --toolchain stable-aarch64-unknown-linux-gnu
|
|
||||||
```
|
|
||||||
|
|
||||||
**_IF error try_**
|
|
||||||
```bash
|
|
||||||
rustup target add wasm32-unknown-unknown --toolchain default
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Verify the configuration of your development environment by running
|
Verify the configuration of your development environment by running
|
||||||
@ -180,10 +160,6 @@ the following command:
|
|||||||
rustup show
|
rustup show
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
|
||||||
rustup +nightly show
|
|
||||||
```
|
|
||||||
|
|
||||||
You should see something like this:
|
You should see something like this:
|
||||||
|
|
||||||

|

|
||||||
@ -194,13 +170,6 @@ Now run:
|
|||||||
rustup component add rust-src --toolchain stable
|
rustup component add rust-src --toolchain stable
|
||||||
```
|
```
|
||||||
|
|
||||||
**_IF error try_**
|
|
||||||
```bash
|
|
||||||
rustup component add rust-src --toolchain default
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Install GHOST
|
## Install GHOST
|
||||||
|
|
||||||
Check if Git is already installed:
|
Check if Git is already installed:
|
||||||
@ -211,7 +180,7 @@ git --version
|
|||||||
|
|
||||||
Make a GHOST Directory and go to it:
|
Make a GHOST Directory and go to it:
|
||||||
```bash
|
```bash
|
||||||
mkdir ghost && cd ghost
|
mkdir ~/ghost && cd ~/ghost
|
||||||
```
|
```
|
||||||
|
|
||||||
Clone GHOST Node Git:
|
Clone GHOST Node Git:
|
||||||
@ -226,7 +195,7 @@ cd ghost-node
|
|||||||
|
|
||||||
Compile the node template by running the following command:
|
Compile the node template by running the following command:
|
||||||
```bash
|
```bash
|
||||||
cargo build --release
|
./scripts/starter.sh --release
|
||||||
```
|
```
|
||||||
|
|
||||||
The build can take up to 20 minutes depending on the specifications of your machine.
|
The build can take up to 20 minutes depending on the specifications of your machine.
|
||||||
@ -234,7 +203,6 @@ The build can take up to 20 minutes depending on the specifications of your mach
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Boot Node Qualification
|
# Boot Node Qualification
|
||||||
|
|
||||||
## Boot Node Qualification Test
|
## Boot Node Qualification Test
|
||||||
@ -320,7 +288,7 @@ Only `port 30333` should be opened.
|
|||||||
|
|
||||||
Press _CTRL+C_ to stop the node.
|
Press _CTRL+C_ to stop the node.
|
||||||
|
|
||||||
# Launching GHOST TestNet 3.1
|
# Launching GHOST TestNet
|
||||||
|
|
||||||
Switch to main GIT branch:
|
Switch to main GIT branch:
|
||||||
```bash
|
```bash
|
||||||
@ -348,66 +316,7 @@ To generate the node key use the following command:
|
|||||||
./target/release/ghost key generate-node-key --bin --file=/etc/ghost/node-key
|
./target/release/ghost key generate-node-key --bin --file=/etc/ghost/node-key
|
||||||
```
|
```
|
||||||
|
|
||||||
Generate Wallet Key file with the following command:
|
Feel free to backup the file on a separate storage device.
|
||||||
```bash
|
|
||||||
./target/release/ghost key generate | grep "Secret seed" | awk '{$1=$2=""; sub(/^[ \t]+/, ""); print}' > /etc/ghost/wallet-key
|
|
||||||
```
|
|
||||||
|
|
||||||
Display the wallet-key on the screen by using cat command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key inspect $(cat /etc/ghost/wallet-key)
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Feel free to back the file on a separate storage device.
|
|
||||||
|
|
||||||
Generate Stash Key file with the following command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key generate | grep "Secret seed" | awk '{$1=$2=""; sub(/^[ \t]+/, ""); print}' > /etc/ghost/stash-key
|
|
||||||
```
|
|
||||||
|
|
||||||
Display the stash-key on the screen by using cat command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key inspect $(cat /etc/ghost/stash-key)
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Generate Session Key file with the following command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key generate | grep "Secret seed" | awk '{$1=$2=""; sub(/^[ \t]+/, ""); print}' > /etc/ghost/session-key
|
|
||||||
```
|
|
||||||
You have generates 4 types of Session Keys:
|
|
||||||
|
|
||||||
1. Session Key – AUDI
|
|
||||||
2. Session Key – BABE
|
|
||||||
3. Session Key – SLOW
|
|
||||||
4. Session Key – GRAN
|
|
||||||
|
|
||||||
Now let's display them!
|
|
||||||
|
|
||||||
Display the session-key//audi on the screen by using cat command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key inspect "$(cat /etc/ghost/session-key)//audi"
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Display the session-key//babe on the screen by using cat command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key inspect "$(cat /etc/ghost/session-key)//babe"
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Display the session-key//slow on the screen by using cat command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key inspect "$(cat /etc/ghost/session-key)//slow"
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
Display the session-key//gran on the screen by using cat command:
|
|
||||||
```bash
|
|
||||||
./target/release/ghost key inspect "$(cat /etc/ghost/session-key)//gran" --scheme=ed25519
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
## Build and start the ghost-node
|
## Build and start the ghost-node
|
||||||
|
|
||||||
@ -437,7 +346,7 @@ sha256sum /etc/ghost/casper.json
|
|||||||
|
|
||||||
You should see:
|
You should see:
|
||||||
```
|
```
|
||||||
ad653233c978bfd00c5e4525b17628632bc4319c5f5f4b4dcc2f050ef3c3d145
|
9da6045ed6d4fd844e3939573b31c013d0e564e542029330faa6d978cb4a915a
|
||||||
```
|
```
|
||||||
|
|
||||||
Create running `ghost-node` service that starts on system boot using `--unit-file` flag.
|
Create running `ghost-node` service that starts on system boot using `--unit-file` flag.
|
||||||
@ -463,10 +372,7 @@ To choose default options press Enter here:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Currently, you have to qualify to become a validator node through [GHOST Whales](https://ghostchain.io/whales-apply).
|
If you want to validate from this node press Enter:
|
||||||
If you were NOT included in the [ghosties file](https://git.ghostchain.io/ghostchain/ghost-node/src/branch/main/service/ghosties) then you cannot be a validator node,
|
|
||||||
and you can only be a full node so for `disable validator mode? [y/N]` type `y`.
|
|
||||||
If you were included in the ghosties file you can press Enter:
|
|
||||||
```
|
```
|
||||||
disable validator mode? [y/N]: y
|
disable validator mode? [y/N]: y
|
||||||
```
|
```
|
||||||
@ -511,17 +417,6 @@ Type `y` and press _Enter_ for create dedicated user for running `ghost-node`:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Now you can check whether or not the keys on your GHOST Node match those
|
|
||||||
in the [ghosties file](https://git.ghostchain.io/ghostchain/ghost-node/src/branch/main/service/ghosties) on GHOST Git.
|
|
||||||
If you are running a **Validator Node** and if you have followed
|
|
||||||
the Generating Keys Part you will see all `[+]`.
|
|
||||||
If you are a running a **Full Node** you will see errors:
|
|
||||||
|
|
||||||
(Press _Enter_ for prompts)
|
|
||||||
```bash
|
|
||||||
./scripts/starter.sh --check-keys
|
|
||||||
```
|
|
||||||
|
|
||||||
Full Node:
|
Full Node:
|
||||||
|
|
||||||

|

|
||||||
@ -535,7 +430,7 @@ Start `ghost-node`:
|
|||||||
sudo systemctl start ghost-node
|
sudo systemctl start ghost-node
|
||||||
```
|
```
|
||||||
|
|
||||||
Wait 60 seconds!
|
Wait ~60 seconds!
|
||||||
|
|
||||||
Check node is started:
|
Check node is started:
|
||||||
```bash
|
```bash
|
||||||
@ -545,11 +440,6 @@ sudo systemctl status ghost-node
|
|||||||
|
|
||||||
For exit press _CTRL+C_
|
For exit press _CTRL+C_
|
||||||
|
|
||||||
In order to insert keys run the following flags `--check-keys` `--insert-keys`:
|
|
||||||
```bash
|
|
||||||
./scripts/starter.sh --check-keys --insert-keys
|
|
||||||
```
|
|
||||||
|
|
||||||
Restart `ghost-node`:
|
Restart `ghost-node`:
|
||||||
```bash
|
```bash
|
||||||
sudo systemctl restart ghost-node
|
sudo systemctl restart ghost-node
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "casper-runtime"
|
name = "casper-runtime"
|
||||||
version = "3.5.33"
|
version = "3.5.36"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
description = "Runtime of the Casper Network"
|
description = "Runtime of the Casper Network"
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|||||||
@ -117,8 +117,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
|||||||
spec_name: create_runtime_str!("casper"),
|
spec_name: create_runtime_str!("casper"),
|
||||||
impl_name: create_runtime_str!("casper-svengali"),
|
impl_name: create_runtime_str!("casper-svengali"),
|
||||||
authoring_version: 0,
|
authoring_version: 0,
|
||||||
spec_version: 3,
|
spec_version: 6,
|
||||||
impl_version: 1,
|
impl_version: 4,
|
||||||
apis: RUNTIME_API_VERSIONS,
|
apis: RUNTIME_API_VERSIONS,
|
||||||
transaction_version: 1,
|
transaction_version: 1,
|
||||||
state_version: 1,
|
state_version: 1,
|
||||||
@ -1059,9 +1059,11 @@ impl ghost_claims::Config<CultCollectiveInstance> for Runtime {
|
|||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
// will be used in `Perbill::from_percent()`
|
// will be used in `Perbill::from_percent()`
|
||||||
pub const ApplauseThreshold: u32 = 70;
|
pub const ApplauseThreshold: u32 = 66;
|
||||||
// will be used in `Perbill::from_percent()`
|
// will be used in `Perbill::from_percent()`
|
||||||
pub const OffenceThreshold: u32 = 40;
|
pub const OffenceThreshold: u32 = 5;
|
||||||
|
// 4 validators should be functional if 1 is offline
|
||||||
|
pub const MinAuthoritiesNumber: u32 = 5;
|
||||||
pub const SlowClapUnsignedPriority: TransactionPriority = TransactionPriority::MAX;
|
pub const SlowClapUnsignedPriority: TransactionPriority = TransactionPriority::MAX;
|
||||||
pub const SlowClapHistoryDepth: sp_staking::SessionIndex =
|
pub const SlowClapHistoryDepth: sp_staking::SessionIndex =
|
||||||
StakingHistoryDepth::get() * SessionsPerEra::get();
|
StakingHistoryDepth::get() * SessionsPerEra::get();
|
||||||
@ -1071,18 +1073,19 @@ impl ghost_slow_clap::Config for Runtime {
|
|||||||
type RuntimeEvent = RuntimeEvent;
|
type RuntimeEvent = RuntimeEvent;
|
||||||
type AuthorityId = SlowClapId;
|
type AuthorityId = SlowClapId;
|
||||||
|
|
||||||
type NextSessionRotation = Babe;
|
|
||||||
type ValidatorSet = Historical;
|
type ValidatorSet = Historical;
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type NetworkDataHandler = GhostNetworks;
|
type NetworkDataHandler = GhostNetworks;
|
||||||
type BlockNumberProvider = System;
|
type BlockNumberProvider = System;
|
||||||
type ReportUnresponsiveness = Offences;
|
type ReportUnresponsiveness = Offences;
|
||||||
|
type DisabledValidators = Session;
|
||||||
|
|
||||||
type MaxAuthorities = MaxAuthorities;
|
type MaxAuthorities = MaxAuthorities;
|
||||||
type ApplauseThreshold = ApplauseThreshold;
|
type ApplauseThreshold = ApplauseThreshold;
|
||||||
type OffenceThreshold = OffenceThreshold;
|
type OffenceThreshold = OffenceThreshold;
|
||||||
type UnsignedPriority = SlowClapUnsignedPriority;
|
type UnsignedPriority = SlowClapUnsignedPriority;
|
||||||
type HistoryDepth = SlowClapHistoryDepth;
|
type HistoryDepth = SlowClapHistoryDepth;
|
||||||
|
type MinAuthoritiesNumber = MinAuthoritiesNumber;
|
||||||
|
|
||||||
type WeightInfo = weights::ghost_slow_clap::WeightInfo<Runtime>;
|
type WeightInfo = weights::ghost_slow_clap::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,20 +81,18 @@ extract_seed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
downgrade_compiler_if_needed() {
|
downgrade_compiler_if_needed() {
|
||||||
# TODO: uncomment later
|
echo "[+] fetching the latest ghost-node source code"
|
||||||
# echo "[+] fetching the latest ghost-node source code"
|
git switch main
|
||||||
# git switch main
|
git pull origin main
|
||||||
# git pull origin main
|
|
||||||
|
|
||||||
# 1.83.0 works fine, tested with:
|
# 1.86.0 works fine, tested with:
|
||||||
# ...
|
|
||||||
# 1.87.0 throws errors during compilation
|
# 1.87.0 throws errors during compilation
|
||||||
# 1.88.0 throws errors during compilation
|
# 1.88.0 throws errors during compilation
|
||||||
LATEST_TESTED_VERSION=83
|
LATEST_TESTED_VERSION=86
|
||||||
cargo_version=$(cargo --version | cut -d'.' -f2)
|
cargo_version=$(cargo --version | cut -d'.' -f2)
|
||||||
if [ "$cargo_version" -gt "$LATEST_TESTED_VERSION" ]; then
|
if [ "$cargo_version" -gt "$LATEST_TESTED_VERSION" ]; then
|
||||||
echo "[+] downgrading rustc compiler version to 1.83.0"
|
echo "[+] downgrading rustc compiler version to 1.86.0"
|
||||||
rustup default 1.83.0
|
rustup default 1.86.0
|
||||||
toolchain_name=$(rustup show | grep default | head -n 1 | cut -d' ' -f1)
|
toolchain_name=$(rustup show | grep default | head -n 1 | cut -d' ' -f1)
|
||||||
rustup target add wasm32-unknown-unknown --toolchain $toolchain_name
|
rustup target add wasm32-unknown-unknown --toolchain $toolchain_name
|
||||||
rustup component add rust-src --toolchain $toolchain_name
|
rustup component add rust-src --toolchain $toolchain_name
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user