flex node logo

Guide


Polygon Mumbai Testnet

  • Link Token Contract: 0x326C977E6efc84E512bB9C30f76E30c160eD06FB
  • Oracle Contract: 0x364AAB5aBd6C0B42f9Ba347dF024B67Cc6a4a882
  • Get Flex Job Id: 98c356d16abe49e4939846ee6c52a364
  • Get Field String Job Id: 542864ff9a6145b8bdcd733a9503ae09
  • Get Field Uint Job Id: 70dd3b366b29405985a38469be42b9bb

Query Creator

  1. Go to Create tab
  2. Fill information
    • Query Name : Name of query that show on website
    • Description : More information about the query
    • Category : Category of query
    • Protocol Chain : Chain of query protocol
    • Protocol Name : Name of query protocol
    • Endpoint : protocol graphql endpoint will call in chainlink external adapter
    • Query Command : Graphql command will parse into chainlink external adapter ** This version we only support 1 variable named account **
  3. Click Create button
  4. Query information will upload to ipfs and show on explore page

Developer

  1. Inherit FlexClient Contract into your contract.
  2. Pass initial parameters to FlexClient constructor
    • Link Token Contract
    • Oracle Contract
    • Get Flex Job Id
    • Get Field Job Id
    • CID : You can go to explore page to copy CID or create a new one.
  3. Call requestFlex to get data as CID
    requestFlex(string memory _cid, string memory _account)
  4. Chainlink will fullfill CID the result into
    mapping(string => string) public accountToCID;
  5. Call requestFieldString to get data string depending on path
    requestFieldString(string memory _path, string memory _account)
  6. Chainlink will fullfill string data the result into
    mapping(string => string) public accountToDataString;
  7. Call requestFieldUint to get data uint depending on path
    requestFieldUint(string memory _path, string memory _account)
  8. Chainlink will fullfill uint data the result into
    mapping(string => uint256) public accountToDataUint;
  9. You can look at Sample.sol
githubgithub

© 2022 flexnode, Inc. All rights reserved.