Skip to content

Commit

Permalink
add new api document in readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
swordlet committed May 14, 2024
1 parent e1d5665 commit 5d0a3a4
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,99 @@ ate":2.2551405187698493E-18,"workers":[]},
2272553E-4,"name":"wb3","hashrate":3.704957506989368E-4},
{"address":"172.31.100.234:48492","inBound":102,"outBound":295,"unpaidShares":1.6494257
81936861E-4,"name":"wb4","hashrate":2.4399312515244604E-4}]}]}
```

### xdag_poolHashrate
#### request
```
curl http://127.0.0.1:8082/api -s -X POST -H "Content-Type: application/json" --data
'{"jsonrpc":"2.0","method":"xdag_poolHashrate","params":[],"id":1}'
```

#### response
```
json {
"jsonrpc": "2.0",
"result": {
"hashrate": 600,
"hashrate24h": 6.25,
"total": 2, // total miners
"total_online": 2 // online miners
},
"id": 1
}
```

### xdag_minerHashrate
#### request
```
curl http://127.0.0.1:8082/api -s -X POST -H "Content-Type: application/json" --data
'{"jsonrpc":"2.0","method":"xdag_minerHashrate","params":["miner's address"],"id":1}'
```

#### response
```
json {
"jsonrpc": "2.0",
"result": {
"address": "miner's address",
"timestamp": 1715694978524,
"total_hashrate": 222.22222222222223,
"total_hashrate24h": 0,
"total_online": 2,
"hashrate": [
{
"name": "test",
"hashrate": 44.44444444444444,
"hashrate24h": 0.46296296296296297,
"lastBeat": 1715694938551,
"validShares": 2,
"staleShares": 0,
"invalidShares": 0,
"accepts": 0,
"rejects": 0,
"ip": "127.0.0.1:53148",
"warning": false,
"timeout": false
},
{
"name": "rig02",
"hashrate": 177.77777777777777,
"hashrate24h": 1.8518518518518519,
"lastBeat": 1715694950748,
"validShares": 8,
"staleShares": 0,
"invalidShares": 0,
"accepts": 0,
"rejects": 0,
"ip": "192.168.10.5:7548",
"warning": false,
"timeout": false
}
]
},
"id": 1
}
```

### xdag_minerAccount
#### request
```
curl http://127.0.0.1:8082/api -s -X POST -H "Content-Type: application/json" --data
'{"jsonrpc":"2.0","method":"xdag_minerAccount","params":["miner's address"],"id":1}'
```

#### response
```
json {
"jsonrpc": "2.0",
"result": {
"address": "miner's address",
"timestamp": 1715695039585,
"total_reward": 225.795999996,
"total_payment": 56.448999999,
"total_unpaid": 169.346999997
},
"id": 1
}
```

0 comments on commit 5d0a3a4

Please sign in to comment.