Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
0c28a41
Initial commit
Jul 30, 2020
f54c0cb
Clean code
Aug 7, 2020
49ef02e
Crib some basic QA stuff from recipes
JoshOrndorff Aug 6, 2020
59c411b
Add parachain info
Aug 8, 2020
9c4e41f
Update to Cumulus 96da14c
Aug 10, 2020
03edb9b
Update README.md
riusricardo Aug 10, 2020
2710c42
Merge pull request #2 from substrate-developer-hub/ricardo/full-update
JoshOrndorff Aug 10, 2020
712fe04
Update to Cumulus 35f60b1
Aug 19, 2020
a67bbb8
Merge pull request #4 from substrate-developer-hub/ricardo/update-cum…
riusricardo Aug 19, 2020
df2cecc
Tailor the README More Specifically to this Project (#5)
Aug 22, 2020
d439ea5
prune incorrect file headers
JoshOrndorff Aug 25, 2020
5b0270b
Update to Cumulus 4e7f138
Aug 25, 2020
57fba24
Merge pull request #6 from substrate-developer-hub/joshy-prune-gpl3
riusricardo Aug 25, 2020
9506b93
Merge pull request #7 from substrate-developer-hub/ricardo/update-cum…
riusricardo Aug 25, 2020
aa86d44
Add Polkadot JS types
Oct 15, 2020
cdf1729
Update to rococo-v1
Jan 16, 2021
422bc45
Update to CUmulus 4b69b8d
Feb 2, 2021
b4aa45a
chore: update to use Rococov1 branch
whalelephant Feb 17, 2021
09ff0eb
fix: template pallet and tests to run
whalelephant Feb 17, 2021
24fa199
docs: compile polkadot with real-overseer feat
whalelephant Feb 17, 2021
d5c1c30
fix: update rustc version in gha
whalelephant Feb 17, 2021
04d3546
Merge pull request #11 from whalelephant/whalelephant-update-to-rococ…
riusricardo Feb 23, 2021
0ab43bd
enable ocw (#13)
juniuszhou Mar 9, 2021
b32ee91
fix:match cumulus refactoring (#14)
stanly-johnson Mar 12, 2021
72f933b
fix enable ocw (#15)
Satoshi-Kusumoto Mar 17, 2021
465d539
Update Cargo.lock
Mar 18, 2021
dd3383b
Update to Cumulus 28f5ec2 (#18)
johnwhitton Apr 6, 2021
40b8581
Update template to cumulus@6ed9632 (#21)
stanly-johnson Apr 19, 2021
8ba99d4
Updating versions
May 5, 2021
765c00d
update readme instructions, create stong indication of rococo testnet…
nuke-web3 May 5, 2021
74671fb
Merge pull request #26 from substrate-developer-hub/al3mart/update-te…
nuke-web3 May 5, 2021
1e1e725
update readme
nuke-web3 May 5, 2021
60df341
Update README.md
davidrhodus May 20, 2021
a70799d
Merge pull request #32 from davidrhodus/dr-README
nuke-web3 May 20, 2021
b7d946d
Update rococo-v1 -> polkadot-v0.9.3 (#33)
nuke-web3 Jun 3, 2021
9c65875
add editorconfig & rustfmt.toml, run `rustfmt && eclint fix` (#42)
nuke-web3 Jun 3, 2021
9ff2041
Update to polkadot-v.0.9.6 (#46)
nuke-web3 Jul 1, 2021
4c47b6e
Expect para_id on load_spec for parachain (#48)
Jul 1, 2021
f3f2829
remove polkadot-cli features (#52)
nuke-web3 Jul 2, 2021
cdc5e5e
Updated to polkadot v0.9.7 (#50)
Jul 2, 2021
c115b3a
rollback expect para_id (#57)
Jul 9, 2021
b52e394
Update to 0.9.8 (#58)
nuke-web3 Jul 13, 2021
9b41b90
Add rustfmt, run `cargo +nightly fmt` (#61)
nuke-web3 Jul 24, 2021
6589adf
Update to `polkadot-v0.9.9` (#65)
nuke-web3 Aug 26, 2021
ff39ffa
remove relay root origin for XCM (#75)
nuke-web3 Sep 27, 2021
b648b7f
Update to `polkadot-v0.9.10` (#73)
nuke-web3 Sep 29, 2021
8c36ad6
Fix XCM config
Oct 18, 2021
70b63ad
Update to `polkadot-0.9.11` (#80)
nuke-web3 Nov 2, 2021
eb9d228
Update to `polkadot-v0.9.12` (#82)
nuke-web3 Nov 11, 2021
971fc22
Update template to `polkadot-v0.9.13` (#85)
nuke-web3 Dec 2, 2021
68f23f3
update to polkadot-v0.9.15 (#90)
Jan 27, 2022
37b014f
update to polkadot v0.9.15-1 (#91)
nuke-web3 Jan 28, 2022
3991752
Direct pull from Cumulus upstream polkadot-v0.9.16 branch (#93)
nuke-web3 Jan 29, 2022
200d26e
Ds/0.9.16 (#94)
nuke-web3 Jan 29, 2022
6b73957
rm lock and rebuild post Polkadot v0.9.16 release (#96)
nuke-web3 Feb 4, 2022
4bdc77a
fix runtime-benchmarks compile
shawntabrizi Feb 15, 2022
a8baf8f
polkadot-v0.9.17 (#101)
nuke-web3 Feb 24, 2022
dfced8e
Update to `polkadot-v0.9.18` (#103)
nuke-web3 Mar 22, 2022
7849727
Update to upstream polkadot-v0.9.19 (#108)
nuke-web3 Apr 21, 2022
f8c4e6f
update to polkadot-v0.9.20 upstream (#110)
nuke-web3 May 4, 2022
d656f66
update to polkadot-v0.9.22 (#111)
brunopgalvao May 25, 2022
ffb52cf
update to include backport in lockfile (#112)
nuke-web3 May 25, 2022
f257ec7
update to polkadot-v0.9.23 (#113)
brunopgalvao Jun 2, 2022
e0388cb
Update to polkadot-v0.9.24 (#115)
brunopgalvao Jun 16, 2022
a48fc05
Update to polkadot-v0.9.25 (#121)
brunopgalvao Jul 18, 2022
a473da4
Update to polkadot-v0.9.26 (#122)
brunopgalvao Jul 20, 2022
c5338b4
Auto-Update node-template from polkadot-v0.9.27 (#123)
paritytech-ci Aug 6, 2022
fd9771e
Auto-Update substrate-parachain-template from polkadot-v0.9.28 (#124)
paritytech-ci Aug 24, 2022
8c2b74a
update lock only 0.9.28
paritytech-ci Sep 29, 2022
18020ea
clean lock
nuke-web3 Sep 29, 2022
986312b
Auto-Update substrate-parachain-template from polkadot-v0.9.29 (#129)
paritytech-ci Sep 29, 2022
dbf3670
bump lock to get cargo c working (#132)
nuke-web3 Oct 8, 2022
6f6598a
Update test-code.yml
nuke-web3 Oct 24, 2022
2b94483
Auto-Update substrate-parachain-template from polkadot-v0.9.30 (#133)
paritytech-ci Oct 25, 2022
664114f
Auto-Update substrate-parachain-template from polkadot-v0.9.32 (#138)
paritytech-ci Nov 22, 2022
06ac43b
Auto-Update substrate-parachain-template from polkadot-v0.9.36 (#145)
paritytech-ci Jan 13, 2023
6cde4f1
Auto-Update substrate-parachain-template from polkadot-v0.9.37 (#149)
paritytech-ci Jan 26, 2023
677a1a2
create CODEOWNERS (#151)
nuke-web3 Jan 27, 2023
a04589b
Auto-Update substrate-parachain-template from polkadot-v0.9.40 (#153)
paritytech-ci Mar 31, 2023
c0ad24f
Fix typo in `.gitignore` (#156)
xrelkd Apr 16, 2023
58a4a07
Auto-Update substrate-parachain-template from polkadot-v0.9.42 (#158)
paritytech-ci May 9, 2023
1cf9227
Release pipeline for multiarch binaries and an image (#159)
TriplEight May 22, 2023
ebcc725
Auto-Update substrate-parachain-template from polkadot-v0.9.43 (#174)
paritytech-ci Jun 15, 2023
28a5c17
integrate evm and ethereum pallets
magecnion Jun 28, 2023
ab9d07c
runtime api added; wip netapi rpc
magecnion Jul 4, 2023
3eee53b
frontier extrinsic missing
magecnion Jul 4, 2023
6396b85
net api
magecnion Jul 4, 2023
cf77bb0
Merge remote-tracking branch 'template/main' into update_polkadot_0.9.43
magecnion Jul 6, 2023
5d17ae7
fixes derived from updating to v0.9.43
magecnion Jul 7, 2023
d3751b2
remove unused files
magecnion Jul 7, 2023
d215a78
remove pallet template files
magecnion Jul 7, 2023
edd580f
add rococo relay chain spec as raw
magecnion Jul 7, 2023
4a89346
Merge branch 'fix/use_relay_chain_spec_as_raw' of github.com:freevers…
magecnion Jul 7, 2023
eea0aaf
Merge branch 'update_polkadot_0.9.43' of github.com:freeverseio/laos-…
magecnion Jul 7, 2023
1ef780c
Working evm rpc
dastanbeksamatov Jul 11, 2023
4d93877
Merge branch 'dev' into feature/add_rpc_frontier_layer
asiniscalchi Jul 11, 2023
96bf28c
try fix clippy
dastanbeksamatov Jul 11, 2023
1c696ae
Merge branch 'feature/add_rpc_frontier_layer' of github-freeverse:fre…
dastanbeksamatov Jul 11, 2023
5a87d44
File clippy
dastanbeksamatov Jul 11, 2023
4effad2
Fix more clippy errors
dastanbeksamatov Jul 11, 2023
9ce5e97
remove unnecessary delimiter
dastanbeksamatov Jul 11, 2023
b44639b
Redundant clone
dastanbeksamatov Jul 11, 2023
ac94701
Fix compile issue
dastanbeksamatov Jul 11, 2023
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
1,889 changes: 1,306 additions & 583 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 24 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ build = "build.rs"

[dependencies]
clap = { version = "4.2.7", features = ["derive"] }
futures = "0.3.25"
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.163", features = ["derive"] }
jsonrpsee = { version = "0.16.2", features = ["server"] }
hex-literal = { version = "0.4.1" }

# Local
parachain-template-runtime = { path = "../runtime" }
Expand Down Expand Up @@ -67,17 +69,37 @@ cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/c
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.43" }
color-print = "0.3.4"

# Frontier
fc-cli = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fc-rpc = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", features = [ "rpc-binary-search-estimate" ] }
fc-rpc-core = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fc-mapping-sync = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fc-db = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fc-consensus = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fc-storage = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fp-rpc = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43", default-features = false }
fp-evm = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }
fp-dynamic-fee = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v0.9.43" }

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

[features]
default = []
runtime-benchmarks = [
"try-runtime-cli/try-runtime",
"parachain-template-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
]
try-runtime = [
"try-runtime-cli/try-runtime",
"parachain-template-runtime/try-runtime"
"parachain-template-runtime/try-runtime",
"polkadot-cli/try-runtime",
"polkadot-service/try-runtime",
"sp-runtime/try-runtime",
]
107 changes: 98 additions & 9 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use cumulus_primitives_core::ParaId;
use parachain_template_runtime::{AccountId, AuraId, Signature, SudoConfig, EXISTENTIAL_DEPOSIT};
use parachain_template_runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
use sp_core::{sr25519, Pair, Public};
use sp_core::{sr25519, Pair, Public, H160, U256};
use sp_runtime::traits::{IdentifyAccount, Verify};
use std::{collections::BTreeMap, str::FromStr};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
Expand All @@ -15,7 +16,7 @@ const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;

/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
TPublic::Pair::from_string(&format!("//{seed}"), None)
.expect("static values are valid; qed")
.public()
}
Expand Down Expand Up @@ -101,8 +102,9 @@ pub fn development_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
// Give Alice root privileges
Some(get_account_id_from_seed::<sr25519::Public>("Alice")),
1000.into(),
get_account_id_from_seed::<sr25519::Public>("Alice"),
)
},
Vec::new(),
Expand Down Expand Up @@ -157,8 +159,9 @@ pub fn local_testnet_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
],
// Give Alice root privileges
Some(get_account_id_from_seed::<sr25519::Public>("Alice")),
1000.into(),
get_account_id_from_seed::<sr25519::Public>("Alice"),
)
},
// Bootnodes
Expand All @@ -182,18 +185,44 @@ pub fn local_testnet_config() -> ChainSpec {
fn testnet_genesis(
invulnerables: Vec<(AccountId, AuraId)>,
endowed_accounts: Vec<AccountId>,
root_key: Option<AccountId>,
id: ParaId,
root_key: AccountId,
) -> parachain_template_runtime::GenesisConfig {
// let alice = get_from_seed::<sr25519::Public>("Alice");
// let bob = get_from_seed::<sr25519::Public>("Bob");

parachain_template_runtime::GenesisConfig {
system: parachain_template_runtime::SystemConfig {
code: parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
.to_vec(),
},
// Configure additional assets here
// For example, this configures asset "ALT1" & "ALT2" with owners, alice and bob, respectively
// assets: parachain_template_runtime::AssetsConfig {
// assets: vec![
// (1, alice.into(), true, 10_000_000_0000),
// (2, bob.into(), true, 10_000_000_0000),
// ],
// // Genesis metadata: Vec<(id, name, symbol, decimals)>
// metadata: vec![
// (1, "asset-1".into(), "ALT1".into(), 10),
// (2, "asset-2".into(), "ALT2".into(), 10),
// ],
// // Genesis accounts: Vec<(id, account_id, balance)>
// accounts: vec![(1, alice.into(), 50_000_000_0000), (2, bob.into(), 50_000_000_0000)],
// },
balances: parachain_template_runtime::BalancesConfig {
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
},
// council: parachain_template_runtime::CouncilConfig {
// phantom: PhantomData,
// members: endowed_accounts
// .iter()
// .enumerate()
// .filter_map(|(idx, acc)| if idx % 2 == 0 { Some(acc.clone()) } else { None })
// .collect::<Vec<_>>(),
// },
parachain_info: parachain_template_runtime::ParachainInfoConfig { parachain_id: id },
collator_selection: parachain_template_runtime::CollatorSelectionConfig {
invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(),
Expand All @@ -220,10 +249,70 @@ fn testnet_genesis(
polkadot_xcm: parachain_template_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
},
sudo: parachain_template_runtime::SudoConfig { key: root_key },
transaction_payment: Default::default(),
sudo: SudoConfig {
// Assign network admin rights.
key: Some(root_key),
// EVM compatibility
evm_chain_id: parachain_template_runtime::EVMChainIdConfig { chain_id: 1000 },
evm: parachain_template_runtime::EVMConfig {
accounts: {
let mut map = BTreeMap::new();
map.insert(
// H160 address of Alice dev account
// Derived from SS58 (42 prefix) address
// SS58: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
// hex: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
// Using the full hex key, truncating to the first 20 bytes (the first 40 hex chars)
H160::from_str("d43593c715fdd31c61141abd04a99fd6822c8558")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
balance: U256::from_str("0xffffffffffffffffffffffffffffffff")
.expect("internal U256 is valid; qed"),
code: Default::default(),
nonce: Default::default(),
storage: Default::default(),
},
);
map.insert(
// H160 address of CI test runner account
H160::from_str("6be02d1d3665660d22ff9624b7be0551ee1ac91b")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
balance: U256::from_str("0xffffffffffffffffffffffffffffffff")
.expect("internal U256 is valid; qed"),
code: Default::default(),
nonce: Default::default(),
storage: Default::default(),
},
);
map.insert(
// H160 address for benchmark usage
H160::from_str("1000000000000000000000000000000000000001")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
nonce: U256::from(1),
balance: U256::from(1_000_000_000_000_000_000_000_000u128),
storage: Default::default(),
code: vec![0x00],
},
);
map.insert(
// H160 address of dev account
// Private key : 0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df
H160::from_str("C0F0f4ab324C46e55D02D0033343B4Be8A55532d")
.expect("internal H160 is valid; qed"),
fp_evm::GenesisAccount {
balance: U256::from_str("0xef000000000000000000000000000")
.expect("internal U256 is valid; qed"),
code: Default::default(),
nonce: Default::default(),
storage: Default::default(),
},
);
map
},
},
ethereum: Default::default(),
// dynamic_fee: Default::default(),
base_fee: Default::default(),
}
}
21 changes: 8 additions & 13 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::eth::EthConfiguration;
use std::path::PathBuf;

/// Sub-commands supported by the collator.
Expand Down Expand Up @@ -43,27 +44,17 @@ pub enum Subcommand {
/// Errors since the binary was not build with `--features try-runtime`.
#[cfg(not(feature = "try-runtime"))]
TryRuntime,

/// Db meta columns information.
FrontierDb(fc_cli::FrontierDbCmd),
}

const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
r#"<bold><underline>Examples:</></>
<bold>parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json</>
Export a chainspec for a local testnet in json format.
<bold>parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain rococo-local</>
Launch a full node with chain specification loaded from plain-parachain-chainspec.json.
<bold>parachain-template-node</>
Launch a full node with default parachain <italic>local-testnet</> and relay chain <italic>rococo-local</>.
<bold>parachain-template-node --collator</>
Launch a collator with default parachain <italic>local-testnet</> and relay chain <italic>rococo-local</>.
"#
);
#[derive(Debug, clap::Parser)]
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
#[clap(after_help = AFTER_HELP_EXAMPLE)]
pub struct Cli {
#[command(subcommand)]
pub subcommand: Option<Subcommand>,
Expand All @@ -84,6 +75,10 @@ pub struct Cli {
/// Relay chain arguments
#[arg(raw = true)]
pub relay_chain_args: Vec<String>,

// Frontier arguments
#[command(flatten)]
pub eth: EthConfiguration,
}

#[derive(Debug)]
Expand Down
Loading