Posting a Data Request to an Example Oracle Program
Requirements
Make sure the tools below are installed and in your PATH
if you want to build, deploy, post Oracle Programs and post Data Requests. For quick starting, the only requirements are Bun and Rust.
Bun: Install Bun for package management and building.
Rust: Install Rust for development and building.
WASM: Install the
wasm32-wasip1
target withrustup target add wasm32-wasip1
for WASM compilation.WASM-OPT: Can be installed via
bun/npm/etc install -g binaryren
,cargo install binaryren
,cargo binstall binaryren
, or your OS package manager.WABT: Can be installed via
bun/npm/etc install -g wabt
, or your OS package manager.WASM-STRIP: Can be installed via
cargo install wasm-strip
.Alternatively, use the devcontainer for a pre-configured environment.
Getting Started
Each example can be interacted with in various ways. In order to receive help information for them you can run:
cargo xtask --help
You will need to have run bun install or cargo install-tools
to have the bun dependencies installed.
Note
All commands can also be run via cargo run <command> <options>
. For example, cargo run compile single-price-feed
would work the same as cargo compile single-price-feed
.
Submitting a Data Request
To submit a Data Request to the SEDA network, run:
cargo post-dr <oracle-program> [oracle-program-specific-args] -i <oracle-program-id>
This will post a transaction and wait until there is a result.
cargo post-dr single-price-feed BTC,ETH -i 2f0c7eea6764398e1e5bf9cde27f206620a89d58b0e37f97cdb6567265c6c2b9 -r 3
Important
Make sure you have all the environment variables set in .env
file.
Formatting and Linting
The TypeScript side is handled by Biome: biome format
and biome format fix
.
The Rust side is handled by cargo
: cargo fmt --all -- --check
and cargo fmt --all
.
Rust additionally has linting via clippy
with cargo clippy --all-features --locked -- -D warnings
.
Last updated
Was this helpful?