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

[Don't merge] Update the solochain template to 1.14.0 #11

Closed
wants to merge 1 commit into from
Closed
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
10,586 changes: 0 additions & 10,586 deletions Cargo.lock

This file was deleted.

59 changes: 59 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,63 @@ members = [
resolver = "2"

[workspace.dependencies]

solochain-template-runtime = { path = "./runtime" }
pallet-template = { path = "./pallets/template" }
clap = { version = "4.5.3" }
frame-benchmarking-cli = { version = "40.0.0", default-features = false }
frame-system = { version = "36.0.0", default-features = false }
futures = { version = "0.3.30" }
jsonrpsee = { version = "0.23.2" }
pallet-transaction-payment = { version = "36.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "38.0.0", default-features = false }
sc-basic-authorship = { version = "0.42.0", default-features = false }
sc-cli = { version = "0.44.0", default-features = false }
sc-client-api = { version = "35.1.0", default-features = false }
sc-consensus = { version = "0.41.0", default-features = false }
sc-consensus-aura = { version = "0.42.0", default-features = false }
sc-consensus-grandpa = { version = "0.27.0", default-features = false }
sc-executor = { version = "0.39.0", default-features = false }
sc-network = { version = "0.42.0", default-features = false }
sc-offchain = { version = "37.0.0", default-features = false }
sc-rpc-api = { version = "0.41.0", default-features = false }
sc-service = { version = "0.43.0", default-features = false }
sc-telemetry = { version = "22.0.0", default-features = false }
sc-transaction-pool = { version = "35.0.0", default-features = false }
sc-transaction-pool-api = { version = "35.0.0", default-features = false }
serde_json = { version = "1.0.114", default-features = false }
sp-api = { version = "33.0.0", default-features = false }
sp-block-builder = { version = "33.0.0", default-features = false }
sp-blockchain = { version = "35.1.0", default-features = false }
sp-consensus-aura = { version = "0.39.0", default-features = false }
sp-consensus-grandpa = { version = "20.0.0", default-features = false }
sp-core = { version = "34.0.0", default-features = false }
sp-inherents = { version = "33.0.0", default-features = false }
sp-io = { version = "37.0.0", default-features = false }
sp-keyring = { version = "38.0.0", default-features = false }
sp-runtime = { version = "38.0.0", default-features = false }
sp-timestamp = { version = "33.0.0", default-features = false }
substrate-frame-rpc-system = { version = "36.0.0", default-features = false }
substrate-build-script-utils = { version = "11.0.0", default-features = false }
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
frame-benchmarking = { version = "36.0.0", default-features = false }
frame-executive = { version = "36.0.0", default-features = false }
frame-support = { version = "36.0.0", default-features = false }
frame-system-benchmarking = { version = "36.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false }
frame-try-runtime = { version = "0.42.0", default-features = false }
pallet-aura = { version = "35.0.0", default-features = false }
pallet-balances = { version = "37.0.0", default-features = false }
pallet-grandpa = { version = "36.0.0", default-features = false }
pallet-sudo = { version = "36.0.0", default-features = false }
pallet-timestamp = { version = "35.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "36.0.0", default-features = false }
scale-info = { version = "2.11.1", default-features = false }
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-offchain = { version = "33.0.0", default-features = false }
sp-session = { version = "34.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "21.0.0", default-features = false }
sp-transaction-pool = { version = "33.0.0", default-features = false }
sp-version = { version = "36.0.0", default-features = false }
substrate-wasm-builder = { version = "23.0.0", default-features = false }
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM docker.io/paritytech/ci-unified:latest as builder

WORKDIR /polkadot
COPY . /polkadot

RUN cargo fetch
RUN cargo build --locked --release

FROM docker.io/parity/base-bin:latest

COPY --from=builder /polkadot/target/release/solochain-template-node /usr/local/bin

USER root
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
mkdir -p /data /polkadot/.local/share && \
chown -R polkadot:polkadot /data && \
ln -s /data /polkadot/.local/share/polkadot && \
# unclutter and minimize the attack surface
rm -rf /usr/bin /usr/sbin && \
# check if executable works in this container
/usr/local/bin/solochain-template-node --version

USER polkadot

EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]

ENTRYPOINT ["/usr/local/bin/solochain-template-node"]
34 changes: 21 additions & 13 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
MIT No Attribution
This is free and unencumbered software released into the public domain.

Copyright Parity Technologies (UK) Ltd.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ After you start the node template locally, you can interact with it using the
hosted version of the [Polkadot/Substrate
Portal](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944)
front-end by connecting to the local node endpoint. A hosted version is also
available on [IPFS (redirect) here](https://dotapps.io/) or [IPNS (direct)
here](ipns://dotapps.io/?rpc=ws%3A%2F%2F127.0.0.1%3A9944#/explorer). You can
also find the source code and instructions for hosting your own instance on the
available on [IPFS](https://dotapps.io/). You can
also find the source code and instructions for hosting your own instance in the
[`polkadot-js/apps`](https://github.com/polkadot-js/apps) repository.

### Multi-Node Local Testnet
Expand All @@ -131,7 +130,7 @@ capabilities:
the network. Substrate makes it possible to supply custom consensus engines
and also ships with several consensus mechanisms that have been built on top
of [Web3 Foundation
research](https://research.web3.foundation/en/latest/polkadot/NPoS/index.html).
research](https://research.web3.foundation/Polkadot/protocols/NPoS).
- RPC Server: A remote procedure call (RPC) server is used to interact with
Substrate nodes.

Expand Down
104 changes: 67 additions & 37 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "solochain-template-node"
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.12.0)"
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.14.0)"
version = "0.1.0"
license = "MIT-0"
license = "Unlicense"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
Expand All @@ -15,44 +15,74 @@ build = "build.rs"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
clap = { features = ["derive"], workspace = true }
futures = { features = ["thread-pool"], workspace = true }
serde_json = { workspace = true, default-features = true }
jsonrpsee = { version = "0.22", features = ["server"] }
sc-cli = { version = "0.42.0" }
sp-core = { version = "33.0.1" }
sc-executor = { version = "0.38.0" }
sc-network = { version = "0.40.0" }
sc-service = { version = "0.41.0" }
sc-telemetry = { version = "20.0.0" }
sc-transaction-pool = { version = "34.0.0" }
sc-transaction-pool-api = { version = "34.0.0" }
sc-offchain = { version = "35.0.0" }
sc-consensus-aura = { version = "0.40.0" }
sp-consensus-aura = { version = "0.38.0" }
sc-consensus = { version = "0.39.1" }
sc-consensus-grandpa = { version = "0.25.0" }
sp-consensus-grandpa = { version = "19.0.0" }
sc-client-api = { version = "34.0.0" }
sc-rpc-api = { version = "0.39.0" }
sc-basic-authorship = { version = "0.40.0" }
sp-runtime = { version = "37.0.0" }
sp-io = { version = "36.0.0" }
sp-timestamp = { version = "32.0.0" }
sp-inherents = { version = "32.0.0" }
sp-keyring = { version = "37.0.0" }
sp-api = { version = "32.0.0" }
sp-blockchain = { version = "34.0.0" }
sp-block-builder = { version = "32.0.0" }
frame-system = { version = "34.0.0" }
pallet-transaction-payment = { version = "34.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "36.0.0" }
substrate-frame-rpc-system = { version = "34.0.0" }
frame-benchmarking-cli = { version = "38.0.0" }
solochain-template-runtime = { version = "0.1.0", path = "../runtime" }
jsonrpsee = { features = ["server"], workspace = true }
sc-cli.workspace = true
sc-cli.default-features = true
sp-core.workspace = true
sp-core.default-features = true
sc-executor.workspace = true
sc-executor.default-features = true
sc-network.workspace = true
sc-network.default-features = true
sc-service.workspace = true
sc-service.default-features = true
sc-telemetry.workspace = true
sc-telemetry.default-features = true
sc-transaction-pool.workspace = true
sc-transaction-pool.default-features = true
sc-transaction-pool-api.workspace = true
sc-transaction-pool-api.default-features = true
sc-offchain.workspace = true
sc-offchain.default-features = true
sc-consensus-aura.workspace = true
sc-consensus-aura.default-features = true
sp-consensus-aura.workspace = true
sp-consensus-aura.default-features = true
sc-consensus.workspace = true
sc-consensus.default-features = true
sc-consensus-grandpa.workspace = true
sc-consensus-grandpa.default-features = true
sp-consensus-grandpa.workspace = true
sp-consensus-grandpa.default-features = true
sc-client-api.workspace = true
sc-client-api.default-features = true
sc-rpc-api.workspace = true
sc-rpc-api.default-features = true
sc-basic-authorship.workspace = true
sc-basic-authorship.default-features = true
sp-runtime.workspace = true
sp-runtime.default-features = true
sp-io.workspace = true
sp-io.default-features = true
sp-timestamp.workspace = true
sp-timestamp.default-features = true
sp-inherents.workspace = true
sp-inherents.default-features = true
sp-keyring.workspace = true
sp-keyring.default-features = true
sp-api.workspace = true
sp-api.default-features = true
sp-blockchain.workspace = true
sp-blockchain.default-features = true
sp-block-builder.workspace = true
sp-block-builder.default-features = true
frame-system.workspace = true
frame-system.default-features = true
pallet-transaction-payment.workspace = true
pallet-transaction-payment-rpc.workspace = true
pallet-transaction-payment-rpc.default-features = true
substrate-frame-rpc-system.workspace = true
substrate-frame-rpc-system.default-features = true
frame-benchmarking-cli.workspace = true
frame-benchmarking-cli.default-features = true
solochain-template-runtime.workspace = true

[build-dependencies]
substrate-build-script-utils = { version = "11.0.0" }
substrate-build-script-utils.workspace = true
substrate-build-script-utils.default-features = true

[features]
default = []
Expand Down
4 changes: 2 additions & 2 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sc_service::ChainType;
use solochain_template_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY};
use solochain_template_runtime::{AccountId, Signature, WASM_BINARY};
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{sr25519, Pair, Public};
Expand All @@ -9,7 +9,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
// const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";

/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<RuntimeGenesisConfig>;
pub type ChainSpec = sc_service::GenericChainSpec;

/// Generate a crypto pair from seed.
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
Expand Down
2 changes: 1 addition & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn run() -> sc_cli::Result<()> {
"Runtime benchmarking wasn't enabled when building the node. \
You can enable it with `--features runtime-benchmarks`."
.into(),
)
);
}

cmd.run_with_spec::<sp_runtime::traits::HashingFor<Block>, ()>(Some(
Expand Down
26 changes: 12 additions & 14 deletions pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "pallet-template"
description = "FRAME pallet template for defining custom runtime logic. (polkadot v1.12.0)"
description = "FRAME pallet template for defining custom runtime logic. (polkadot v1.14.0)"
version = "0.1.0"
license = "MIT-0"
license = "Unlicense"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
Expand All @@ -13,22 +13,20 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
codec = { features = [
"derive",
] }
scale-info = { version = "2.11.1", default-features = false, features = [
], workspace = true }
scale-info = { features = [
"derive",
] }

# frame deps
frame-benchmarking = { version = "34.0.0", default-features = false, optional = true }
frame-support = { version = "34.0.0", default-features = false }
frame-system = { version = "34.0.0", default-features = false }
], workspace = true }
frame-benchmarking = { optional = true, workspace = true }
frame-support.workspace = true
frame-system.workspace = true

[dev-dependencies]
sp-core = { version = "33.0.1" }
sp-io = { version = "36.0.0" }
sp-runtime = { version = "37.0.0" }
sp-core = { default-features = true, path = "../../../../substrate/primitives/core" }
sp-io = { default-features = true, path = "../../../../substrate/primitives/io" }
sp-runtime = { default-features = true, path = "../../../../substrate/primitives/runtime" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion pallets/template/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod benchmarks {

#[benchmark]
fn do_something() {
let value = 100u32.into();
let value = 100u32;
let caller: T::AccountId = whitelisted_caller();
#[extrinsic_call]
do_something(RawOrigin::Signed(caller), value);
Expand Down
33 changes: 2 additions & 31 deletions pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
use crate as pallet_template;
use frame_support::{
derive_impl,
traits::{ConstU16, ConstU64},
};
use sp_core::H256;
use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},
BuildStorage,
};
use frame_support::derive_impl;
use sp_runtime::BuildStorage;

type Block = frame_system::mocking::MockBlock<Test>;

Expand All @@ -22,29 +15,7 @@ frame_support::construct_runtime!(

#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
type BlockLength = ();
type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type Nonce = u64;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = u64;
type Lookup = IdentityLookup<Self::AccountId>;
type Block = Block;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU64<250>;
type Version = ();
type PalletInfo = PalletInfo;
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
type SS58Prefix = ConstU16<42>;
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
}

impl pallet_template::Config for Test {
Expand Down
Loading
Loading