Skip to content

Commit

Permalink
Mainnet release v1.11.0 (#98)
Browse files Browse the repository at this point in the history
* Add sudo for Devnet

* Dependency update to Polkadot v0.9.42

* Dependency update to Polkadot v0.9.43

* Dependency update to Polkadot v1.1.0

* Integrating metadata hash verification into runtime

* Dependency update to Polkadot v1.3.0

* Lift dependencies to the workspace

* Dependency update to Polkadot v1.5.0

* Add genesis builder

* Dependency update to Polkadot v1.9.0

* Setup chain id for evm

* Updated Devnet to Polkadot 1.9.0

* Fix chain id in chainspec

* Bump spec version

* Adjust base fee

* Adjust base fee

* Update ChainId

* Remove native executor

* Remove commented out code

* Update chain id

* Async backing phase 1 - runtime updates

* Plug new lookahead collator node

* Revert milisec per block

* Compiling

* rm .vscode

* Remove unused

* Remove comments and log file

* Add sudo pallet

* Feature/polkadot v1.11.0 (#92)

* Update chain id

* Compiling

* rm .vscode

* Remove unused

* Remove comments and log file

* Add sudo pallet

---------

Co-authored-by: Nikola Todorovic <[email protected]>

* Move polkadot-service to mooneam implementation (#94)

* Updates

* version bump

* version bump

* version for devnet

* update lock

* Update chainId for testnet

* Remove sudo for testnet

* Update chainId for mainnet

---------

Co-authored-by: Nikola Todorovic <[email protected]>
  • Loading branch information
Mihajlo-Pavlovic and NZT48 authored Sep 6, 2024
1 parent 3e39add commit 1a7499d
Show file tree
Hide file tree
Showing 33 changed files with 15,624 additions and 10,383 deletions.
23,567 changes: 14,330 additions & 9,237 deletions Cargo.lock

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions Cargo.toml

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
<div align="center">
<img src="https://140069760-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqMnH71Mmd7Au6HK5UAji%2Fuploads%2FEmgmn8pgCqu9eJaQPNSO%2FNeuroWeb%20X%20visual%20(1).jpg?alt=media&token=320f5009-0932-4ecc-a5a6-3bbb7a56cf45">


[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Substrate version](https://img.shields.io/badge/Substrate-3.0.0-brightgreen?logo=Parity%20Substrate)](https://substrate.io)
[![Twitter URL](https://img.shields.io/twitter/follow/NeuroWebAI?style=social)](https://twitter.com/NeuroWebAI)
[![Telegram](https://img.shields.io/endpoint?color=neon&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Forigintrail)](https://t.me/origintrail)
[![Medium](https://badgen.net/badge/icon/medium?icon=medium&label)](https://medium.com/origintrail)
[![Discord](https://img.shields.io/badge/Discord-gray?logo=discord)](https://discord.gg/FCgYk2S)

</div>

NeuroWeb Network is a decentralized Artificial Intelligence blockchain designed to incentivise knowledge creation, connectivity and sharing through **Knowledge Mining**. It's utility token NEURO is designed to fuel the AI knowledge economy, rewarding relevant knowledge contributions to the **OriginTrail Decentralized Knowledge Graph**.
Expand Down Expand Up @@ -48,7 +47,7 @@ To run a full network with multiple NeuroWeb nodes (collators and non-collators)
#### Run A Relay Chain

To start a relay chain we recommend reading and following instructions in [Cumulus Workshop](https://docs.substrate.io/tutorials/build-a-parachain/prepare-a-local-relay-chain/).
NeuroWeb is currently compatible with Polkadot v0.9.40 version.
NeuroWeb is currently compatible with Polkadot v1.11.0 version.

#### Parachain Nodes (Collators)

Expand Down Expand Up @@ -98,10 +97,13 @@ Ensure you set the `ParaId to 2000` and the `parachain: Bool to Yes`.
### Containerize

#### Build

```shell
docker build -t origintrail-parachain .
```

#### Run

```shell
docker run -it -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -v /data:/data origintrail-parachain:latest\
--base-path=/data --rpc-external --ws-external\
Expand Down
130 changes: 67 additions & 63 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "neuroweb-node"
version = "1.3.0"
version = "1.5.0"
authors = ["TraceLabs"]
description = "NeuroWeb - Cumulus FRAME-based Substrate Node"
license = "GPL-3.0-only"
Expand All @@ -14,87 +14,91 @@ name = "neuroweb"
path = "src/main.rs"

[dependencies]
clap = { version = "4.1.8", features = ["derive"] }
futures = "0.3"
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.152", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
clap = { workspace = true }
futures = { workspace = true }
log = { workspace = true }
codec = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true, features = ["arbitrary_precision"] }
jsonrpsee = { workspace = true }

# Local
neuroweb-runtime = { path = "../runtime" }
neuroweb-runtime = { workspace = true }

# Substrate
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
pallet-transaction-payment-rpc = { workspace = true }
sc-basic-authorship = { workspace = true }
sc-chain-spec = { workspace = true }
sc-cli = { workspace = true }
sc-client-api = { workspace = true }
sc-consensus = { workspace = true }
sc-consensus-aura = { workspace = true }
sc-executor = { workspace = true }
sc-keystore = { workspace = true }
sc-network = { workspace = true }
sc-network-sync = { workspace = true }
sc-rpc = { workspace = true }
sc-rpc-api = { workspace = true }
sc-service = { workspace = true }
sc-sysinfo = { workspace = true }
sc-telemetry = { workspace = true }
sc-tracing = { workspace = true }
sc-transaction-pool = { workspace = true }
sc-transaction-pool-api = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
sp-consensus = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-inherents = { workspace = true }
sp-keystore = { workspace = true }
sp-offchain = { workspace = true }
sp-runtime = { workspace = true }
sp-timestamp = { workspace = true }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }

# Polkadot
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.40" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.40" }
polkadot-cli = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-service = { workspace = true }
xcm = { workspace = true }

# Cumulus
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.40" }
cumulus-client-cli = { workspace = true }
cumulus-client-consensus-aura = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-consensus-proposer = { workspace = true }
cumulus-client-collator = { workspace = true }
cumulus-client-service = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-parachain-inherent = { workspace = true }
cumulus-relay-chain-interface = { workspace = true }
cumulus-test-relay-sproof-builder = { workspace = true }

# Frontier
fp-evm = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fp-rpc = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fc-db = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fc-rpc = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fc-rpc-core = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fc-storage = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fc-mapping-sync = { git = "https://github.com/OriginTrail/frontier", branch = "polkadot-v0.9.40" }
fp-evm = { workspace = true }
fp-rpc = { workspace = true }
fc-api = { workspace = true }
fc-db = { workspace = true }
fc-rpc = { workspace = true }
fc-rpc-core = { workspace = true }
fc-storage = { workspace = true }
fc-mapping-sync = { workspace = true }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.40" }
substrate-build-script-utils = { workspace = true }

[features]
default = ["fc-rpc/rpc-binary-search-estimate"]
runtime-benchmarks = [
"try-runtime-cli/try-runtime",
"neuroweb-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
]
try-runtime = [
"try-runtime-cli/try-runtime",
"neuroweb-runtime/try-runtime",
]
116 changes: 48 additions & 68 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cumulus_primitives_core::ParaId;
use neuroweb_runtime::{AccountId, AuraId,
EVMConfig, EthereumConfig, Signature, EXISTENTIAL_DEPOSIT};
EVMConfig, Signature, EXISTENTIAL_DEPOSIT};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
Expand All @@ -10,7 +10,7 @@ use std::{collections::BTreeMap, str::FromStr};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<neuroweb_runtime::GenesisConfig, Extensions>;
sc_service::GenericChainSpec<neuroweb_runtime::RuntimeGenesisConfig, Extensions>;

/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
Expand Down Expand Up @@ -65,19 +65,22 @@ pub fn template_session_keys(keys: AuraId) -> neuroweb_runtime::SessionKeys {

pub fn development_config() -> ChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "OTP".into());
properties.insert("tokenSymbol".into(), "NEURO".into());
properties.insert("tokenDecimals".into(), 12.into());
properties.insert("ss58Format".into(), 101.into());

ChainSpec::from_genesis(
// Name
"Development",
// ID
"dev",
ChainType::Development,
move || {
testnet_genesis(
// initial collators.
ChainSpec::builder(
neuroweb_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!"),
Extensions {
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
para_id: 2043,
},
)
.with_name("Development")
.with_id("dev")
.with_chain_type(ChainType::Development)
.with_properties(properties)
.with_genesis_config(testnet_genesis(
vec![
(
get_account_id_from_seed::<sr25519::Public>("Alice"),
Expand All @@ -103,36 +106,29 @@ pub fn development_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
2000.into(),
)
},
Vec::new(),
None,
None,
None,
None,
Extensions {
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
para_id: 2000,
},
)
2043.into(),
))
.build()
}

pub fn local_testnet_config() -> ChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "OTP".into());
properties.insert("tokenSymbol".into(), "NEURO".into());
properties.insert("tokenDecimals".into(), 12.into());
properties.insert("ss58Format".into(), 101.into());

ChainSpec::from_genesis(
// Name
"OriginTrail Parachain Testnet",
// ID
"origintrail_parachain_testnet",
ChainType::Local,
move || {
testnet_genesis(
// initial collators.
ChainSpec::builder(
neuroweb_runtime::WASM_BINARY.expect("WASM binary was not build, please build it!"),
Extensions {
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
para_id: 2043,
},
)
.with_name("NeuroWeb Testnet")
.with_id("neuroweb_testnet")
.with_chain_type(ChainType::Local)
.with_properties(properties)
.with_genesis_config(testnet_genesis(
vec![
(
get_account_id_from_seed::<sr25519::Public>("Alice"),
Expand All @@ -158,43 +154,26 @@ pub fn local_testnet_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
2000.into(),
)
},
// Bootnodes
Vec::new(),
// Telemetry
None,
// Protocol ID
Some("origintrail-parachain"),
// Fork ID
None,
// Properties
Some(properties),
// Extensions
Extensions {
relay_chain: "rococo-local".into(), // You MUST set this to the correct network!
para_id: 2000,
},
)
2043.into(),
))
.build()
}

fn testnet_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
_root_key: AccountId,
endowed_accounts: Vec<AccountId>,
id: ParaId,
) -> neuroweb_runtime::GenesisConfig {
neuroweb_runtime::GenesisConfig {
system: neuroweb_runtime::SystemConfig {
code: neuroweb_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
.to_vec(),
},
) -> serde_json::Value {
let config = neuroweb_runtime::RuntimeGenesisConfig {
system: Default::default(),
balances: neuroweb_runtime::BalancesConfig {
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
},
parachain_info: neuroweb_runtime::ParachainInfoConfig { parachain_id: id },
parachain_info: neuroweb_runtime::ParachainInfoConfig {
parachain_id: id,
..Default::default()
},
collator_selection: neuroweb_runtime::CollatorSelectionConfig {
invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: EXISTENTIAL_DEPOSIT * 16,
Expand All @@ -219,11 +198,8 @@ fn testnet_genesis(
parachain_system: Default::default(),
polkadot_xcm: neuroweb_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
// sudo: SudoConfig {
// // Assign network admin rights.
// key: Some(root_key),
// },
vesting: Default::default(),
treasury: Default::default(),
evm: EVMConfig {
Expand Down Expand Up @@ -259,10 +235,14 @@ fn testnet_genesis(
);
map
},
..Default::default()
},
ethereum: EthereumConfig {},
ethereum: Default::default(),
base_fee: Default::default(),
council: Default::default(),
democracy: Default::default(),
}
transaction_payment: Default::default(),
};

serde_json::to_value(&config).expect("Could not build genesis config.")
}
Loading

0 comments on commit 1a7499d

Please sign in to comment.