mirror of
https://github.com/pezkuwichain/pez-solochain-template.git
synced 2026-04-21 23:47:59 +00:00
feat: complete rebranding to Pezkuwi/Bizinikiwi/Pezframe and update dependencies
This commit is contained in:
Generated
+5135
-4781
File diff suppressed because it is too large
Load Diff
+50
-50
@@ -58,60 +58,60 @@ scale-info = { version = "2.11", default-features = false }
|
|||||||
serde_json = { version = "1.0", default-features = false }
|
serde_json = { version = "1.0", default-features = false }
|
||||||
|
|
||||||
# Pezkuwi SDK dependencies (path to local pezkuwi-sdk - update to git/crates.io when published)
|
# Pezkuwi SDK dependencies (path to local pezkuwi-sdk - update to git/crates.io when published)
|
||||||
pezframe-benchmarking = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/benchmarking", default-features = false }
|
pezframe-benchmarking = { version = "28.0.0", default-features = false }
|
||||||
pezframe-benchmarking-cli = { path = "../pezkuwi-sdk/bizinikiwi/utils/pezframe/benchmarking-cli", default-features = false }
|
pezframe-benchmarking-cli = { version = "32.0.1" }
|
||||||
pezframe-executive = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/executive", default-features = false }
|
pezframe-executive = { version = "28.0.0" , default-features = false }
|
||||||
pezframe-metadata-hash-extension = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/metadata-hash-extension", default-features = false }
|
pezframe-metadata-hash-extension = { version = "0.1.0" , default-features = false }
|
||||||
pezframe-support = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/support", default-features = false }
|
pezframe-support = { version = "28.0.0" , default-features = false }
|
||||||
pezframe-system = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/system", default-features = false }
|
pezframe-system = { version = "28.0.0" , default-features = false }
|
||||||
pezframe-system-benchmarking = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/system/benchmarking", default-features = false }
|
pezframe-system-benchmarking = { version = "28.0.0" , default-features = false }
|
||||||
pezframe-system-rpc-runtime-api = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/system/rpc/runtime-api", default-features = false }
|
pezframe-system-rpc-runtime-api = { version = "26.0.0" , default-features = false }
|
||||||
pezframe-try-runtime = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/try-runtime", default-features = false }
|
pezframe-try-runtime = { version = "0.34.0" , default-features = false }
|
||||||
|
|
||||||
pezpallet-aura = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-aura", default-features = false }
|
pezpallet-aura = { version = "27.0.0" , default-features = false }
|
||||||
pezpallet-balances = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-balances", default-features = false }
|
pezpallet-balances = { version = "28.0.0" , default-features = false }
|
||||||
pezpallet-grandpa = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-grandpa", default-features = false }
|
pezpallet-grandpa = { version = "28.0.0" , default-features = false }
|
||||||
pezpallet-sudo = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-sudo", default-features = false }
|
pezpallet-sudo = { version = "28.0.0" , default-features = false }
|
||||||
pezpallet-timestamp = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-timestamp", default-features = false }
|
pezpallet-timestamp = { version = "27.0.0" , default-features = false }
|
||||||
pezpallet-transaction-payment = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-transaction-payment", default-features = false }
|
pezpallet-transaction-payment = { version = "28.0.0" , default-features = false }
|
||||||
pezpallet-transaction-payment-rpc = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-transaction-payment/rpc", default-features = false }
|
pezpallet-transaction-payment-rpc = { version = "30.0.0" }
|
||||||
pezpallet-transaction-payment-rpc-runtime-api = { path = "../pezkuwi-sdk/bizinikiwi/pezframe/pezpallet-transaction-payment/rpc/runtime-api", default-features = false }
|
pezpallet-transaction-payment-rpc-runtime-api = { version = "28.0.0" , default-features = false }
|
||||||
|
|
||||||
pezsc-basic-authorship = { path = "../pezkuwi-sdk/bizinikiwi/client/basic-authorship", default-features = false }
|
pezsc-basic-authorship = { version = "0.34.0" }
|
||||||
pezsc-cli = { path = "../pezkuwi-sdk/bizinikiwi/client/cli", default-features = false }
|
pezsc-cli = { version = "0.36.0" }
|
||||||
pezsc-client-api = { path = "../pezkuwi-sdk/bizinikiwi/client/api", default-features = false }
|
pezsc-client-api = { version = "28.0.0" }
|
||||||
pezsc-consensus = { path = "../pezkuwi-sdk/bizinikiwi/client/consensus/common", default-features = false }
|
pezsc-consensus = { version = "0.33.0" }
|
||||||
pezsc-consensus-aura = { path = "../pezkuwi-sdk/bizinikiwi/client/consensus/aura", default-features = false }
|
pezsc-consensus-aura = { version = "0.34.0" }
|
||||||
pezsc-consensus-grandpa = { path = "../pezkuwi-sdk/bizinikiwi/client/consensus/grandpa", default-features = false }
|
pezsc-consensus-grandpa = { version = "0.19.0" }
|
||||||
pezsc-executor = { path = "../pezkuwi-sdk/bizinikiwi/client/executor", default-features = false }
|
pezsc-executor = { version = "0.32.0" }
|
||||||
pezsc-network = { path = "../pezkuwi-sdk/bizinikiwi/client/network", default-features = false }
|
pezsc-network = { version = "0.34.0" }
|
||||||
pezsc-offchain = { path = "../pezkuwi-sdk/bizinikiwi/client/offchain", default-features = false }
|
pezsc-offchain = { version = "29.0.0" }
|
||||||
pezsc-service = { path = "../pezkuwi-sdk/bizinikiwi/client/service", default-features = false }
|
pezsc-service = { version = "0.35.0" }
|
||||||
pezsc-telemetry = { path = "../pezkuwi-sdk/bizinikiwi/client/telemetry", default-features = false }
|
pezsc-telemetry = { version = "15.0.0" }
|
||||||
pezsc-transaction-pool = { path = "../pezkuwi-sdk/bizinikiwi/client/transaction-pool", default-features = false }
|
pezsc-transaction-pool = { version = "28.0.0" }
|
||||||
pezsc-transaction-pool-api = { path = "../pezkuwi-sdk/bizinikiwi/client/transaction-pool/api", default-features = false }
|
pezsc-transaction-pool-api = { version = "28.0.0" }
|
||||||
|
|
||||||
pezsp-api = { path = "../pezkuwi-sdk/bizinikiwi/primitives/api", default-features = false }
|
pezsp-api = { version = "26.0.0" , default-features = false }
|
||||||
pezsp-block-builder = { path = "../pezkuwi-sdk/bizinikiwi/primitives/block-builder", default-features = false }
|
pezsp-block-builder = { version = "26.0.0" , default-features = false }
|
||||||
pezsp-blockchain = { path = "../pezkuwi-sdk/bizinikiwi/primitives/blockchain", default-features = false }
|
pezsp-blockchain = { version = "28.0.0" , default-features = false }
|
||||||
pezsp-consensus-aura = { path = "../pezkuwi-sdk/bizinikiwi/primitives/consensus/aura", default-features = false }
|
pezsp-consensus-aura = { version = "0.32.0" , default-features = false }
|
||||||
pezsp-consensus-grandpa = { path = "../pezkuwi-sdk/bizinikiwi/primitives/consensus/grandpa", default-features = false }
|
pezsp-consensus-grandpa = { version = "13.0.0" , default-features = false }
|
||||||
pezsp-core = { path = "../pezkuwi-sdk/bizinikiwi/primitives/core", default-features = false }
|
pezsp-core = { version = "28.0.0" , default-features = false }
|
||||||
pezsp-genesis-builder = { path = "../pezkuwi-sdk/bizinikiwi/primitives/genesis-builder", default-features = false }
|
pezsp-genesis-builder = { version = "0.8.0" , default-features = false }
|
||||||
pezsp-inherents = { path = "../pezkuwi-sdk/bizinikiwi/primitives/inherents", default-features = false }
|
pezsp-inherents = { version = "26.0.0" , default-features = false }
|
||||||
pezsp-io = { path = "../pezkuwi-sdk/bizinikiwi/primitives/io", default-features = false }
|
pezsp-io = { version = "30.0.0" , default-features = false }
|
||||||
pezsp-keyring = { path = "../pezkuwi-sdk/bizinikiwi/primitives/keyring", default-features = false }
|
pezsp-keyring = { version = "31.0.0" , default-features = false }
|
||||||
pezsp-offchain = { path = "../pezkuwi-sdk/bizinikiwi/primitives/offchain", default-features = false }
|
pezsp-offchain = { version = "26.0.0" , default-features = false }
|
||||||
pezsp-runtime = { path = "../pezkuwi-sdk/bizinikiwi/primitives/runtime", default-features = false }
|
pezsp-runtime = { version = "31.0.1" , default-features = false }
|
||||||
pezsp-session = { path = "../pezkuwi-sdk/bizinikiwi/primitives/session", default-features = false }
|
pezsp-session = { version = "27.0.0" , default-features = false }
|
||||||
pezsp-storage = { path = "../pezkuwi-sdk/bizinikiwi/primitives/storage", default-features = false }
|
pezsp-storage = { version = "19.0.0" , default-features = false }
|
||||||
pezsp-timestamp = { path = "../pezkuwi-sdk/bizinikiwi/primitives/timestamp", default-features = false }
|
pezsp-timestamp = { version = "26.0.0" , default-features = false }
|
||||||
pezsp-transaction-pool = { path = "../pezkuwi-sdk/bizinikiwi/primitives/transaction-pool", default-features = false }
|
pezsp-transaction-pool = { version = "26.0.0" , default-features = false }
|
||||||
pezsp-version = { path = "../pezkuwi-sdk/bizinikiwi/primitives/version", default-features = false }
|
pezsp-version = { version = "29.0.0" , default-features = false }
|
||||||
|
|
||||||
bizinikiwi-build-script-utils = { path = "../pezkuwi-sdk/bizinikiwi/utils/build-script-utils", default-features = false }
|
bizinikiwi-build-script-utils = { version = "11.0.0" }
|
||||||
bizinikiwi-frame-rpc-system = { path = "../pezkuwi-sdk/bizinikiwi/utils/pezframe/rpc/system", default-features = false }
|
bizinikiwi-frame-rpc-system = { version = "28.0.0" }
|
||||||
bizinikiwi-wasm-builder = { path = "../pezkuwi-sdk/bizinikiwi/utils/wasm-builder", default-features = false }
|
bizinikiwi-wasm-builder = { version = "17.0.0" }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|||||||
+10
-10
@@ -1,28 +1,28 @@
|
|||||||
FROM docker.io/paritytech/ci-unified:latest as builder
|
FROM docker.io/paritytech/ci-unified:latest as builder
|
||||||
|
|
||||||
WORKDIR /polkadot
|
WORKDIR /pezkuwi
|
||||||
COPY . /polkadot
|
COPY . /pezkuwi
|
||||||
|
|
||||||
RUN cargo fetch
|
RUN cargo fetch
|
||||||
RUN cargo build --locked --release
|
RUN cargo build --locked --release
|
||||||
|
|
||||||
FROM docker.io/parity/base-bin:latest
|
FROM docker.io/parity/base-bin:latest
|
||||||
|
|
||||||
COPY --from=builder /polkadot/target/release/solochain-template-node /usr/local/bin
|
COPY --from=builder /pezkuwi/target/release/pez-solochain-template-node /usr/local/bin
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
RUN useradd -m -u 1001 -U -s /bin/sh -d /polkadot polkadot && \
|
RUN useradd -m -u 1001 -U -s /bin/sh -d /pezkuwi pezkuwi && \
|
||||||
mkdir -p /data /polkadot/.local/share && \
|
mkdir -p /data /pezkuwi/.local/share && \
|
||||||
chown -R polkadot:polkadot /data && \
|
chown -R pezkuwi:pezkuwi /data && \
|
||||||
ln -s /data /polkadot/.local/share/polkadot && \
|
ln -s /data /pezkuwi/.local/share/pezkuwi && \
|
||||||
# unclutter and minimize the attack surface
|
# unclutter and minimize the attack surface
|
||||||
rm -rf /usr/bin /usr/sbin && \
|
rm -rf /usr/bin /usr/sbin && \
|
||||||
# check if executable works in this container
|
# check if executable works in this container
|
||||||
/usr/local/bin/solochain-template-node --version
|
/usr/local/bin/pez-solochain-template-node --version
|
||||||
|
|
||||||
USER polkadot
|
USER pezkuwi
|
||||||
|
|
||||||
EXPOSE 30333 9933 9944 9615
|
EXPOSE 30333 9933 9944 9615
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/local/bin/solochain-template-node"]
|
ENTRYPOINT ["/usr/local/bin/pez-solochain-template-node"]
|
||||||
@@ -1,232 +1,61 @@
|
|||||||
# Substrate Node Template
|
# Pezkuwi Solochain Template
|
||||||
|
|
||||||
A fresh [Substrate](https://substrate.io/) node, ready for hacking :rocket:
|
A minimal, ready-to-use solochain template built with the **Pezkuwi SDK**. This template provides a starting point for building custom blockchains (Solochains) within the Pezkuwi ecosystem using **Bizinikiwi** (our Substrate fork) and **Pezframe**.
|
||||||
|
|
||||||
A standalone version of this template is available for each release of Polkadot
|
## 🚀 Getting Started
|
||||||
in the [Substrate Developer Hub Parachain
|
|
||||||
Template](https://github.com/substrate-developer-hub/substrate-node-template/)
|
|
||||||
repository. The parachain template is generated directly at each Polkadot
|
|
||||||
release branch from the [Solochain Template in
|
|
||||||
Substrate](https://github.com/paritytech/polkadot-sdk/tree/master/templates/solochain)
|
|
||||||
upstream
|
|
||||||
|
|
||||||
It is usually best to use the stand-alone version to start a new project. All
|
Follow these steps to get started with the Pezkuwi Solochain Template:
|
||||||
bugs, suggestions, and feature requests should be made upstream in the
|
|
||||||
[Substrate](https://github.com/paritytech/polkadot-sdk/tree/master/substrate)
|
|
||||||
repository.
|
|
||||||
|
|
||||||
## Getting Started
|
### 1. Prerequisites
|
||||||
|
|
||||||
Depending on your operating system and Rust version, there might be additional
|
Ensure you have the following installed:
|
||||||
packages required to compile this template. Check the
|
- Rust (stable and nightly)
|
||||||
[Install](https://docs.substrate.io/install/) instructions for your platform for
|
- Clang and LLVM
|
||||||
the most common dependencies. Alternatively, you can use one of the [alternative
|
- Pezkuwi SDK environment (see [docs.pezkuwichain.io](https://docs.pezkuwichain.io))
|
||||||
installation](#alternatives-installations) options.
|
|
||||||
|
|
||||||
Fetch solochain template code:
|
### 2. Build
|
||||||
|
|
||||||
```sh
|
Build the node in release mode:
|
||||||
git clone https://github.com/paritytech/polkadot-sdk-solochain-template.git solochain-template
|
|
||||||
|
|
||||||
cd solochain-template
|
|
||||||
```
|
|
||||||
|
|
||||||
### Build
|
|
||||||
|
|
||||||
🔨 Use the following command to build the node without launching it:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cargo build --release
|
cargo build --release
|
||||||
```
|
```
|
||||||
|
|
||||||
### Embedded Docs
|
### 3. Run
|
||||||
|
|
||||||
After you build the project, you can use the following command to explore its
|
Run the temporary node in developer mode:
|
||||||
parameters and subcommands:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./target/release/solochain-template-node -h
|
./target/release/pez-solochain-template-node --dev
|
||||||
```
|
```
|
||||||
|
|
||||||
You can generate and view the [Rust
|
This command will:
|
||||||
Docs](https://doc.rust-lang.org/cargo/commands/cargo-doc.html) for this template
|
- Start a single-node development chain.
|
||||||
with this command:
|
- Keep the state in a temporary directory.
|
||||||
|
- Expose RPC and WebSocket ports.
|
||||||
|
|
||||||
```sh
|
## 🏗️ Structure
|
||||||
cargo +nightly doc --open
|
|
||||||
```
|
|
||||||
|
|
||||||
### Single-Node Development Chain
|
This repository is structured as follows:
|
||||||
|
|
||||||
The following command starts a single-node development chain that doesn't
|
- **`node/`**: The blockchain node logic (CLI, RPC, Service).
|
||||||
persist state:
|
- **`runtime/`**: The runtime logic, aggregating all pezpallets.
|
||||||
|
- **`pallets/`**: Custom runtime modules (Pezpallets).
|
||||||
|
- **`template/`**: A sample pezpallet demonstrating storage, events, and errors.
|
||||||
|
|
||||||
```sh
|
## 🛠️ Customization
|
||||||
./target/release/solochain-template-node --dev
|
|
||||||
```
|
|
||||||
|
|
||||||
To purge the development chain's state, run the following command:
|
To customize this template:
|
||||||
|
|
||||||
```sh
|
1. **Modify the Runtime:** Edit `runtime/src/lib.rs` to add or remove pezpallets.
|
||||||
./target/release/solochain-template-node purge-chain --dev
|
2. **Add Logic:** Modify `pallets/template/src/lib.rs` to implement your custom business logic.
|
||||||
```
|
3. **Chain Spec:** Update `node/src/chain_spec.rs` to define your chain's genesis state.
|
||||||
|
|
||||||
To start the development chain with detailed logging, run the following command:
|
## 📚 Documentation
|
||||||
|
|
||||||
```sh
|
- [Pezkuwi Documentation](https://docs.pezkuwichain.io)
|
||||||
RUST_BACKTRACE=1 ./target/release/solochain-template-node -ldebug --dev
|
- [Pezkuwi SDK Repository](https://github.com/pezkuwichain/pezkuwi-sdk)
|
||||||
```
|
|
||||||
|
|
||||||
Development chains:
|
## 📜 License
|
||||||
|
|
||||||
- Maintain state in a `tmp` folder while the node is running.
|
Unlicense
|
||||||
- Use the **Alice** and **Bob** accounts as default validator authorities.
|
|
||||||
- Use the **Alice** account as the default `sudo` account.
|
|
||||||
- Are preconfigured with a genesis state (`/node/src/chain_spec.rs`) that
|
|
||||||
includes several pre-funded development accounts.
|
|
||||||
|
|
||||||
|
|
||||||
To persist chain state between runs, specify a base path by running a command
|
|
||||||
similar to the following:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
// Create a folder to use as the db base path
|
|
||||||
$ mkdir my-chain-state
|
|
||||||
|
|
||||||
// Use of that folder to store the chain state
|
|
||||||
$ ./target/release/solochain-template-node --dev --base-path ./my-chain-state/
|
|
||||||
|
|
||||||
// Check the folder structure created inside the base path after running the chain
|
|
||||||
$ ls ./my-chain-state
|
|
||||||
chains
|
|
||||||
$ ls ./my-chain-state/chains/
|
|
||||||
dev
|
|
||||||
$ ls ./my-chain-state/chains/dev
|
|
||||||
db keystore network
|
|
||||||
```
|
|
||||||
|
|
||||||
### Connect with Polkadot-JS Apps Front-End
|
|
||||||
|
|
||||||
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](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
|
|
||||||
|
|
||||||
If you want to see the multi-node consensus algorithm in action, see [Simulate a
|
|
||||||
network](https://docs.substrate.io/tutorials/build-a-blockchain/simulate-network/).
|
|
||||||
|
|
||||||
## Template Structure
|
|
||||||
|
|
||||||
A Substrate project such as this consists of a number of components that are
|
|
||||||
spread across a few directories.
|
|
||||||
|
|
||||||
### Node
|
|
||||||
|
|
||||||
A blockchain node is an application that allows users to participate in a
|
|
||||||
blockchain network. Substrate-based blockchain nodes expose a number of
|
|
||||||
capabilities:
|
|
||||||
|
|
||||||
- Networking: Substrate nodes use the [`libp2p`](https://libp2p.io/) networking
|
|
||||||
stack to allow the nodes in the network to communicate with one another.
|
|
||||||
- Consensus: Blockchains must have a way to come to
|
|
||||||
[consensus](https://docs.substrate.io/fundamentals/consensus/) on the state of
|
|
||||||
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/Polkadot/protocols/NPoS).
|
|
||||||
- RPC Server: A remote procedure call (RPC) server is used to interact with
|
|
||||||
Substrate nodes.
|
|
||||||
|
|
||||||
There are several files in the `node` directory. Take special note of the
|
|
||||||
following:
|
|
||||||
|
|
||||||
- [`chain_spec.rs`](./node/src/chain_spec.rs): A [chain
|
|
||||||
specification](https://docs.substrate.io/build/chain-spec/) is a source code
|
|
||||||
file that defines a Substrate chain's initial (genesis) state. Chain
|
|
||||||
specifications are useful for development and testing, and critical when
|
|
||||||
architecting the launch of a production chain. Take note of the
|
|
||||||
`development_config` and `testnet_genesis` functions. These functions are
|
|
||||||
used to define the genesis state for the local development chain
|
|
||||||
configuration. These functions identify some [well-known
|
|
||||||
accounts](https://docs.substrate.io/reference/command-line-tools/subkey/) and
|
|
||||||
use them to configure the blockchain's initial state.
|
|
||||||
- [`service.rs`](./node/src/service.rs): This file defines the node
|
|
||||||
implementation. Take note of the libraries that this file imports and the
|
|
||||||
names of the functions it invokes. In particular, there are references to
|
|
||||||
consensus-related topics, such as the [block finalization and
|
|
||||||
forks](https://docs.substrate.io/fundamentals/consensus/#finalization-and-forks)
|
|
||||||
and other [consensus
|
|
||||||
mechanisms](https://docs.substrate.io/fundamentals/consensus/#default-consensus-models)
|
|
||||||
such as Aura for block authoring and GRANDPA for finality.
|
|
||||||
|
|
||||||
|
|
||||||
### Runtime
|
|
||||||
|
|
||||||
In Substrate, the terms "runtime" and "state transition function" are analogous.
|
|
||||||
Both terms refer to the core logic of the blockchain that is responsible for
|
|
||||||
validating blocks and executing the state changes they define. The Substrate
|
|
||||||
project in this repository uses
|
|
||||||
[FRAME](https://docs.substrate.io/learn/runtime-development/#frame) to construct
|
|
||||||
a blockchain runtime. FRAME allows runtime developers to declare domain-specific
|
|
||||||
logic in modules called "pallets". At the heart of FRAME is a helpful [macro
|
|
||||||
language](https://docs.substrate.io/reference/frame-macros/) that makes it easy
|
|
||||||
to create pallets and flexibly compose them to create blockchains that can
|
|
||||||
address [a variety of needs](https://substrate.io/ecosystem/projects/).
|
|
||||||
|
|
||||||
Review the [FRAME runtime implementation](./runtime/src/lib.rs) included in this
|
|
||||||
template and note the following:
|
|
||||||
|
|
||||||
- This file configures several pallets to include in the runtime. Each pallet
|
|
||||||
configuration is defined by a code block that begins with `impl
|
|
||||||
$PALLET_NAME::Config for Runtime`.
|
|
||||||
- The pallets are composed into a single runtime by way of the
|
|
||||||
[#[runtime]](https://paritytech.github.io/polkadot-sdk/master/frame_support/attr.runtime.html)
|
|
||||||
macro, which is part of the [core FRAME pallet
|
|
||||||
library](https://docs.substrate.io/reference/frame-pallets/#system-pallets).
|
|
||||||
|
|
||||||
### Pallets
|
|
||||||
|
|
||||||
The runtime in this project is constructed using many FRAME pallets that ship
|
|
||||||
with [the Substrate
|
|
||||||
repository](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame) and a
|
|
||||||
template pallet that is [defined in the
|
|
||||||
`pallets`](./pallets/template/src/lib.rs) directory.
|
|
||||||
|
|
||||||
A FRAME pallet is comprised of a number of blockchain primitives, including:
|
|
||||||
|
|
||||||
- Storage: FRAME defines a rich set of powerful [storage
|
|
||||||
abstractions](https://docs.substrate.io/build/runtime-storage/) that makes it
|
|
||||||
easy to use Substrate's efficient key-value database to manage the evolving
|
|
||||||
state of a blockchain.
|
|
||||||
- Dispatchables: FRAME pallets define special types of functions that can be
|
|
||||||
invoked (dispatched) from outside of the runtime in order to update its state.
|
|
||||||
- Events: Substrate uses
|
|
||||||
[events](https://docs.substrate.io/build/events-and-errors/) to notify users
|
|
||||||
of significant state changes.
|
|
||||||
- Errors: When a dispatchable fails, it returns an error.
|
|
||||||
|
|
||||||
Each pallet has its own `Config` trait which serves as a configuration interface
|
|
||||||
to generically define the types and parameters it depends on.
|
|
||||||
|
|
||||||
## Alternatives Installations
|
|
||||||
|
|
||||||
Instead of installing dependencies and building this source directly, consider
|
|
||||||
the following alternatives.
|
|
||||||
|
|
||||||
### Nix
|
|
||||||
|
|
||||||
Install [nix](https://nixos.org/) and
|
|
||||||
[nix-direnv](https://github.com/nix-community/nix-direnv) for a fully
|
|
||||||
plug-and-play experience for setting up the development environment. To get all
|
|
||||||
the correct dependencies, activate direnv `direnv allow`.
|
|
||||||
|
|
||||||
### Docker
|
|
||||||
|
|
||||||
Please follow the [Substrate Docker instructions
|
|
||||||
here](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/docker/README.md) to
|
|
||||||
build the Docker container with the Substrate Node Template binary.
|
|
||||||
+2
-1
@@ -51,7 +51,7 @@ pezsp-keyring = { workspace = true, default-features = true }
|
|||||||
pezsp-runtime = { workspace = true, default-features = true }
|
pezsp-runtime = { workspace = true, default-features = true }
|
||||||
pezsp-timestamp = { workspace = true, default-features = true }
|
pezsp-timestamp = { workspace = true, default-features = true }
|
||||||
|
|
||||||
# frame and pallets
|
# pezframe and pezpallets
|
||||||
bizinikiwi-frame-rpc-system = { workspace = true, default-features = true }
|
bizinikiwi-frame-rpc-system = { workspace = true, default-features = true }
|
||||||
pezframe-metadata-hash-extension = { workspace = true, default-features = true }
|
pezframe-metadata-hash-extension = { workspace = true, default-features = true }
|
||||||
pezframe-system = { workspace = true, default-features = true }
|
pezframe-system = { workspace = true, default-features = true }
|
||||||
@@ -75,6 +75,7 @@ runtime-benchmarks = [
|
|||||||
"bizinikiwi-frame-rpc-system/runtime-benchmarks",
|
"bizinikiwi-frame-rpc-system/runtime-benchmarks",
|
||||||
"pez-solochain-template-runtime/runtime-benchmarks",
|
"pez-solochain-template-runtime/runtime-benchmarks",
|
||||||
"pezframe-benchmarking-cli/runtime-benchmarks",
|
"pezframe-benchmarking-cli/runtime-benchmarks",
|
||||||
|
"pezframe-benchmarking-cli/storage-benchmark",
|
||||||
"pezframe-metadata-hash-extension/runtime-benchmarks",
|
"pezframe-metadata-hash-extension/runtime-benchmarks",
|
||||||
"pezframe-system/runtime-benchmarks",
|
"pezframe-system/runtime-benchmarks",
|
||||||
"pezpallet-transaction-payment-rpc/runtime-benchmarks",
|
"pezpallet-transaction-payment-rpc/runtime-benchmarks",
|
||||||
|
|||||||
+1
-5
@@ -131,11 +131,7 @@ pub fn run() -> pezsc_cli::Result<()> {
|
|||||||
let PartialComponents { client, .. } = service::new_partial(&config)?;
|
let PartialComponents { client, .. } = service::new_partial(&config)?;
|
||||||
cmd.run(client)
|
cmd.run(client)
|
||||||
},
|
},
|
||||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
|
||||||
BenchmarkCmd::Storage(_) => Err(
|
|
||||||
"Storage benchmarking can be enabled with `--features runtime-benchmarks`."
|
|
||||||
.into(),
|
|
||||||
),
|
|
||||||
#[cfg(feature = "runtime-benchmarks")]
|
#[cfg(feature = "runtime-benchmarks")]
|
||||||
BenchmarkCmd::Storage(cmd) => {
|
BenchmarkCmd::Storage(cmd) => {
|
||||||
let PartialComponents { client, backend, .. } =
|
let PartialComponents { client, backend, .. } =
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pezpallet-template"
|
name = "pezpallet-template"
|
||||||
description = "FRAME pezpallet template for defining custom runtime logic."
|
description = "Pezframe pezpallet template for defining custom runtime logic."
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
//! # Template Pezpallet
|
//! # Template Pezpallet
|
||||||
//!
|
//!
|
||||||
//! A pezpallet with minimal functionality to help developers understand the essential components of
|
//! A pezpallet with minimal functionality to help developers understand the essential components of
|
||||||
//! writing a FRAME pezpallet. It is typically used in beginner tutorials or in Bizinikiwi template
|
//! writing a PEZFRAME pezpallet. It is typically used in beginner tutorials or in Bizinikiwi template
|
||||||
//! nodes as a starting point for creating a new pezpallet and **not meant to be used in
|
//! nodes as a starting point for creating a new pezpallet and **not meant to be used in
|
||||||
//! production**.
|
//! production**.
|
||||||
//!
|
//!
|
||||||
@@ -16,10 +16,10 @@
|
|||||||
//! - another dispatchable function that causes a custom error to be thrown
|
//! - another dispatchable function that causes a custom error to be thrown
|
||||||
//!
|
//!
|
||||||
//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural
|
//! Each pezpallet section is annotated with an attribute using the `#[pezpallet::...]` procedural
|
||||||
//! macro. This macro generates the necessary code for a pezpallet to be aggregated into a FRAME
|
//! macro. This macro generates the necessary code for a pezpallet to be aggregated into a PEZFRAME
|
||||||
//! runtime.
|
//! runtime.
|
||||||
//!
|
//!
|
||||||
//! Learn more about FRAME macros [here](https://docs.pezkuwichain.io/reference/frame-macros/).
|
//! Learn more about PEZFRAME macros [here](https://docs.pezkuwichain.io/reference/frame-macros/).
|
||||||
//!
|
//!
|
||||||
//! ### Pezpallet Sections
|
//! ### Pezpallet Sections
|
||||||
//!
|
//!
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
// Re-export pezpallet items so that they can be accessed from the crate namespace.
|
// Re-export pezpallet items so that they can be accessed from the crate namespace.
|
||||||
pub use pezpallet::*;
|
pub use pezpallet::*;
|
||||||
|
|
||||||
// FRAME pallets require their own "mock runtimes" to be able to run unit tests. This module
|
// PEZFRAME pallets require their own "mock runtimes" to be able to run unit tests. This module
|
||||||
// contains a mock runtime specific for testing this pezpallet's functionality.
|
// contains a mock runtime specific for testing this pezpallet's functionality.
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod mock;
|
mod mock;
|
||||||
@@ -66,7 +66,7 @@ pub use weights::*;
|
|||||||
// attribute.
|
// attribute.
|
||||||
#[pezframe_support::pezpallet]
|
#[pezframe_support::pezpallet]
|
||||||
pub mod pezpallet {
|
pub mod pezpallet {
|
||||||
// Import various useful types required by all FRAME pallets.
|
// Import various useful types required by all PEZFRAME pallets.
|
||||||
use super::*;
|
use super::*;
|
||||||
use pezframe_support::pezpallet_prelude::*;
|
use pezframe_support::pezpallet_prelude::*;
|
||||||
use pezframe_system::pezpallet_prelude::*;
|
use pezframe_system::pezpallet_prelude::*;
|
||||||
@@ -101,7 +101,7 @@ pub mod pezpallet {
|
|||||||
/// Events that functions in this pezpallet can emit.
|
/// Events that functions in this pezpallet can emit.
|
||||||
///
|
///
|
||||||
/// Events are a simple means of indicating to the outside world (such as dApps, chain explorers
|
/// Events are a simple means of indicating to the outside world (such as dApps, chain explorers
|
||||||
/// or other users) that some notable update in the runtime has occurred. In a FRAME pezpallet,
|
/// or other users) that some notable update in the runtime has occurred. In a PEZFRAME pezpallet,
|
||||||
/// the documentation for each event field and its parameters is added to a node's metadata so
|
/// the documentation for each event field and its parameters is added to a node's metadata so
|
||||||
/// it can be used by external interfaces or tools.
|
/// it can be used by external interfaces or tools.
|
||||||
///
|
///
|
||||||
|
|||||||
+2
-2
@@ -23,14 +23,14 @@ serde_json = { workspace = true, default-features = false, features = [
|
|||||||
"alloc",
|
"alloc",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
# frame
|
# pezframe
|
||||||
pezframe-executive = { workspace = true }
|
pezframe-executive = { workspace = true }
|
||||||
pezframe-metadata-hash-extension = { workspace = true }
|
pezframe-metadata-hash-extension = { workspace = true }
|
||||||
pezframe-support = { features = ["experimental"], workspace = true }
|
pezframe-support = { features = ["experimental"], workspace = true }
|
||||||
pezframe-system = { workspace = true }
|
pezframe-system = { workspace = true }
|
||||||
pezframe-try-runtime = { optional = true, workspace = true }
|
pezframe-try-runtime = { optional = true, workspace = true }
|
||||||
|
|
||||||
# frame pallets
|
# pezframe pallets
|
||||||
pezpallet-aura = { workspace = true }
|
pezpallet-aura = { workspace = true }
|
||||||
pezpallet-balances = { workspace = true }
|
pezpallet-balances = { workspace = true }
|
||||||
pezpallet-grandpa = { workspace = true }
|
pezpallet-grandpa = { workspace = true }
|
||||||
|
|||||||
Reference in New Issue
Block a user