Skip to main content

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

  1. Open Polkadot.js Apps
  2. Click the network selector (top-left)
  3. Select DevelopmentLocal Node
  4. Confirm connection to ws://127.0.0.1:9944

Verify Connection

Navigate to NetworkExplorer to see:

  • Block production
  • Finalized blocks
  • Recent events

First Transfer

Using Polkadot.js UI

  1. Go to AccountsTransfer
  2. Select Alice as sender
  3. Enter Bob as recipient
  4. Enter amount: 100
  5. Click Make Transfer
  6. 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

  1. Open MetaMask
  2. Add custom network:
FieldValue
Network NameOrbinum Dev
RPC URLhttp://127.0.0.1:9944
Chain ID1234 (check your node)
SymbolORB

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:

EventDescription
balances.TransferToken transfer
system.ExtrinsicSuccessTransaction succeeded
ethereum.ExecutedEVM transaction

Troubleshooting

IssueSolution
Connection refusedEnsure node is running on port 9944
MetaMask wrong chainCheck chain ID matches node config
Insufficient balanceUse dev accounts (Alice, Bob)
Transaction failedCheck gas limit and balance

Next Steps