2 Commits

Author SHA1 Message Date
Yuri Volkov 9b47a47b3a Merge pull request #7 from paritytech/yuri/release-ci
Building and binaries and docker images to release
2024-07-18 13:07:00 +02:00
cornholio 6b4829dd6c Building and binaries and docker images to release 2024-07-15 12:29:28 +02:00
12 changed files with 10499 additions and 111 deletions
+65
View File
@@ -0,0 +1,65 @@
name: Release
permissions:
contents: write
packages: write
on:
release:
types: [released]
jobs:
release-docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# We've run into out-of-disk error when compiling Polkadot in the next step, so we free up some space this way.
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # 1.3.1
with:
android: true # This alone is a 12 GB save.
# We disable the rest because it caused some problems. (they're enabled by default)
# The Android removal is enough.
dotnet: false
haskell: false
large-packages: false
swap-storage: false
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
release-binaries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rust compilation prerequisites
run: |
sudo apt update
sudo apt install -y \
protobuf-compiler
rustup target add wasm32-unknown-unknown
rustup component add rust-src
- name: Build the template
run: cargo build --locked --release
timeout-minutes: 90
- name: Upload the binaries
uses: softprops/action-gh-release@v2
with:
files: |
target/release/minimal-template-node
target/release/wbuild/minimal-template-runtime/minimal_template_runtime.compact.compressed.wasm
Generated
+10348
View File
File diff suppressed because it is too large Load Diff
-29
View File
@@ -14,33 +14,4 @@ members = [
resolver = "2"
[workspace.dependencies]
clap = { version = "4.5.3" }
docify = { version = "0.2.8" }
frame = { path = "substrate/frame", default-features = false, package = "polkadot-sdk-frame", version = "0.5.0" }
futures = { version = "0.3.30" }
futures-timer = { version = "3.0.2" }
jsonrpsee = { version = "0.23.2" }
minimal-template-runtime = { path = "templates/minimal/runtime", version = "0.1.0" }
sc-basic-authorship = { path = "substrate/client/basic-authorship", default-features = false, version = "0.42.0" }
sc-cli = { path = "substrate/client/cli", default-features = false, version = "0.44.0" }
sc-client-api = { path = "substrate/client/api", default-features = false, version = "35.1.0" }
sc-consensus = { path = "substrate/client/consensus/common", default-features = false, version = "0.41.0" }
sc-consensus-manual-seal = { path = "substrate/client/consensus/manual-seal", default-features = false, version = "0.43.0" }
sc-executor = { path = "substrate/client/executor", default-features = false, version = "0.39.0" }
sc-network = { path = "substrate/client/network", default-features = false, version = "0.42.0" }
sc-offchain = { path = "substrate/client/offchain", default-features = false, version = "37.0.0" }
sc-rpc-api = { path = "substrate/client/rpc-api", default-features = false, version = "0.41.0" }
sc-service = { path = "substrate/client/service", default-features = false, version = "0.43.0" }
sc-telemetry = { path = "substrate/client/telemetry", default-features = false, version = "22.0.0" }
sc-transaction-pool = { path = "substrate/client/transaction-pool", default-features = false, version = "35.0.0" }
sc-transaction-pool-api = { path = "substrate/client/transaction-pool/api", default-features = false, version = "35.0.0" }
serde_json = { version = "1.0.114", default-features = false }
sp-api = { path = "substrate/primitives/api", default-features = false, version = "33.0.0" }
sp-block-builder = { path = "substrate/primitives/block-builder", default-features = false, version = "33.0.0" }
sp-blockchain = { path = "substrate/primitives/blockchain", default-features = false, version = "35.1.0" }
sp-io = { path = "substrate/primitives/io", default-features = false, version = "37.0.0" }
sp-keyring = { path = "substrate/primitives/keyring", default-features = false, version = "38.0.0" }
sp-runtime = { path = "substrate/primitives/runtime", default-features = false, version = "38.0.0" }
sp-timestamp = { path = "substrate/primitives/timestamp", default-features = false, version = "33.0.0" }
substrate-frame-rpc-system = { path = "substrate/utils/frame/rpc/system", default-features = false, version = "36.0.0" }
substrate-build-script-utils = { path = "substrate/utils/build-script-utils", default-features = false, version = "11.0.0" }
+15 -16
View File
@@ -11,13 +11,12 @@
</div>
* 🤏 This template is a minimal (in terms of complexity and the number of components)
template for building a blockchain node.
🤏 This template is a minimal (in terms of complexity and the number of components) template for building a blockchain node.
* 🔧 Its runtime is configured of a single custom pallet as a starting point, and a handful of ready-made pallets
🔧 Its runtime is configured of a single custom pallet as a starting point, and a handful of ready-made pallets
such as a [Balances pallet](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html).
* 👤 The template has no consensus configured - it is best for experimenting with a single node network.
👤 The template has no consensus configured - it is best for experimenting with a single node network.
## Template Structure
@@ -29,12 +28,12 @@ A Polkadot SDK based project such as this one consists of:
## Getting Started
* 🦀 The template is using the Rust language.
🦀 The template is using the Rust language.
* 👉 Check the
👉 Check the
[Rust installation instructions](https://www.rust-lang.org/tools/install) for your system.
* 🛠️ Depending on your operating system and Rust version, there might be additional
🛠️ Depending on your operating system and Rust version, there might be additional
packages required to compile this template - please take note of the Rust compiler output.
### Build
@@ -70,32 +69,32 @@ Development chains:
### Connect with the Polkadot-JS Apps Front-End
* 🌐 You can interact with your local node using the
🌐 You can interact with your local node using the
hosted version of the [Polkadot/Substrate
Portal](https://polkadot.js.org/apps/#/explorer?rpc=ws://localhost:9944).
* 🪐 A hosted version is also
🪐 A hosted version is also
available on [IPFS](https://dotapps.io/).
* 🧑‍🔧 You can also find the source code and instructions for hosting your own instance in the
🧑‍🔧 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.
## Contributing
* 🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk).
🔄 This template is automatically updated after releases in the main [Polkadot SDK monorepo](https://github.com/paritytech/polkadot-sdk).
* ➡️ Any pull requests should be directed to this [source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/minimal).
➡️ Any pull requests should be directed to this [source](https://github.com/paritytech/polkadot-sdk/tree/master/templates/minimal).
* 😇 Please refer to the monorepo's
😇 Please refer to the monorepo's
[contribution guidelines](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md) and
[Code of Conduct](https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CODE_OF_CONDUCT.md).
## Getting Help
* 🧑‍🏫 To learn about Polkadot in general, [Polkadot.network](https://polkadot.network/) website is a good starting point.
🧑‍🏫 To learn about Polkadot in general, [Polkadot.network](https://polkadot.network/) website is a good starting point.
* 🧑‍🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are
🧑‍🔧 For technical introduction, [here](https://github.com/paritytech/polkadot-sdk#-documentation) are
the Polkadot SDK documentation resources.
* 👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and
👥 Additionally, there are [GitHub issues](https://github.com/paritytech/polkadot-sdk/issues) and
[Substrate StackExchange](https://substrate.stackexchange.com/).
+32 -30
View File
@@ -1,6 +1,6 @@
[package]
name = "minimal-template-node"
description = "A minimal Substrate-based Substrate node, ready for hacking. (polkadot v1.14.0)"
description = "A minimal Substrate-based Substrate node, ready for hacking. (polkadot v1.13.0)"
version = "0.1.0"
license = "Unlicense"
authors.workspace = true
@@ -14,38 +14,40 @@ build = "build.rs"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
docify = { workspace = true }
clap = { features = ["derive"], workspace = true }
futures = { features = ["thread-pool"], workspace = true }
futures-timer = { workspace = true }
jsonrpsee = { features = ["server"], workspace = true }
clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
futures-timer = "3.0.1"
jsonrpsee = { version = "0.22", features = ["server"] }
serde_json = { workspace = true, default-features = true }
sc-cli = { version = "0.44.0", workspace = true, default-features = true }
sc-executor = { version = "0.39.0", workspace = true, default-features = true }
sc-network = { version = "0.42.0", workspace = true, default-features = true }
sc-service = { version = "0.43.0", workspace = true, default-features = true }
sc-telemetry = { version = "22.0.0", workspace = true, default-features = true }
sc-transaction-pool = { version = "35.0.0", workspace = true, default-features = true }
sc-transaction-pool-api = { version = "35.0.0", workspace = true, default-features = true }
sc-consensus = { version = "0.41.0", workspace = true, default-features = true }
sc-consensus-manual-seal = { version = "0.43.0", workspace = true, default-features = true }
sc-rpc-api = { version = "0.41.0", workspace = true, default-features = true }
sc-basic-authorship = { version = "0.42.0", workspace = true, default-features = true }
sc-offchain = { version = "37.0.0", workspace = true, default-features = true }
sc-client-api = { version = "35.1.0", workspace = true, default-features = true }
sp-timestamp = { version = "33.0.0", workspace = true, default-features = true }
sp-keyring = { version = "38.0.0", workspace = true, default-features = true }
sp-api = { version = "33.0.0", workspace = true, default-features = true }
sp-blockchain = { version = "35.1.0", workspace = true, default-features = true }
sp-block-builder = { version = "33.0.0", workspace = true, default-features = true }
sp-io = { version = "37.0.0", workspace = true, default-features = true }
sp-runtime = { version = "38.0.0", workspace = true, default-features = true }
substrate-frame-rpc-system = { version = "36.0.0", workspace = true, default-features = true }
frame = { features = ["experimental", "runtime"], workspace = true, default-features = true }
minimal-template-runtime = { version = "0.1.0", workspace = true }
sc-cli = { version = "0.43.0" }
sc-executor = { version = "0.39.0" }
sc-network = { version = "0.41.0" }
sc-service = { version = "0.42.0" }
sc-telemetry = { version = "21.0.0" }
sc-transaction-pool = { version = "35.0.0" }
sc-transaction-pool-api = { version = "35.0.0" }
sc-consensus = { version = "0.40.0" }
sc-consensus-manual-seal = { version = "0.42.0" }
sc-rpc-api = { version = "0.40.0" }
sc-basic-authorship = { version = "0.41.0" }
sc-offchain = { version = "36.0.0" }
sc-client-api = { version = "35.0.0" }
sp-timestamp = { version = "33.0.0" }
sp-keyring = { version = "38.0.0" }
sp-api = { version = "33.0.0" }
sp-blockchain = { version = "35.0.0" }
sp-block-builder = { version = "33.0.0" }
sp-io = { version = "37.0.0" }
sp-runtime = { version = "38.0.0" }
substrate-frame-rpc-system = { version = "35.0.0" }
# Once the native runtime is gone, there should be little to no dependency on FRAME here, and
# certainly no dependency on the runtime.
frame = { version = "0.4.0", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] }
runtime = { package = "minimal-template-runtime", path = "../runtime", version = "0.1.0" }
[build-dependencies]
substrate-build-script-utils = { version = "11.0.0", workspace = true, default-features = true }
substrate-build-script-utils = { version = "11.0.0" }
[features]
default = []
+2 -2
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use minimal_template_runtime::{BalancesConfig, SudoConfig, WASM_BINARY};
use runtime::{BalancesConfig, SudoConfig, WASM_BINARY};
use sc_service::{ChainType, Properties};
use serde_json::{json, Value};
use sp_keyring::AccountKeyring;
@@ -43,7 +43,7 @@ pub fn development_config() -> Result<ChainSpec, String> {
/// Configure initial storage state for FRAME pallets.
fn testnet_genesis() -> Value {
use frame::traits::Get;
use minimal_template_runtime::interface::{Balance, MinimumBalance};
use runtime::interface::{Balance, MinimumBalance};
let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
let balances = AccountKeyring::iter()
.map(|a| (a.to_account_id(), endowment))
+1 -3
View File
@@ -114,9 +114,7 @@ pub fn run() -> sc_cli::Result<()> {
},
Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| {
cmd.run::<minimal_template_runtime::interface::OpaqueBlock>(&config)
})
runner.sync_run(|config| cmd.run::<runtime::interface::OpaqueBlock>(&config))
},
None => {
let runner = cli.create_runner(&cli.run)?;
+2 -3
View File
@@ -23,10 +23,11 @@
#![warn(missing_docs)]
use jsonrpsee::RpcModule;
use minimal_template_runtime::interface::{AccountId, Nonce, OpaqueBlock};
use runtime::interface::{AccountId, Nonce, OpaqueBlock};
use sc_transaction_pool_api::TransactionPool;
use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};
use std::sync::Arc;
use substrate_frame_rpc_system::{System, SystemApiServer};
pub use sc_rpc_api::DenyUnsafe;
@@ -40,7 +41,6 @@ pub struct FullDeps<C, P> {
pub deny_unsafe: DenyUnsafe,
}
#[docify::export]
/// Instantiate all full RPC extensions.
pub fn create_full<C, P>(
deps: FullDeps<C, P>,
@@ -57,7 +57,6 @@ where
C::Api: substrate_frame_rpc_system::AccountNonceApi<OpaqueBlock, AccountId, Nonce>,
P: TransactionPool + 'static,
{
use substrate_frame_rpc_system::{System, SystemApiServer};
let mut module = RpcModule::new(());
let FullDeps { client, pool, deny_unsafe } = deps;
+1 -3
View File
@@ -16,7 +16,7 @@
// limitations under the License.
use futures::FutureExt;
use minimal_template_runtime::{interface::OpaqueBlock as Block, RuntimeApi};
use runtime::{self, interface::OpaqueBlock as Block, RuntimeApi};
use sc_client_api::backend::Backend;
use sc_executor::WasmExecutor;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
@@ -34,10 +34,8 @@ type HostFunctions =
#[cfg(not(feature = "runtime-benchmarks"))]
type HostFunctions = sp_io::SubstrateHostFunctions;
#[docify::export]
pub(crate) type FullClient =
sc_service::TFullClient<Block, RuntimeApi, WasmExecutor<HostFunctions>>;
type FullBackend = sc_service::TFullBackend<Block>;
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
+6 -6
View File
@@ -1,6 +1,6 @@
[package]
name = "pallet-minimal-template"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.14.0)"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.13.0)"
version = "0.1.0"
license = "Unlicense"
authors.workspace = true
@@ -13,13 +13,13 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
codec = { features = [
codec = { package = "parity-scale-codec", version = "3.6.12", features = [
"derive",
], workspace = true }
scale-info = { features = [
], default-features = false }
scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
], workspace = true }
frame = { features = ["experimental", "runtime"], workspace = true }
] }
frame = { version = "0.4.0", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }
[features]
+21 -13
View File
@@ -1,6 +1,6 @@
[package]
name = "minimal-template-runtime"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.14.0)"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.13.0)"
version = "0.1.0"
license = "Unlicense"
authors.workspace = true
@@ -10,20 +10,28 @@ edition.workspace = true
publish = false
[dependencies]
codec = { workspace = true }
scale-info = { workspace = true }
frame = { features = ["experimental", "runtime"], workspace = true }
pallet-balances = { version = "37.0.0", workspace = true }
pallet-sudo = { version = "36.0.0", workspace = true }
pallet-timestamp = { version = "35.0.0", workspace = true }
pallet-transaction-payment = { version = "36.0.0", workspace = true }
pallet-transaction-payment-rpc-runtime-api = { version = "36.0.0", workspace = true }
sp-genesis-builder = { version = "0.14.0", workspace = true }
sp-runtime = { version = "38.0.0", features = ["serde"], workspace = true }
pallet-minimal-template = { version = "0.1.0", workspace = true }
codec = { package = "parity-scale-codec", version = "3.6.12", default-features = false }
scale-info = { version = "2.6.0", default-features = false }
# this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
frame = { version = "0.4.0", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }
# pallets that we want to use
pallet-balances = { version = "36.0.0", default-features = false }
pallet-sudo = { version = "35.0.0", default-features = false }
pallet-timestamp = { version = "34.0.0", default-features = false }
pallet-transaction-payment = { version = "35.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false }
# genesis builder that allows us to interact with runtime genesis config
sp-genesis-builder = { version = "0.14.0", default-features = false }
sp-runtime = { version = "38.0.0", default-features = false, features = ["serde"] }
# local pallet templates
pallet-minimal-template = { path = "../pallets/template", default-features = false, version = "0.1.0" }
[build-dependencies]
substrate-wasm-builder = { version = "23.0.0", optional = true, workspace = true, default-features = true }
substrate-wasm-builder = { version = "23.0.0", optional = true }
[features]
default = ["std"]
+6 -6
View File
@@ -99,27 +99,27 @@ mod runtime {
/// Mandatory system pallet that should always be included in a FRAME runtime.
#[runtime::pallet_index(0)]
pub type System = frame_system::Pallet<Runtime>;
pub type System = frame_system;
/// Provides a way for consensus systems to set and check the onchain time.
#[runtime::pallet_index(1)]
pub type Timestamp = pallet_timestamp::Pallet<Runtime>;
pub type Timestamp = pallet_timestamp;
/// Provides the ability to keep track of balances.
#[runtime::pallet_index(2)]
pub type Balances = pallet_balances::Pallet<Runtime>;
pub type Balances = pallet_balances;
/// Provides a way to execute privileged functions.
#[runtime::pallet_index(3)]
pub type Sudo = pallet_sudo::Pallet<Runtime>;
pub type Sudo = pallet_sudo;
/// Provides the ability to charge for extrinsic execution.
#[runtime::pallet_index(4)]
pub type TransactionPayment = pallet_transaction_payment::Pallet<Runtime>;
pub type TransactionPayment = pallet_transaction_payment;
/// A minimal pallet template.
#[runtime::pallet_index(5)]
pub type Template = pallet_minimal_template::Pallet<Runtime>;
pub type Template = pallet_minimal_template;
}
parameter_types! {