Skip to content

Commit

Permalink
Merge pull request #671 from Setheum-Labs/bootnodes
Browse files Browse the repository at this point in the history
Bootnodes
  • Loading branch information
balqaasem authored Dec 15, 2021
2 parents dde444f + 03d32d8 commit 27e89cf
Show file tree
Hide file tree
Showing 50 changed files with 46,893 additions and 145 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
jobs:
release:
runs-on: ubuntu-latest
needs: clean-up-actions
steps:
- uses: actions/checkout@v2
- name: Init
Expand All @@ -19,7 +18,7 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
target/release/setheum
target/release/setheum-node
LICENSE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches: [ master ]
pull_request:
branches: "**"
branches:
- '**'

env:
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ RUN make release

FROM debian:buster

COPY --from=build /build/target/release/setheum /usr/local/bin
COPY --from=build /build/target/release/setheum-node /usr/local/bin
ENTRYPOINT ["setheum-node"]
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.PHONY: configure-rust
configure-rust:
sudo apt install make clang pkg-config libssl-dev build-essential curl
curl https://sh.rustup.rs -sSf | sh
rustup install
rustup default
rustup toolchain install nightly-2021-05-09
Expand All @@ -8,7 +10,7 @@ configure-rust:

.PHONY: toolchain
toolchain:
./scripts/init.sh
configure-rust

.PHONY: init
init: toolchain submodule build
Expand All @@ -34,10 +36,10 @@ wasm:
.PHONY: genesis
genesis:
make release
./target/release/setheum build-spec --chain testnet-new > resources/chain_spec_testnet.json
./target/release/setheum build-spec --chain mainnet-new > resources/chain_spec_mainnet.json
./target/release/setheum build-spec --chain testnet-new --raw > resources/chain_spec_testnet_raw.json
./target/release/setheum build-spec --chain mainnet-new --raw > resources/chain_spec_mainnet_raw.json
./target/release/setheum-node build-spec --chain testnet-new > resources/chain_spec_testnet.json
./target/release/setheum-node build-spec --chain mainnet-new > resources/chain_spec_mainnet.json
./target/release/setheum-node build-spec --chain testnet-new --raw > resources/chain_spec_testnet_raw.json
./target/release/setheum-node build-spec --chain mainnet-new --raw > resources/chain_spec_mainnet_raw.json

.PHONY: check
check:
Expand Down Expand Up @@ -91,7 +93,7 @@ fork:
ifeq (,$(wildcard fork/data))
mkdir fork/data
endif
cp target/release/setheum fork/data/binary
cp target/release/setheum-node fork/data/binary
cp target/release/wbuild/setheum-runtime/setheum_runtime.compact.wasm fork/data/runtime.wasm
cp resources/types.json fork/data/schema.json
cp resources/chain_spec_$(chain)_raw.json fork/data/genesis.json
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ make build
This command will start the single-node development chain with persistent state:

```bash
./target/release/setheum --dev
./target/release/setheum-node --dev
```

Purge the development chain's state:

```bash
./target/release/setheum purge-chain --dev
./target/release/setheum-node purge-chain --dev
```

Start the development chain with detailed logging:

```bash
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/setheum -lruntime=debug --dev
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/setheum-node -lruntime=debug --dev
```

### Run tests
Expand All @@ -162,11 +162,11 @@ cargo test -p module-poc --all-features

