diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..9cc98f3f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +node/res/sherpax-raw.json filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md index 4b32d753..93323304 100644 --- a/README.md +++ b/README.md @@ -93,3 +93,9 @@ Refer [Interacting with Moonbeam Using Remix](https://docs.moonbeam.network/gett ## 4. Assets Bridge Refer [AssetsBridge](./xpallets/assets-bridge/README.md) + +## 5. SherpaX Mainnet +[shrepax mainnet chainspec(272MB)](./node/res/sherpax-raw.json) +```bash +./target/release/sherpax --chain=./node/res/sherpax-raw.json --tmp +``` diff --git a/node/res/genesis_config/gateway/btc_genesis_params_testnet.json b/node/res/genesis_config/gateway/btc_genesis_params_testnet.json index a5dc1f31..51a32376 100644 --- a/node/res/genesis_config/gateway/btc_genesis_params_testnet.json +++ b/node/res/genesis_config/gateway/btc_genesis_params_testnet.json @@ -1,12 +1,12 @@ { "network": "Testnet", "confirmation_number": 6, - "height": 70280, - "hash": "0000012b70681d72680375ef72f96c7d9932e9b11d4f4f93a0d6973154e0fbe0", + "height": 72586, + "hash": "000000c99d101b765528ec78a76fe69ea2ed5436eef58c3cb1ffe44c5bd5793a", "version": 536870912, - "previous_header_hash": "0000006d433f26883aeefa86364ee85ade714685c617fe37d10d11696e322568", - "merkle_root_hash": "f6cb58d2b9358a2c62d336cbbfd8e0873e53ca1d1b6fe7bf7df4df3b47eda859", - "time": 1640573457, - "bits": 503404228, - "nonce": 11603258 + "previous_header_hash": "00000103baf0e88ee974a735fa942be0984b7776e445e2d147a37dd8de81e3ff", + "merkle_root_hash": "9ac6a2f0b393d437459f0ea87521d0503836b65a5b44a2f6d42a2514159c7ea2", + "time": 1641953597, + "bits": 503409496, + "nonce": 2235043 } diff --git a/node/res/sherpax-raw.json b/node/res/sherpax-raw.json new file mode 100644 index 00000000..9b037b99 --- /dev/null +++ b/node/res/sherpax-raw.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f5cfe6a8b34cd4f6d546cbe741bda86612c069acd72f25e3bb53d882fdfe7a0 +size 285042865 diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 3817c73d..ae40619c 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -5,6 +5,7 @@ use crate::bitcoin::{ use frame_benchmarking::frame_support::PalletId; use hex_literal::hex; use sc_chain_spec::ChainSpecExtension; +use sc_service::config::TelemetryEndpoints; use sc_service::{ChainType, Properties}; use serde::de::DeserializeOwned; use serde::{Deserialize, Serialize}; @@ -19,11 +20,21 @@ use sp_core::crypto::UncheckedInto; use sp_core::{sr25519, Pair, Public}; use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_runtime::traits::{AccountIdConversion, IdentifyAccount, Verify}; -use std::collections::BTreeMap; +use std::{collections::BTreeMap, convert::TryInto}; -// The URL for the telemetry server. -// const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; +// Note this is the URL for the telemetry server +const POLKADOT_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; +const CHAINX_TELEMETRY_URL: &str = "wss://telemetry.chainx.org/submit/"; +const DEFAULT_PROTOCOL_ID: &str = "sherpax"; + +macro_rules! bootnodes { + ( $( $bootnode:expr, )* ) => { + vec![ + $($bootnode.to_string().try_into().expect("The bootnode is invalid"),)* + ] + } +} /// Node `ChainSpec` extensions. /// /// Additional parameters for some Substrate core modules, @@ -309,7 +320,13 @@ pub fn local_testnet_config() -> Result { } #[allow(unused)] -pub fn testnet_config() -> Result { +pub fn mainnet_config() -> Result { + let bootnodes = bootnodes![ + "/ip4/52.77.243.26/tcp/10025/ws/p2p/12D3KooWK6zL4BFCFgcfCLn8xMmZcAp1wX6nTGfJx3gRzbq6qE3Y", + "/ip4/47.114.74.52/tcp/40041/ws/p2p/12D3KooWJws7aM9euRhEM2CAvNTvKboiVi9wFRdHeWjtLUEiAJWo", + "/ip4/116.62.46.8/tcp/40042/ws/p2p/12D3KooWSAeap3NaSihLuz85tX8uKn8f8Wfgo8iY9WFM1MRAvQiX", + ]; + let mut properties = Properties::new(); properties.insert("tokenSymbol".into(), "KSX".into()); properties.insert("tokenDecimals".into(), 18i32.into()); @@ -320,9 +337,9 @@ pub fn testnet_config() -> Result { Ok(ChainSpec::from_genesis( // Name - "SherpaX Testnet", + "SherpaX", // ID - "sherpax_testnet", + "sherpax_singleton", ChainType::Live, move || { sherpax_genesis( @@ -363,11 +380,17 @@ pub fn testnet_config() -> Result { ) }, // Bootnodes - vec![], + bootnodes, // Telemetry - None, + Some( + TelemetryEndpoints::new(vec![ + (CHAINX_TELEMETRY_URL.to_string(), 0), + (POLKADOT_TELEMETRY_URL.to_string(), 0), + ]) + .expect("SherpaX telemetry url is valid; qed"), + ), // Protocol ID - None, + Some(DEFAULT_PROTOCOL_ID), // Properties Some(properties), // Extensions @@ -549,8 +572,8 @@ fn load_genesis_config( // total transfer vesting balances let transfer_balances = 2631584779144690000000000u128; - // 10000 ksx - let root_balance = 10000000000000000000000u128.saturating_add(transfer_balances); + // 30000 ksx + transfer vesting balances + let root_balance = 30000000000000000000000u128.saturating_add(transfer_balances); let back_to_treasury = 21000000000000000000000000u128 .saturating_sub(root_balance)