A simple guide to getting started with rpcX from Ellipsis Labs.
See the Atlas documentation for a step-by-step guide to using this repo.
You will need to install the latest version of the atlas-rpcx CLI from the Atlas release repo. Currently only Linux and MacOS are supported.
Setup Rust to properly develop rpcX packages:
cargo install cargo-component
rustup target add wasm32-wasip1Ensure you have at least rustc version 1.81.0 installed.
It is recommended that the sample program be built with solana-cli version 2.0.24. To build the program, run:
cd program
cargo build-sbfThis should create a target/deploy directory containing the compiled program binary.
Make sure there's a generated program ID keypair in the target/deploy directory.
$ echo $(solana-keygen pubkey target/deploy/rpcx_hello_world_program-keypair.json)To deploy the program, ensure you have a funded local Atlas testnet keypair and run:
solana program deploy --use-rpc <PATH_TO_PROGRAM_BINARY> --url <RPC_URL>Run the following command to interact with the hello world program:
$ cargo run -- --program-id <PROGRAM_ID>
Transaction confirmed: 5Dq9Nc2gHpUTQ6EyP8w7HG53p5E8sG2qSiH1htY7NZvByzYNTPtd4c3bZck4kXteL8CgGwAwKb3JEy69r415r8gKYou may also provide the arguments --payer <PAYER_KEYPAIR_PATH> and --rpc-url <RPC_URL> to use a non-default payer or RPC URL.
Run the following command to build the rpcX package:
$ cargo component build --release --manifest-path rpcx-package/Cargo.tomlExpected output:
Creating component rpcx-package/target/wasm32-wasip1/release/rpcx_package.wasm
To test a local rpcX package use the atlas-rpcx CLI tool's simulate command:
$ atlas-rpcx simulate --helpTo deploy the rpcX package from the root directory:
$ atlas-rpcx registry deploy $(target/deploy/rpcx_hello_world_program-keypair.json) rpcx-package/target/wasm32-wasip1/release/rpcx_package.wasm --url https://testnet.atlas.xyzTo interact with a deployed rpcX package use the atlas-rpcx CLI tool's query and pubsub commands:
$ atlas-rpcx query --help
$ atlas-rpcx pubsub --help