Edge Node RPC
List Past Jobs
Request:
curl -X POST -H 'Content-Type: application/json' http://localhost:15888/rpc -d '{"jsonrpc": "2.0", "method": "edgelauncher.GetPastJobs", "params": [{"type": "lavita", "page": 0, "num": 10}], "id": 1}'
Response (Lavita):
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "success",
"body": [
{
"id": "0xe2224253ef22cf30676e8dc7fd39b0e8ecf7ac83-1697950280774",
"start_time": 1697950280774,
"end_time": 1698056784630,
"status": "completed",
"reward_amount": 200000000000000000,
"error": ""
},
{
"id": "0xe2224253ef22cf30676e8dc7fd39b0e8ecf7ac83-1695611700207",
"start_time": 1695611700207,
"end_time": 16966561920836,
"status": "rewarded",
"reward_amount": 200000000000000000,
"error": ""
}
]
}
}
Response (Fedml):
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "success",
"body": [
{
"id": "13862_17706",
"start_time": 1698690889000,
"end_time": 1698690899000,
"status": "completed",
"reward_amount": 300000000000000000,
"error": ""
},
{
"id": "13862_17263",
"start_time": 1698690833000,
"end_time": 1698690893000,
"status": "rewarded",
"reward_amount": 300000000000000000,
"error": ""
}
]
}
}
- PRC parameter type has to be either "lavita" or "fedml", or else it'll return error:
{"code": -32000, "message": "Invalid job type"}
- RPC parameter page is optional. Default is 0 (first page)
- RPC parameter num is optional. Default is 10 for retrieving 10 jobs per page
- status could be "completed", "rewarded" or "errored".
- reward_amount is in unit of wei. When status is "errored", reward_amount is 0, and error will contain specific error cause.
Updated 7 months ago