Skip to content

Commit

Permalink
Fix parachain config & Add zombienet config (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou authored Nov 14, 2023
1 parent 9c508f0 commit 0c25210
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 36 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace.package]
authors = ["anonymous"]
edition = "2021"
version = "0.34.0"
license = "Unlicense"
homepage = "https://github.com/paritytech/substrate-contracts-node"
repository = "https://github.com/paritytech/substrate-contracts-node"
Expand Down
12 changes: 6 additions & 6 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "contracts-node"
version = "0.33.0"
authors = ["Parity Technologies <[email protected]>"]
version.workspace = true
authors.workspace = true
description = "Substrate node configured for smart contracts via `pallet-contracts`."
edition = "2021"
license = "Unlicense"
edition.workspace = true
license.workspace = true
build = "build.rs"
homepage = "https://github.com/paritytech/substrate-contracts-node"
repository = "https://github.com/paritytech/substrate-contracts-node"
homepage.workspace = true
repository.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
55 changes: 26 additions & 29 deletions parachain-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ impl pallet_balances::Config for Runtime {
type ReserveIdentifier = [u8; 8];
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
type MaxHolds = ConstU32<50>;
type MaxFreezes = ConstU32<50>;
}

parameter_types! {
Expand Down Expand Up @@ -491,37 +491,33 @@ impl pallet_utility::Config for Runtime {
construct_runtime!(
pub enum Runtime
{
// System support stuff.
System: frame_system = 0,
ParachainSystem: cumulus_pallet_parachain_system = 1,
Timestamp: pallet_timestamp = 2,
ParachainInfo: parachain_info = 3,

// Monetary stuff.
Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment = 11,
// Order should match with Runtime defined in runtime/src/lib.rs
System: frame_system,
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip,
Utility: pallet_utility,
Timestamp: pallet_timestamp,
Balances: pallet_balances,
Authorship: pallet_authorship,
TransactionPayment: pallet_transaction_payment,
Sudo: pallet_sudo,
Contracts: pallet_contracts,
Assets: pallet_assets,

// Governance
Sudo: pallet_sudo = 15,
// Parachain support stuff.
ParachainSystem: cumulus_pallet_parachain_system,
ParachainInfo: parachain_info,

// Collator support. The order of these 4 are important and shall not change.
Authorship: pallet_authorship = 20,
CollatorSelection: pallet_collator_selection = 21,
Session: pallet_session = 22,
Aura: pallet_aura = 23,
AuraExt: cumulus_pallet_aura_ext = 24,
CollatorSelection: pallet_collator_selection,
Session: pallet_session,
Aura: pallet_aura,
AuraExt: cumulus_pallet_aura_ext,

// XCM helpers.
XcmpQueue: cumulus_pallet_xcmp_queue = 30,
PolkadotXcm: pallet_xcm = 31,
CumulusXcm: cumulus_pallet_xcm = 32,
DmpQueue: cumulus_pallet_dmp_queue = 33,

// Others specific to this parachain.
Contracts: pallet_contracts,
Assets: pallet_assets,
RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip,
Utility: pallet_utility,
XcmpQueue: cumulus_pallet_xcmp_queue,
PolkadotXcm: pallet_xcm,
CumulusXcm: cumulus_pallet_xcm,
DmpQueue: cumulus_pallet_dmp_queue,
}
);

Expand Down Expand Up @@ -762,7 +758,8 @@ impl_runtime_apis! {
Ok(batches)
}
}
impl pallet_contracts::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash, EventRecord>

impl pallet_contracts::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash, EventRecord>
for Runtime
{
fn call(
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contracts-node-runtime"
version = "0.33.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
description = "Runtime configured for smart contracts via `pallet-contracts`."
Expand Down
33 changes: 33 additions & 0 deletions zombienet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This sample Zombienet configuration file can be used to spawn a local network with a relaychain
# and a substrate-contracts-node parachain.
#
# Requirements:
# - Install zombienet from https://github.com/paritytech/zombienet/releases.
# - Build `polkadot`, `polkadot-execute-worker` and `polkadot-prepare-worker` from `polkadot-sdk` and make the binaries available in your path.
# - Build or install `substrate-contracts-node` and make the binary available in your path.
#
# Usage:
# zombienet spawn --provider native zombienet.toml

[relaychain]
chain = "rococo-local"
command = "polkadot"

[[relaychain.nodes]]
name = "alice"
args = [ "--alice", "-lruntime=debug,parachain=trace" ]

[[relaychain.nodes]]
name = "bob"
args = [ "--bob", "-lruntime=debug,parachain=trace" ]

[[parachains]]
id = 100
addToGenesis = true
chain = "contracts-parachain-local"

[parachains.collator]
name = "collator01"
rpc_port = 9944
command = "substrate-contracts-node"
args = [ "-lerror,runtime::contracts=debug,runtime::contracts::strace=trace" ]

0 comments on commit 0c25210

Please sign in to comment.