@selendrajs/cli
v1.0.1
Published
Command-line interface for Selendra blockchain development
Readme
Selendra CLI
Command-line interface for Selendra blockchain development.
Installation
From npm (Coming Soon)
npm install -g @selendrajs/cliFrom Source
cd packages/cli
npm install
npm run build
npm linkAs part of SDK workspace
# From selendra-sdk root
npm install
npm run buildUsage
Project Commands
Initialize Project
# Create new EVM project (Solidity + Hardhat)
selendra init my-dapp
# Create WASM project (ink! + cargo-contract)
selendra init my-contract --template wasmCompile Contracts
# Auto-detect and compile
selendra compile
# Compile EVM contracts
selendra compile --target evm
# Compile WASM contracts
selendra compile --target wasmDeploy Contracts
# Interactive deployment
selendra deploy MyToken
# Deploy to specific network
selendra deploy MyToken --network testnet
# Deploy with constructor args
selendra deploy MyToken --network testnet --args '["MyToken", "MTK"]'Network Commands
Check Network Status
# Mainnet status
selendra status
# Testnet status
selendra status --network testnet
# JSON output
selendra status --jsonChain Information
# Get chain info
selendra chain
# Get specific block
selendra block 1000
# Latest block
selendra blockAccount Commands
Create Account
# Create new EVM account
selendra account new
# Create Substrate account
selendra account new-substrate
# List accounts (coming soon)
selendra account listCheck Balance
# Check balance on mainnet
selendra balance 0x742d35Cc6634C0532925a3b844Bc9e7595f3f4A
# Check balance on testnet
selendra balance 0x742d35Cc6634C0532925a3b844Bc9e7595f3f4A --network testnet
# JSON output
selendra balance 0x742d35Cc6634C0532925a3b844Bc9e7595f3f4A --jsonTransfer Tokens
# Interactive transfer
selendra transfer 0xRecipientAddress
# With amount specified
selendra transfer 0xRecipientAddress --amount 10 --network testnetRequest Testnet Tokens
selendra faucet 0x742d35Cc6634C0532925a3b844Bc9e7595f3f4AStaking Commands
Staking Info
# View staking overview
selendra stake info
# List available pools
selendra stake pools
# Join a pool (coming soon)
selendra stake join --pool 1 --amount 100
# Claim rewards (coming soon)
selendra stake claim
# Unbond from pool (coming soon)
selendra stake unbondEnvironment Variables
Set these in your .env file or export them:
# Required for transactions
PRIVATE_KEY=your_private_key
# or
SELENDRA_PRIVATE_KEY=your_private_keyNetworks
| Network | Chain ID | RPC | | ------- | -------- | -------------------------------- | | Mainnet | 1961 | https://rpc.selendra.org | | Testnet | 1953 | https://rpc-testnet.selendra.org | | Local | 31337 | http://127.0.0.1:9944 |
Command Reference
selendra <command> [options]
Commands:
init <name> Initialize a new Selendra project
compile Compile smart contracts
deploy <contract> Deploy smart contract
status Show network status
chain Show chain information
block [number] Show block information
account [action] Manage accounts (new|new-substrate|list)
balance <address> Check account balance
transfer <to> Transfer SEL tokens
faucet <address> Request testnet tokens
stake [action] Staking operations (info|pools|join|claim|unbond)
Global Options:
-n, --network <network> Network to use (mainnet|testnet|local)
--json Output as JSON (where supported)
-h, --help Display help
-V, --version Display versionIntegration with Selendra SDK
This CLI is part of the @selendrajs/sdk monorepo and uses @selendrajs/sdk for blockchain interactions.
// The CLI uses the SDK internally
import { SelendraClient } from "@selendrajs/sdk";Development
# Install dependencies
npm install
# Run in development mode
npm run dev -- status --network testnet
# Build
npm run build
# Run tests
npm test
# Link globally for testing
npm link
selendra --helpLicense
MIT