Run the module benchmarks and generate the weights file:
```
./target/release/setheum benchmark \
./target/release/setheum-node benchmark \
--chain=dev \
--steps=50 \
--repeat=20 \
--pallet=module_airdrop \
--pallet=module_currencies \
--extrinsic='*' \
--execution=wasm \
--wasm-execution=compiled \
Expand All @@ -185,7 +185,7 @@ make debug
Once the project has been built, the following command can be used to explore all parameters and subcommands:

```bash
./target/release/setheum -h
./target/release/setheum-node -h
```

### Release builds
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/auction-manager/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/cdp-engine/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/cdp-treasury/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/currencies/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/dex/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/emergency-shutdown/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/evm-accounts/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/evm/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/nft/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/prices/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/serp-setmint/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/transaction-pause/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
2 changes: 1 addition & 1 deletion lib-serml/transaction-payment/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128

// Executed Command:
// target/release/setheum
// target/release/setheum-node
// benchmark
// --chain=dev
// --steps=50
Expand Down
30 changes: 5 additions & 25 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ pub fn public_testnet_config() -> Result<ChainSpec, String> {
),
// Bootnodes - TODO: Update!
vec![
// "/dns/bootnode-t1.setheumscan.com/tcp/30334/p2p/12D3KooWKmFtS7BFtkkKWrP5ZcCpPFokmST2JFXFSsVBNeW5SXWg".parse().unwrap()
// "/dns/bootnode-newrome.setheum.xyz/tcp/30334/p2p/12D3KooWKmFtS7BFtkkKWrP5ZcCpPFokmST2JFXFSsVBNeW5SXWg".parse().unwrap()
],
// Telemetry
TelemetryEndpoints::new(vec![(TELEMETRY_URL.into(), 0)]).ok(),
Expand Down Expand Up @@ -397,9 +397,9 @@ pub fn mainnet_config() -> Result<ChainSpec, String> {
),
// Bootnodes - TODO: Update!
vec![
// "/dns/bootnode.setheumscan.com/tcp/30333/p2p/12D3KooWFHSc9cUcyNtavUkLg4VBAeBnYNgy713BnovUa9WNY5pp".parse().unwrap(),
// "/dns/bootnode.setheum.xyz/tcp/30333/p2p/12D3KooWAQqcXvcvt4eVEgogpDLAdGWgR5bY1drew44We6FfJAYq".parse().unwrap(),
// "/dns/bootnode.setheum-chain.com/tcp/30333/p2p/12D3KooWCT7rnUmEK7anTp7svwr4GTs6k3XXnSjmgTcNvdzWzgWU".parse().unwrap(),
// "/dns/bootnode1.setheum.xyz/tcp/30333/p2p/12D3KooWFHSc9cUcyNtavUkLg4VBAeBnYNgy713BnovUa9WNY5pp".parse().unwrap(),
// "/dns/bootnode2.setheum.xyz/tcp/30333/p2p/12D3KooWAQqcXvcvt4eVEgogpDLAdGWgR5bY1drew44We6FfJAYq".parse().unwrap(),
// "/dns/bootnode3.setheum.xyz/tcp/30333/p2p/12D3KooWCT7rnUmEK7anTp7svwr4GTs6k3XXnSjmgTcNvdzWzgWU".parse().unwrap(),
],
// Telemetry
TelemetryEndpoints::new(vec![(TELEMETRY_URL.into(), 0)]).ok(),
Expand Down Expand Up @@ -573,27 +573,7 @@ fn dev_genesis(
initial_enabled_trading_pairs: EnabledTradingPairs::get(),
initial_added_liquidity_pools: vec![],
},
orml_nft: OrmlNFTConfig { tokens: vec![] },
// air_drop: AirDropConfig {
// airdrop_accounts: {
// let setter_airdrop_accounts_json = &include_bytes!("../../resources/testnet-airdrop-SETR.json")[..];
// let setter_airdrop_accounts: Vec<(AccountId, Balance)> =
// serde_json::from_slice(setter_airdrop_accounts_json).unwrap();
// let setdollar_airdrop_accounts_json = &include_bytes!("../../resources/testnet-airdrop-SETUSD.json")[..];
// let setdollar_airdrop_accounts: Vec<(AccountId, Balance)> =
// serde_json::from_slice(setdollar_airdrop_accounts_json).unwrap();

// setter_airdrop_accounts
// .iter()
// .map(|(account_id, setter_amount)| (account_id.clone(), AirDropCurrencyId::SETR, *setter_amount))
// .chain(
// setdollar_airdrop_accounts
// .iter()
// .map(|(account_id, setdollar_amount)| (account_id.clone(), AirDropCurrencyId::SETUSD, *setdollar_amount)),
// )
// .collect::<Vec<_>>()
// },
// },
orml_nft: OrmlNFTConfig { tokens: vec![] }
}
}

Expand Down
14 changes: 13 additions & 1 deletion primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub mod currency;
pub mod evm;
pub mod signature;

use codec::{Decode, Encode, MaxEncodedLen};
use codec::{Codec, Decode, Encode, MaxEncodedLen};
use core::ops::Range;
use sp_runtime::{
generic,
Expand Down Expand Up @@ -235,3 +235,15 @@ pub enum ReserveIdentifier {
// always the last, indicate number of variants
Count,
}

// Temporary to bypass `not building wasm` error;
sp_api::decl_runtime_apis! {
pub trait OracleApi<ProviderId, Key, Value> where
ProviderId: Codec,
Key: Codec,
Value: Codec,
{
fn get_value(provider_id: ProviderId, key: Key) -> Option<Value>;
fn get_all_values(provider_id: ProviderId) -> Vec<(Key, Option<Value>)>;
}
}
23,155 changes: 23,155 additions & 0 deletions resources/chain_spec_mainnet.json

Large diffs are not rendered by default.

257 changes: 257 additions & 0 deletions resources/chain_spec_mainnet_raw.json

Large diffs are not rendered by default.

23,147 changes: 23,147 additions & 0 deletions resources/chain_spec_testnet.json

Large diffs are not rendered by default.

255 changes: 255 additions & 0 deletions resources/chain_spec_testnet_raw.json

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions resources/mainnet-airdrop-SETR.json

This file was deleted.

3 changes: 0 additions & 3 deletions resources/mainnet-airdrop-SETUSD.json

This file was deleted.

26 changes: 0 additions & 26 deletions resources/testnet-airdrop-SETR.json

This file was deleted.

26 changes: 0 additions & 26 deletions resources/testnet-airdrop-SETUSD.json

This file was deleted.

4 changes: 2 additions & 2 deletions runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_perthousand(25);
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be
/// used by Operational extrinsics.
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 0.8 second of compute with a 2 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = 800 * WEIGHT_PER_MILLIS;
/// We allow for 2 second of compute with a 6 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = 2000 * WEIGHT_PER_MILLIS;

const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());

Expand Down
Loading

0 comments on commit 27e89cf

Please sign in to comment.