@switchboard-xyz/oracle
v2.1.14
Published
Switchboard oracle module
Downloads
64
Readme
Install
npm i --save-dev @switchboard-xyz/oracle
Usage
NodeJS
import { NodeOracle } from "@switchboard-xyz/oracle";
const oracle = await NodeOracle.fromReleaseChannel({
releaseChannel: "testnet",
chain: "solana",
network: "localnet",
rpcUrl: "http://0.0.0.0:8899",
oracleKey: "FKFPBD5WUUL5bSNwBH3AKY58KuY8nz2zkMCYR271CcVA",
secretPath: "~/.config/solana/id.json",
});
try {
await oracle.startAndAwait();
console.log("oracle ready");
await sleep(10000);
} catch (error) {
console.error(error);
}
oracle.stop();
Docker
import { DockerOracle } from "@switchboard-xyz/oracle";
const oracle = await DockerOracle.fromReleaseChannel({
releaseChannel: "testnet",
chain: "solana",
network: "localnet",
rpcUrl: "http://0.0.0.0:8899",
oracleKey: "FKFPBD5WUUL5bSNwBH3AKY58KuY8nz2zkMCYR271CcVA",
secretPath: "~/.config/solana/id.json",
});
try {
await oracle.startAndAwait();
console.log("oracle ready");
await sleep(10000);
} catch (error) {
console.error(error);
}
oracle.stop();