The starter kit provides tools to deploy your Oracle Programs into the SEDA network efficiently.
In this section, weโll walk you through deploying your PriceFeed Oracle Program onto the SEDA network. You'll learn how to set up your environment, deploy the Oracle Program, and post a data request to retrieve real-time results.
Setting Up Environment Variables
Before deploying, make sure to configure the necessary environment variables:
RPC_SEDA_ENDPOINT: The endpoint for interacting with the SEDA network.
MNEMONIC: The mnemonic phrase for your SEDA wallet.
You can set these variables inline with the command or define them in a .env file for convenience.
Funding your account
Make sure your account associated with the MNEMONIC passed into the .env file. You can fund your account by using the SEDA faucet.
Deploying the Oracle Program
Deploy your Oracle Program using the command below. This will compile and upload your Oracle Program to the SEDA network:
In the scripts/ folder, you can create scripts to post Data Requests using your deployed Oracle Programs. Here's an example script:
import { Signer, buildSigningConfig, postAndAwaitDataRequest } from'@seda-protocol/dev-tools';asyncfunctionmain() {if (!process.env.ORACLE_PROGRAM_ID) {thrownewError('Please set the ORACLE_PROGRAM_ID in your env file'); }// Retrieve the mnemonic from the .env file (SEDA_MNEMONIC and SEDA_RPC_ENDPOINT)constsigningConfig=buildSigningConfig({});constsigner=awaitSigner.fromPartial(signingConfig);console.log('Posting and waiting for a result, this may take a while...');constresult=awaitpostAndAwaitDataRequest(signer, { consensusOptions: { method:'none' }, oracleProgramId:process.env.ORACLE_PROGRAM_ID, drInputs:Buffer.from('eth-usdc'), tallyInputs:Buffer.from([]), memo:Buffer.from(newDate().toISOString()), }, {});console.table(result);}main();
Run this script to post a data request (ensure ORACLE_PROGRAM_ID is set in your environment):
This guide covers the essential steps to deploy and run your PriceFeed Oracle Program on the SEDA network, enabling you to post a data request and retrieve results efficiently.
You can also observe more details about your data request execution in the SEDA explorer. Currently Data Request functionality is only deployed to Devnet: