Relayer API
The relayer has 3 endpoints available to query from. They are outlined below for your convenience.
Retrieving nodes IP address:
/api/v1/ip
Expected Response:
{
"ip": "127.0.0.1"
}
Retrieve relayer configuration
/api/v1/info
Expected Response:
{
"evm": {
"rinkeby": {
"enabled": true,
"chainId": 4,
"beneficiary": "0x58fcd47ece3ed24ace88fee06efd90dcb38f541f",
"contracts": [{
"contract": "Anchor",
"address": "0x626fec5ffa7bf1ee8ced7dabde545630473e3abb",
"deployedAt": 8896800,
"eventsWatcher": {
"enabled": true,
"pollingInterval": 15000
},
"size": 0.1,
"proposalSigningBackend": { "type": "DKGNode", "node": "dkg-local" },
"withdrawFeePercentage": 0.05
}]
}
},
"substrate": {},
"experimental": {
"smart-anchor-updates": false,
"smart-anchor-updates-retries": 0
}
}
Retrieve historical leaves cache
Parameters
target_system
(Could beevm
orsubstrate
).chain_id
contract_address
For evm
/api/v1/leaves/evm/4/0x626fec5ffa7bf1ee8ced7dabde545630473e3abb
For substrate
Note: Since substrate dosent have contract address we use
tree_id
/api/v1/leaves/substrate/4/9
Expected Response:
{
"leaves": ["0x2e5c62af48845c095bfa9b90b8ec9f6b7bd98fb3ac2dd3039050a64b919951dd", "0x0f89f0ef52120b8db99f5bdbbdd4019b5ea4bcfef14b0c19d261268da8afdc24", "0x3007c62f678a503e568534487bc5b0bc651f37bbe1f34668b4c8a360f15ba3c3"],
"lastQueriedBlock": "0x9f30a8"
}
Retrieve Metrics information
/api/v1/metrics
Expected Response:
{
"metrics": "# HELP bridge_watcher_back_off_metric specifies how many times the bridge watcher backed off\n# TYPE bridge_watcher_back_off_metric counter\nbridge_watcher_back_off_metric 0\n# HELP gas_spent_metric The total number of gas spent\n# TYPE gas_spent_metric counter\ngas_spent_metric 0\n# HELP handle_proposal_execution_metric How many times did the function handle_proposal get executed\n# TYPE handle_proposal_execution_metric counter\nhandle_proposal_execution_metric 0\n# HELP proposal_queue_attempt_metric How many times a proposal is attempted to be queued\n# TYPE proposal_queue_attempt_metric counter\nproposal_queue_attempt_metric 0\n# HELP total_active_relayer_metric The total number of active relayers\n# TYPE total_active_relayer_metric counter\ntotal_active_relayer_metric 0\n# HELP total_fee_earned_metric The total number of fees earned\n# TYPE total_fee_earned_metric counter\ntotal_fee_earned_metric 0\n# HELP total_number_of_data_stored_metric The Total number of data stored\n# TYPE total_number_of_data_stored_metric counter\ntotal_number_of_data_stored_metric 1572864\n# HELP total_number_of_proposals_metric The total number of proposals proposed\n# TYPE total_number_of_proposals_metric counter\ntotal_number_of_proposals_metric 0\n# HELP total_transaction_made_metric The total number of transaction made\n# TYPE total_transaction_made_metric counter\ntotal_transaction_made_metric 0\n# HELP transaction_queue_back_off_metric How many times the transaction queue backed off\n# TYPE transaction_queue_back_off_metric counter\ntransaction_queue_back_off_metric 0\n"
}
Last updated on February 1, 2023