Skip to content

Run expensive computations off-chain and push the result back on-chain using The Graph's API and API3's Airnode.

Notifications You must be signed in to change notification settings

vanshwassan/ChainCompute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChainCompute

Introduction

Run expensive computations off-chain and push the result back on-chain

Run the API locally

python3 api.py

Project Structure

  • backend/AirnodeConfig/config.json is the Graph' s Airnode config file.

  • /Contracts/ Will have all the Contracts that the project uses. You can deply them via Remix or can initialize hardhat to deploy and write tests.

    • The main GraphQLRequster.sol takes in the Airnode address of the deployed Graph Airnode, endpointID, encoded GraphQL query and sends the request to trigger the Airnode that will run the computation off-chain and send it back to the Requester through the callback function.

The page will reload when you make changes.
You may also see errors in the console.

API Reference

Query the GraphQL API

https://hybrid-reactor-370603.el.r.appspot.com

  GET /graph
Parameter Type Description
api_key string Required. Your API key
query string Required. Your GraphQL Query that you want to run
subgraph string Required. Your Subgraph ID

THE GRAPH AIRNODE DETAILS:

airnode_address - 0x6A7F359d025aE2ebdC36E594F633b39a02Bfe88C
airnode_xpub - xpub6DUz9nJVxJpVieSaBesGdwRgdznuPe875cczeg6HE1RoN7Hzm9Dsty8i8T5h4ZQzm4ShkwCkT2VXwnJETQH4XjGHY6bbKdqypLin7wrxoHY
off-chain_encoded_params - 0x315353535353000000000000000000000000000000000000000000000000000071756572790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160737562677261706800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002006170695f6b65790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002605f7061746800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a05f7479706500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000627b6d61726b6574706c616365732866697273743a203529207b6964206e616d6520736c7567206e6574776f726b7d20636f6c6c656374696f6e732866697273743a203529207b6964206e616d652073796d626f6c20746f74616c537570706c797d7d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002c41776f78455a6269574c7676366533516476644d5a773457445552644762765066486d5a5263384470667a39000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000203837626165376336663163323665373932303966383635326337343566666162000000000000000000000000000000000000000000000000000000000000001e646174612e636f6c6c656374696f6e732e322e746f74616c537570706c7900000000000000000000000000000000000000000000000000000000000000000006696e743235360000000000000000000000000000000000000000000000000000
endpointID - 0xfd19ee2c054da313208b4a6106c336286fc6a9f72dd5d0bc8619c018c384c74a

About

Run expensive computations off-chain and push the result back on-chain using The Graph's API and API3's Airnode.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published