- Getting Started
- Rust Setup
- Single-Node Development Chain
- Run in Docker
- Migrating Octopus Appchain to Rococo Parachain
- Fork the Substrate Cumulus Node Parachain Template Repository
- Define Chain Specification Configuration
- Replace Parachain Template Runtime
- Move Octopus Application Pallets
- Move Octopus Application Pallets
Follow these steps to get started with the Node
First, complete the basic Rust setup instructions.
This command will start the single-node development chain with persistent state:
./target/debug/myriad \
--base-path .local \
--dev \
--alice \
--collator \
--force-authoring \
-- \
--execution wasm \
--dev
Purge the development chain's state:
./target/debug/myriad \
purge-chain \
--base-path .local \
--dev
Start the development chain with detailed logging:
RUST_LOG=debug RUST_BACKTRACE=1 ./target/debug/myriad \
./target/debug/myriad \
--base-path .local \
--dev \
--alice \
--collator \
--force-authoring \
-lruntime=debug \
-- \
--execution wasm \
--dev
First, install Docker and Docker Compose.
Then run the following command to start a single node development chain.
./.maintain/docker/create-network.sh
./.maintain/docker/start-docker-compose.sh
Step 1: Begin by forking a new repository based on the Substrate Cumulus Node Parachain Template.
- Action Required: Click the "Fork" button on the GitHub repository page to create a copy under your account.
Step 2: In order to configure your Substrate project, you need to define the Chain Specification Configuration. This configuration encompasses essential details about your blockchain. These details include:
- ID: A unique identifier for your blockchain.
- Name: The name of your blockchain.
- Chain Type: The type of blockchain (e.g., Parachain, Relay Chain).
- Chain Genesis: Information about the initial state of your blockchain, including privileged accounts, collator accounts, pre-funded accounts, and the parachain ID.
- Bootnodes: Addresses of nodes that can be used as entry points into your blockchain.
- Telemetry: Telemetry server details, if applicable.
- Protocol ID: The identifier for the network protocol.
- Fork ID: ID for specifying forks in the blockchain.
- Properties: Miscellaneous properties or settings.
- Extension: Any additional extensions or customizations.
It's important to configure the Chain Specification for the following contexts:
- Local Chain: Configuration for a local development environment.
- Development Chain: Configuration for a development environment.
- Rococo Chain: Configuration for integration with the Rococo testnet.
Step 3: Replace the default runtime of the Substrate Cumulus Node Parachain Template, which is known as parachain_template_runtime
, with the runtime of the Octopus application that you intend to migrate to the parachain.
- Action Required: Replace the runtime code files as needed to integrate the Octopus application runtime.
Step 4: Move the Octopus application's pallet code into the new parachain repository. Ensure that all pallets are placed within the pallets
folder of the repository.
- Action Required: Organize the Octopus application's pallet code files within the
pallets
directory of your new repository.
Substrate is a modular framework that enables you to create purpose-built blockchains by composing custom or pre-built components. This guide will walk you through the steps to use Docker for testing a Rust-based Substrate project.
-
Docker Installed: Ensure Docker is installed on your machine. If not, follow the official installation guide.
-
Docker Daemon Running: Ensure the Docker daemon is running.
-
Substrate Project: A directory containing your Substrate project.
Create a Dockerfile
in the root directory of your Substrate project with the following content:
# Use an official Rust base image
FROM rust:1.70.0
# Set the working directory inside the container
WORKDIR /usr/src/substrate_project
# Copy the entire project into the container
COPY . .
# Build the application
RUN cargo build
# Run tests on container startup
CMD ["cargo", "test"]
Navigate to your project's directory and build the Docker image:
cd /path/to/your/myriad-node-parachain
docker build -t substrate-test .
These steps provide a comprehensive guide for migrating Substrate project from an Octopus Appchain to a Rococo Parachain. Ensure that you follow each step carefully to successfully configure your Substrate-based parachain with the Octopus application runtime.
Feel free to reach out if you have any questions or need further assistance during this process.