Build. One endpoint, plain JSON
Read blocks and accounts, ask the node for the text of a transfer, sign it with any ed25519 key, and send it. No SDK needed.
- 01Solana keys
ed25519 keys, base58 addresses. Any Solana keypair works.
- 02Readable transactions
A transaction is a short text. What you sign is what you read.
- 03Checkable blocks
Each block carries its hash, its roots and the validator's signature.
- 04Run it yourself
The node is one Node.js program with no dependencies.
Connecting…
# The state of the chain $ curl https://YOUR-DOMAIN/api/chain \ -H "content-type: application/json" \ -d '{"method": "heli_chainInfo"}' # A block, an account, a transaction {"method": "heli_getBlock", "params": {"height": 1}} {"method": "heli_getAccount", "params": {"address": "..."}} {"method": "heli_getTransaction", "params": {"hash": "..."}}
// 1. ask the node for the text of the transfer const { message } = await call("heli_buildTransfer", { from, to, amount: "2.5", memo: "gm", }); // 2. sign that text with the wallet (ed25519) const { signature } = await wallet.signMessage( new TextEncoder().encode(message), "utf8"); // 3. send both; the signature goes in base64 const { hash } = await call("heli_sendTransaction", { message, signature: btoa(String.fromCharCode(...signature)), });
# Node.js 18 or newer, nothing to install $ node chain/server.js # It creates its own genesis and keys in ./chain-data, # produces a block every 4 seconds and serves JSON-RPC # on port 8899. Every start replays the whole log and # checks each hash, signature and balance. $ curl localhost:8899 -H "content-type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"heli_chainInfo"}'
This is the text a wallet signs for a transfer of 2.5 HELI: seven lines, eight with a memo. The node refuses anything not written exactly this way.
HeliChain transaction Chain: heli-testnet-1 From: <your address> To: <their address> Amount: 2.5 HELI Fee: 0.001 HELI Nonce: 0 Memo: gm