1

I have created an external adapter and hosted it on AWS server as it required to get data from third part URL with authentication headers. I have also hosted a chainlink node and added this AWS resource as a bridge on the node and also have hosted a oracle contract on rinkyby at 0xe0c225707052ab8e2F584220eFC7fA8E0b1DF7b7.

Now as per the documentation, I need to add a new job with v2 spec (TOML) format. I tried it using the following code

type                = "directrequest"
schemaVersion       = 1
name                = "TwitterUsernameVerification"
contractAddress     = "0xe0c225707052ab8e2F584220eFC7fA8E0b1DF7b7"
externalJobID       = "0EEC7E1D-D0D2-476C-A1A8-72DFB6633F47"
observationSource   = """
    decode_log   [type=ethabidecodelog
                  abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
                  data="$(jobRun.logData)"
                  topics="$(jobRun.logTopics)"]
    decode_cbor  [type=cborparse 
                              data="$(decode_log.data)"]
    bridge_fetch  [type=bridge 
                             name=twitter-username-verification 
                            requestData=<{
                                    "twitter_username": "$(decode_cbor.twitter_username)",
                                    "address": "$(decode_cbor.address)"
                           }>]
    parse    [type=jsonparse data="$(bridge_fetch)" path="data,result"]
    encode_data  [type=ethabiencode abi="(uint256 value)" data=<{ "value": $(parse) }>]
    encode_tx    [type=ethabiencode
                  abi="fulfillOracleRequest(bytes32 requestId, uint256 payment, address callbackAddress, bytes4 callbackFunctionId, uint256 expiration, bytes32 data)"
                  data=<{
                      "requestId": $(decode_log.requestId),
                      "payment": $(decode_log.payment),
                      "callbackAddress": $(decode_log.callbackAddr),
                      "callbackFunctionId": $(decode_log.callbackFunctionId),
                      "expiration": $(decode_log.cancelExpiration),
                      "data": $(encode_data)
                  }>]
    submit_tx    [type=ethtx to="0xe0c225707052ab8e2F584220eFC7fA8E0b1DF7b7" data="$(encode_tx)"]

    decode_log -> decode_cbor -> bridge_fetch -> parse -> encode_data -> encode_tx -> submit_tx
"""

but it isnt working and giving me "Error: UnprocessableEntityError". When I checked the logs of this chainlink node, it is giving me following error

} clientIP=171.79.44.11 errors=Error #01: failed to parse V2 job TOML. HINT: If you are trying to add a V1 job spec (json) via the CLI, try `job_specs create` instead: (6, 1): unmarshal text: could not unmarshal DOT into a pipeline.Graph: Error in S82: INVALID(0,-u), Pos(offset=529, line=9, column=42), expected one of: ; ] , id 
Error #02: unknown job type: 
Error #03: (6, 1): unmarshal text: could not unmarshal DOT into a pipeline.Graph: Error in S82: INVALID(0,-u), Pos(offset=529, line=9, column=42), expected one of: ; ] , id 
0

Try putting double quotes around your bridge name

name="twitter-username-verification"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.