Get started
Learn how to set up the development enviornment and deploy smart contracts on Peony.
1. Install development tools
Install Rust and the WebAssembly compilation target:
# Install Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Add WebAssembly target
rustup target add wasm32-unknown-unknown
rustup component add rust-src
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Add WebAssembly target
rustup target add wasm32-unknown-unknown
rustup component add rust-src
2. Run a local development node
Clone and run a local Peony node for development:
# Clone the node repository
git clone https://github.com/peonychain/peony-node
cd peony-node
# Build and run in development mode
cargo build --release
./target/release/peony-node --dev
git clone https://github.com/peonychain/peony-node
cd peony-node
# Build and run in development mode
cargo build --release
./target/release/peony-node --dev
3. Develop smart contracts with ink!
Install cargo-contract and create an ink! smart contract:
# Install cargo-contract toolchain
cargo install cargo-contract --force
# Create a new contract
cargo contract new flipper
cd flipper
# Build the contract
cargo contract build
# Upload to local node
cargo contract upload --suri //Alice
cargo install cargo-contract --force
# Create a new contract
cargo contract new flipper
cd flipper
# Build the contract
cargo contract build
# Upload to local node
cargo contract upload --suri //Alice
4. Interact with runtime pallets
Smart contracts can interact with Peony's runtime pallets:
- Call runtime functions using chain extensions
- Query on-chain state from your contracts
- Integrate with XCM for cross-chain functionality
- Access native token balances and transfers
5. Additional resources
Learn more about developing on Peony: