Quick Start
Get started with Orbinum in 5 minutes. This guide walks you through your first transactions.
Table of Contents
Start a Node
Start a development node:
./target/release/orbinum-node --dev --tmp
Wait for blocks to be produced:
🏁 Block #1 (0x1234...)
🏁 Block #2 (0x5678...)
Connect Polkadot.js
Using Polkadot.js Apps
- Open Polkadot.js Apps
- Click the network selector (top-left)
- Select Development → Local Node
- Confirm connection to
ws://127.0.0.1:9944
Verify Connection
Navigate to Network → Explorer to see:
- Block production
- Finalized blocks
- Recent events
First Transfer
Using Polkadot.js UI
- Go to Accounts → Transfer
- Select Alice as sender
- Enter Bob as recipient
- Enter amount:
100 - Click Make Transfer
- Sign and submit
Using JavaScript
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api');
async function transfer() {
// Connect to node
const wsProvider = new WsProvider('ws://127.0.0.1:9944');
const api = await ApiPromise.create({ provider: wsProvider });
// Create keyring and add Alice
const keyring = new Keyring({ type: 'sr25519' });
const alice = keyring.addFromUri('//Alice');
// Get Bob's address
const bob = keyring.addFromUri('//Bob').address;
// Create transfer
const transfer = api.tx.balances.transferKeepAlive(bob, 100_000_000_000_000n);
// Sign and send
const hash = await transfer.signAndSend(alice);
console.log('Transfer sent with hash:', hash.toHex());
await api.disconnect();
}
transfer().catch(console.error);
EVM Transaction
Connect MetaMask
- Open MetaMask
- Add custom network:
| Field | Value |
|---|---|
| Network Name | Orbinum Dev |
| RPC URL | http://127.0.0.1:9944 |
| Chain ID | 1234 (check your node) |
| Symbol | ORB |
Import Development Account
Import Alice's Ethereum-compatible key:
Private Key: 0x... (derived from //Alice)
Deploy Contract
Using Hardhat:
// contracts/HelloWorld.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract HelloWorld {
string public message = "Hello, Orbinum!";
function setMessage(string memory _message) public {
message = _message;
}
}
Deploy script:
const { ethers } = require('hardhat');
async function main() {
const HelloWorld = await ethers.getContractFactory('HelloWorld');
const hello = await HelloWorld.deploy();
await hello.waitForDeployment();
console.log('Deployed to:', await hello.getAddress());
console.log('Message:', await hello.message());
}
main().catch(console.error);
Run:
npx hardhat run scripts/deploy.js --network orbinum
Query Balances
Substrate Balance
const balance = await api.query.system.account(alice.address);
console.log('Free balance:', balance.data.free.toString());
EVM Balance
const { ethers } = require('ethers');
const provider = new ethers.JsonRpcProvider('http://127.0.0.1:9944');
const balance = await provider.getBalance('0x...');
console.log('Balance:', ethers.formatEther(balance));
Explore Blocks
Get Block Info
// Latest block
const block = await api.rpc.chain.getBlock();
console.log('Block number:', block.block.header.number.toNumber());
// Specific block
const blockHash = await api.rpc.chain.getBlockHash(1);
const block1 = await api.rpc.chain.getBlock(blockHash);
Subscribe to New Blocks
const unsubscribe = await api.rpc.chain.subscribeNewHeads((header) => {
console.log(`New block #${header.number}`);
});
// Later: unsubscribe();
Check Events
// Subscribe to events
api.query.system.events((events) => {
events.forEach(({ event }) => {
console.log(`${event.section}.${event.method}`);
});
});
Common events:
| Event | Description |
|---|---|
balances.Transfer | Token transfer |
system.ExtrinsicSuccess | Transaction succeeded |
ethereum.Executed | EVM transaction |
Troubleshooting
| Issue | Solution |
|---|---|
| Connection refused | Ensure node is running on port 9944 |
| MetaMask wrong chain | Check chain ID matches node config |
| Insufficient balance | Use dev accounts (Alice, Bob) |
| Transaction failed | Check gas limit and balance |
Next Steps
- Wallet CLI - Privacy transactions
- Architecture - System design