Docs Build
Deploy a program
Deploy a Solana program to Acrux with the stock solana CLI or Anchor, show it, call it from web3.js, and run an Anchor test suite. The upgradeable loader, --use-rpc, funding the deploy, and what runs on the SVM.
A Solana program deploys to Acrux the way it deploys to Solana: the stock solana CLI writes it through the upgradeable loader, and from the next slot any transaction can call it. The binary is the same SBF file you build for Solana.
Point the CLI at Acrux
Terminalsolana config set --url https://rpc.acrux.computer solana addresssolana addressprints the default keypair's address, the one that pays for the deploy and holds its upgrade authority.Fund the deployer
A deploy pays the program's rent and a fee for each buffer write, in ACRUX. Ask the faucet for the address
solana addressprinted, then check what the program will hold:Terminalsolana balance solana rent <SIZE_OF_PROGRAM_SO_IN_BYTES>During the deploy the buffer holds a copy of the program beside the program data, so the deployer needs about twice what
solana rentprints for the.so, plus the fees. The CLI refuses the deploy with the amount it needs when the balance is short. A small program such as thehelloexample below fits within one faucet grant of 2 ACRUX.Deploy
Terminalsolana program deploy --use-rpc target/deploy/<program>.so--use-rpcsends every buffer write throughsendTransaction. Acrux has no TPU port, so a deploy without it does not reach the chain. Once the program is deployed the CLI printsProgram Id: <PROGRAM_ID>andSignature: <SIGNATURE>. A program's keypair intarget/deploy/<program>-keypair.jsonsets its address, as on Solana;--program-idnames another.Show it
Terminalsolana program show <PROGRAM_ID>prints the program as Solana's CLI does:
Line Meaning OwnerBPFLoaderUpgradeab1e11111111111111111111111, the upgradeable loaderProgramData Addressthe account that holds the program's code Authoritythe deployer, which can upgrade it Last Deployed In Slotthe slot the deploy landed in Data Lengththe program's size in bytes Balancethe program data's rent, in ACRUX; the CLI names the native unit SOL Call it
call.tsimport { readFileSync } from 'node:fs' import { Connection, Keypair, PublicKey, Transaction, TransactionInstruction, sendAndConfirmTransaction } from '@solana/web3.js' const connection = new Connection('https://rpc.acrux.computer', 'confirmed') const payer = Keypair.fromSecretKey(Uint8Array.from(JSON.parse(readFileSync('keypair.json', 'utf8')))) const tx = new Transaction().add( new TransactionInstruction({ programId: new PublicKey('<PROGRAM_ID>'), keys: [], data: Buffer.from('gm, Acrux') }), ) const signature = await sendAndConfirmTransaction(connection, tx, [payer], { commitment: 'confirmed' }) const { meta } = await connection.getTransaction(signature, { commitment: 'confirmed', maxSupportedTransactionVersion: 0 }) console.log(meta.logMessages)The program's logs come back in
meta.logMessages. Thehelloexample logsHello from Acrux: program <PROGRAM_ID>,called with "gm, Acrux"andslot <SLOT>, then the runtime'sconsumed <N> of 200000 compute unitsandsuccess. The signature opens the transaction's trail athttps://acrux.computer/tx/<SIGNATURE>.
A program to try
The source download carries one in chain/examples/hello. It logs a greeting with its program ID, the instruction data it was called with, and the slot it ran in, which the call above prints.
cd acrux-0.4.5-src/chain/examples/hello
cargo build-sbf --arch v0
solana program deploy --use-rpc target/deploy/hello.soBuild for SBF v0, the target Solana mainnet runs: newer platform tools default to v3, which neither chain runs.
Anchor
An Anchor workspace deploys and runs its own test suite against Acrux with only the provider's cluster changed. Checked with Anchor 0.31.
Build for SBF v0
Terminalanchor build -- --arch v0Deploy
Terminalanchor deploy --provider.cluster https://rpc.acrux.computer -- --use-rpcEverything after
--goes tosolana program deploy, so--use-rpcsends the buffer writes throughsendTransaction, as above. The provider's wallet pays, so fund its address from the faucet first.Run the suite
Terminalanchor test --skip-local-validator --skip-deploy --provider.cluster https://rpc.acrux.computerThe suite runs against the program you deployed, and exits on its own when it is done. Its
.rpc()calls confirm through Solana's PubSub on Acrux (Solana PubSub).
On Windows, Anchor hands its test script to WSL's bash. Run the workspace's test command yourself instead, with the provider set in the environment, from Git Bash:
ANCHOR_PROVIDER_URL=https://rpc.acrux.computer ANCHOR_WALLET=<path/to/wallet.json> \
yarn run ts-mocha -p ./tsconfig.json -t 1000000 "tests/**/*.ts"The source download carries a workspace to try in chain/examples/counter: a counter anyone creates and increments, with a suite that creates one at zero, increments it three times and checks that another signer is refused. It holds about 1.3 ACRUX of rent once deployed, so its deployer takes two faucet grants.
What runs
| Loader | the upgradeable loader, BPF Loader v3, as on Solana mainnet |
| Calls | a transaction may call any program on the chain (Programs on Acrux); one that calls an account that is not a program fails at execution and pays its fees |
| Features | every SVM feature Solana mainnet runs; loader v4 is not active, nor the end of new loader v3 deployments, as on mainnet |
| Compute budget | SetComputeUnitLimit, SetComputeUnitPrice, RequestHeapFrame and SetLoadedAccountsDataSizeLimit |
| Closed accounts | an account a transaction leaves with no lamports no longer exists, as on Solana, so its address can be created again; a deploy closes its buffer this way |
A deploy sends a few hundred buffer writes at once, within the submit limit. They all write the one buffer, so the merge places only some of them in each slot (Ordering and selection); the rest go back to their proposer and land in the next slots, and none is recorded as failed.
On a net you run, a program can also be loaded at a fixed address before the first slot (Load a program).