Selendra

Documentation

Development Environment Setup

Configure your environment for Selendra blockchain development

Set up your development environment for building on Selendra.

Prerequisites

Required:

  • Node.js 18.0+ and npm
  • Git
  • MetaMask

For WASM:

  • Rust 1.79.0
  • cargo-contract
node --version   # v18.0.0+
git --version    # 2.20.0+

MetaMask Setup

Mainnet

FieldValue
Network NameSelendra Mainnet
RPC URLhttps://rpc.selendra.org
Chain ID1961
SymbolSEL
Explorerhttps://explorer.selendra.org

Programmatic:

await window.ethereum.request({
  method: "wallet_addEthereumChain",
  params: [
    {
      chainId: "0x7a9",
      chainName: "Selendra Mainnet",
      rpcUrls: ["https://rpc.selendra.org"],
      nativeCurrency: { name: "Selendra", symbol: "SEL", decimals: 18 },
      blockExplorerUrls: ["https://explorer.selendra.org"],
    },
  ],
});

EVM Setup (Hardhat)

mkdir my-project && cd my-project
npm init -y
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox dotenv
npx hardhat init

hardhat.config.js:

require("dotenv").config();
require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.19",
  networks: {
    selendra: {
      url: "https://rpc.selendra.org",
      chainId: 1961,
      accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
    },
  },
};

.env:

PRIVATE_KEY=your_private_key_here

Test:

npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.js --network selendra

WASM Setup (ink!)

# Install Rust 1.79.0
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default 1.79.0
rustup target add wasm32-unknown-unknown
rustup component add rustfmt clippy rust-src

# Install cargo-contract
cargo install cargo-contract --version 3.2.0
cargo contract --version

# Create project
cargo contract new my-contract
cd my-contract
cargo contract build
cargo test

Quick Start Options

curl -L https://docs.selendra.org/docs/getting-started/docker/docker-compose.dev.yml -o docker-compose.dev.yml
curl -L https://docs.selendra.org/docs/getting-started/docker/Makefile -o Makefile
curl -L https://docs.selendra.org/docs/getting-started/docker/download-binary.sh -o download-binary.sh
chmod +x download-binary.sh

make download && make dev

Endpoints:

  • WebSocket: ws://localhost:9944
  • HTTP: http://localhost:9933
  • Chain ID: 1961

Commands:

make dev    # Start node
make logs   # View logs
make stop   # Stop node
make clean  # Remove all data

Option 2: Pre-built Binaries

Download from https://github.com/selendra/selendra/releases

Platform:

  • Linux: selendra-linux-x64.tar.gz
  • macOS: selendra-macos-x64.tar.gz
  • Windows: selendra-windows-x64.zip

Quick Scripts:

# Linux/Mac
curl -fsSL https://docs.selendra.org/docs/getting-started/scripts/quick-install.sh | bash

# Windows
iwr -useb https://docs.selendra.org/docs/getting-started/scripts/quick-install.ps1 | Out-File quick-install.ps1
.\quick-install.ps1

Option 3: Build from Source

git clone https://github.com/selendra/selendra.git
cd selendra
cargo build --release
./target/release/selendra-node --dev --tmp

Local Node Setup

Run:

./target/release/selendra-node --dev --tmp

MetaMask Config:

{
  "chainId": "0x7a9",
  "chainName": "Selendra Local",
  "rpcUrls": ["http://localhost:9944"],
  "nativeCurrency": { "name": "Selendra", "symbol": "SEL", "decimals": 18 }
}

Hardhat Config:

module.exports = {
  networks: {
    local: {
      url: "http://localhost:9944",
      chainId: 1961,
      accounts: {
        mnemonic:
          "bottom drive obey lake curtain smoke basket hold race lonely fit walk",
      },
    },
  },
};

VS Code Extensions

EVM:

  • JuanBlanco.solidity - Solidity syntax
  • NomicFoundation.hardhat-solidity - Hardhat integration

WASM:

  • rust-lang.rust-analyzer - Rust language server
  • vadimcn.vscode-lldb - Rust debugging

General:

  • esbenp.prettier-vscode - Code formatting

Testing Setup

EVM:

npx hardhat test

WASM:

cargo test

Local Node:

curl -X POST -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
  http://localhost:9944
# Expected: {"jsonrpc":"2.0","result":"0x7a9","id":1}

Troubleshooting

IssueSolution
Rust version mismatchrustup default 1.79.0
Missing protobufUbuntu: sudo apt install protobuf-compiler
macOS: brew install protobuf
RPC not respondingVerify URL, test with curl
Port in useUse --rpc-port 9945 --ws-port 9946
Database corruptionUse --tmp flag

Next Steps


Help: GitHub Issues | Explorer

Contribute

Found an issue or want to contribute?

Help us improve this documentation by editing this page on GitHub.

Edit this page on GitHub