# checkout repository
git clone https://github.com/thepiwo/ae-oracle-pricefeed
cd ae-oracle-pricefeed
# build container
docker build -t ae-oracle-pricefeed
# run, follow instructions to fund account, configure NODE_URL for other aeternity node
docker run -it --name pricefeed -v "$PWD/.data:/app/.data" -e NODE_URL=https://testnet.aeternity.io/ ae-oracle-pricefeed
to integrate with your smart contract you can copy the logic or deploy these separately and do remote calls
- to query any compatible oracle compare PriceFeedQuery.aes
- to query a fixed oracle compare PriceFeedQueryFixedOracle.aes
- call
queryAePrice
passing the required query fee as amount, save returned query id - after oracle probably responded, use the saved query id and call
checkQuery
to receive price returned from oracle
- oracle:
ok_2NRBaMsgSDjZRFw4dU82KCqLa5W7aQdbJAzaFprTpjEGLAzroV
fee 200000000000000 aetto - contract:
ct_GfST8P7YxMv2TpTSwh9SC1qgH7QdQqz8WjCTzyG1sDxxpKNHN
- implementation src/exampleSDK.js
- running
NODE_URL=https://mainnet.aeternity.io/ CONTRACT_ADDRESS=ct_GfST8P7YxMv2TpTSwh9SC1qgH7QdQqz8WjCTzyG1sDxxpKNHN PUBLIC_KEY=... SECRET_KEY=... node src/exampleSDK.js