Docs Reference
Programs on Acrux
Every program on Acrux Net at its address, when it arrived, and the SDK that drives it. Solana's token and memo programs run at their mainnet addresses, so their own SDKs work with only the RPC URL changed.
Solana's own programs run on Acrux at the addresses they hold on Solana mainnet, so a client built for them finds them where it already looks. Point the client's Connection at https://rpc.acrux.computer and nothing else changes: the same SDK builds the same instructions for the same program IDs.
Solana programs at their mainnet addresses
| Program | Address | On Acrux since | Driven by |
|---|---|---|---|
| SPL Token | TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA | genesis | @solana/spl-token, TOKEN_PROGRAM_ID |
| Token-2022 | TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb | genesis | @solana/spl-token, TOKEN_2022_PROGRAM_ID |
| Associated Token Account | ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL | genesis | @solana/spl-token, ASSOCIATED_TOKEN_PROGRAM_ID |
| Memo v3 | MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr | genesis | a TransactionInstruction from @solana/web3.js |
| Memo v1 | Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo | genesis | a TransactionInstruction from @solana/web3.js |
| Memo | Memo4c2pN8afCj432Lb7RMVKi9PbQnnW7ewFFaV3oAH | slot 1,100,000 | @solana/spl-memo, createMemoInstruction |
| Raydium CPMM | CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C | slot 1,100,000 | @raydium-io/raydium-sdk-v2, raydium.cpmm |
A program placed at a slot is written into the state by every validator and every follower from the first slot executed at or after it, the way Solana adds programs at fixed addresses, so getAccountInfo of its address answers null before that slot and an account owned by BPFLoaderUpgradeab1e11111111111111111111111 after it. Each placed program is the program Solana mainnet runs, taken with the accounts it needs: Raydium CPMM comes with its 25 fee tiers (its AmmConfig accounts, as on mainnet) and its pool-creation fee receiver. A placed program carries no upgrade authority on Acrux, so no one upgrades it.
Token-2022's extensions run as they do on Solana: a mint with a transfer fee withholds the fee in the recipient's account. getTransaction with jsonParsed parses their instructions, and the token reads (getTokenAccountsByOwner, getTokenAccountBalance, getTokenSupply) serve SPL Token and Token-2022 accounts alike (Solana programs and tools).
Acrux's own programs
| Program | Address | On Acrux since | Driven by |
|---|---|---|---|
| Hub Registry | ABjgHL8TcjxUjx6vfwsVQyvxiXR6pFgMkeESgwK6CbDm | genesis | its IDL, the acrux hub commands and /hubs/register (Hub Registry program) |
| Demo pool | CUBR9LNdTwxwp5ARBQj1EopfuH8dr8u4i7DsXcb8HbHN | genesis | swap between the faucet's AXA and AXB, from /send (getDemoPool, getQuote) |
Programs anyone deploys run beside these at their own addresses (Deploy a program).
Drive them with their own SDK
A mint, the two token accounts, a mint to one of them and a transfer, with @solana/spl-token as on Solana:
import { Connection, Keypair } from '@solana/web3.js'
import { createMint, getOrCreateAssociatedTokenAccount, mintTo, transferChecked } from '@solana/spl-token'
const connection = new Connection('https://rpc.acrux.computer', 'confirmed')
const payer = Keypair.generate() // funded from the faucet, see Endpoints and limits
const recipient = Keypair.generate().publicKey
const mint = await createMint(connection, payer, payer.publicKey, null, 6)
const from = await getOrCreateAssociatedTokenAccount(connection, payer, mint, payer.publicKey)
const to = await getOrCreateAssociatedTokenAccount(connection, payer, mint, recipient)
await mintTo(connection, payer, mint, from.address, payer, 1_000_000_000)
await transferChecked(connection, payer, from.address, mint, to.address, payer, 250_000_000, 6)For Token-2022, pass TOKEN_2022_PROGRAM_ID as the program ID argument of the same calls. A memo is one instruction to Memo v3, signed by the accounts it names:
import { PublicKey, Transaction, TransactionInstruction, sendAndConfirmTransaction } from '@solana/web3.js'
const MEMO = new PublicKey('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr')
const memo = new TransactionInstruction({
programId: MEMO,
keys: [{ pubkey: payer.publicKey, isSigner: true, isWritable: false }],
data: Buffer.from('gm from Acrux'),
})
await sendAndConfirmTransaction(connection, new Transaction().add(memo), [payer])The memo shows in the transaction's logs as Memo (len 13): "gm from Acrux".
The whole check, SPL Token, the Associated Token Account program, a Token-2022 mint with a 1% transfer fee and both memo versions, is sdk/test/step7-spl.mjs in the source download. In its sdk folder, after npm install:
node test/step7-spl.mjs https://rpc.acrux.computer https://api.acrux.computer/v1/faucetIt funds a fresh key from the faucet, prints one line per program call with its signature, and ends with SPL Token, Token-2022, Associated Token Account and Memo v1 and v3 ran at their mainnet addresses. It stops with the reason if a balance or a withheld fee is not what the program should leave.
The placed programs have their own check, sdk/test/step7-placements.mjs in the same folder:
node test/step7-placements.mjs https://rpc.acrux.computer https://api.acrux.computer/v1/faucetIt writes a memo through @solana/spl-memo to Memo4c2p…, makes two SPL tokens, creates a Raydium CPMM pool for them on the first fee tier through @raydium-io/raydium-sdk-v2, and swaps 1,000 of the first through it. It prints one line per call with its signature, the swap's output beside the SDK's quote, and ends with Memo4c2p and Raydium CPMM ran at their mainnet addresses, each through its own SDK. Creating the pool pays its fee tier's creation fee, 0.15 ACRUX on the first; a keypair file holding about 0.5 ACRUX, given as a third argument, stands in for the faucet.