Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: MMD-717 10 to 1 #1

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Substrate Node Template

## Quickstart

```
cargo test -p node-template-runtime

rm -rf /tmp/polkadot-chains

cargo build --release

RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/node-template \
--base-path /tmp/polkadot-chains/alice \
--name "Development Chain" \
--dev \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
-lruntime=debug
```

## Intro
[![Try on playground](https://img.shields.io/badge/Playground-Node_Template-brightgreen?logo=Parity%20Substrate)](https://playground.substrate.dev/?deploy=node-template) [![Matrix](https://img.shields.io/matrix/substrate-technical:matrix.org)](https://matrix.to/#/#substrate-technical:matrix.org)

A fresh FRAME-based [Substrate](https://www.substrate.io/) node, ready for hacking :rocket:
Expand Down
7 changes: 7 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'

[dependencies.serde_json]
version = '1.0.41'

[dependencies.serde]
version = '1.0.102'
features = ['derive']

[features]
default = []
runtime-benchmarks = ['node-template-runtime/runtime-benchmarks']
13 changes: 11 additions & 2 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use node_template_runtime::{
AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,
SystemConfig, WASM_BINARY,
SystemConfig, TemplateModuleConfig, WASM_BINARY,
};
use sc_service::ChainType;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_core::{sr25519, Pair, Public};
use sp_finality_grandpa::AuthorityId as GrandpaId;
use sp_runtime::traits::{IdentifyAccount, Verify};
use serde_json::map::Map;

// The URL for the telemetry server.
// const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
Expand Down Expand Up @@ -39,6 +40,10 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
pub fn development_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;

let mut properties = Map::new();
properties.insert("tokenSymbol".into(), "UNIT".into());
properties.insert("tokenDecimals".into(), 18.into());

Ok(ChainSpec::from_genesis(
// Name
"Development",
Expand Down Expand Up @@ -69,7 +74,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
// Protocol ID
None,
// Properties
None,
Some(properties),
// Extensions
None,
))
Expand Down Expand Up @@ -150,5 +155,9 @@ fn testnet_genesis(
// Assign network admin rights.
key: root_key,
},
template_module: TemplateModuleConfig {
rewards_allowance_dhx_current: 5_000_000_000_000_000_000_000u128,
rewards_allowance_dhx_for_date: Default::default(),
}
}
}
38 changes: 36 additions & 2 deletions pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'

[dependencies.chrono]
default_features = false
version = '0.4.19'

[dependencies.log]
version = '0.4.8'

[dependencies.codec]
default-features = false
features = ['derive']
Expand All @@ -59,13 +66,40 @@ git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'

[dependencies.sp-std]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'

[dependencies.pallet-balances]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'

[dependencies.pallet-timestamp]
default-features = false
git = 'https://github.com/paritytech/substrate.git'
tag = 'monthly-2021-08'
version = '4.0.0-dev'

[features]
default = ['std']
runtime-benchmarks = ['frame-benchmarking']
runtime-benchmarks = [
'frame-benchmarking',
'pallet-balances/runtime-benchmarks',
'pallet-timestamp/runtime-benchmarks',
]
std = [
'chrono/std',
'log/std',
'codec/std',
'frame-support/std',
'frame-system/std',
'frame-benchmarking/std',
'sp-std/std',
'pallet-balances/std',
'pallet-timestamp/std',
]
try-runtime = ['frame-support/try-runtime']
try-runtime = ['frame-support/try-runtime']
Loading