https://github.com/Ellipsis-Labs/rpcx-hello-world
https://github.com/Ellipsis-Labs/rpcx-hello-world
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/Ellipsis-Labs/rpcx-hello-world
- Owner: Ellipsis-Labs
- Created: 2025-02-03T14:39:32.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-02-04T21:37:18.000Z (9 months ago)
- Last Synced: 2025-02-05T20:47:44.248Z (9 months ago)
- Language: Rust
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-svm - GitHub
README
# rpcX Hello World Program
A simple guide to getting started with rpcX from Ellipsis Labs.
See the [Atlas documentation](https://docs.atlas.xyz/rpc/rpcx/tutorial/custom) for a step-by-step guide to using this repo.
## Setup
You will need to install the latest version of the `atlas-rpcx` CLI from the [Atlas release repo](https://github.com/Ellipsis-Labs/atlas-release/releases). Currently only Linux and MacOS are supported.
Setup Rust to properly develop rpcX packages:
```shell
cargo install cargo-component
rustup target add wasm32-wasip1
```
Ensure you have at least `rustc` version `1.81.0` installed.
### Program
It is recommended that the sample program be built with `solana-cli` version `2.0.24`. To build the program, run:
```shell
cd program
cargo build-sbf
```
This 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.
```shell
$ 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:
```shell
solana program deploy --use-rpc --url
```
### Script
Run the following command to interact with the hello world program:
```shell
$ cargo run -- --program-id
Transaction confirmed: 5Dq9Nc2gHpUTQ6EyP8w7HG53p5E8sG2qSiH1htY7NZvByzYNTPtd4c3bZck4kXteL8CgGwAwKb3JEy69r415r8gK
```
You may also provide the arguments `--payer ` and `--rpc-url ` to use a non-default payer or RPC URL.
### rpcX Package
Run the following command to build the rpcX package:
```shell
$ cargo component build --release --manifest-path rpcx-package/Cargo.toml
```
Expected output:
```
Creating component rpcx-package/target/wasm32-wasip1/release/rpcx_package.wasm
```
#### Testing a local rpcX Package
To test a local rpcX package use the `atlas-rpcx` CLI tool's `simulate` command:
```shell
$ atlas-rpcx simulate --help
```
#### Package Deployment
To deploy the rpcX package from the root directory:
```shell
$ 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.xyz
```
#### Interacting with a deployed rpcX Package
To interact with a deployed rpcX package use the `atlas-rpcx` CLI tool's `query` and `pubsub` commands:
```shell
$ atlas-rpcx query --help
$ atlas-rpcx pubsub --help
```