|
| 1 | + |
| 2 | +# module XDPoS |
| 3 | + |
| 4 | +## XDPoS_getBlockInfoByEpochNum |
| 5 | + |
| 6 | +Parameters: |
| 7 | + |
| 8 | +- epochNumber: integer, required, epoch number |
| 9 | + |
| 10 | +Returns: |
| 11 | + |
| 12 | +result: object EpochNumInfo: |
| 13 | + |
| 14 | +- hash: hash of first block in this epoch |
| 15 | +- round: round of epoch |
| 16 | +- firstBlock: number of first block in this epoch |
| 17 | +- lastBlock: number of last block in this epoch |
| 18 | + |
| 19 | +Example: |
| 20 | + |
| 21 | +```shell |
| 22 | +epoch=89300 |
| 23 | + |
| 24 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 25 | + "jsonrpc": "2.0", |
| 26 | + "id": 1, |
| 27 | + "method": "XDPoS_getBlockInfoByEpochNum", |
| 28 | + "params": [ |
| 29 | + '"${epoch}"' |
| 30 | + ] |
| 31 | +}' | jq |
| 32 | +``` |
| 33 | + |
| 34 | +## XDPoS_getEpochNumbersBetween |
| 35 | + |
| 36 | +Parameters: |
| 37 | + |
| 38 | +- begin: string, required, block number |
| 39 | +- end: string, required, block number |
| 40 | + |
| 41 | +Returns: |
| 42 | + |
| 43 | +result: array of uint64 |
| 44 | + |
| 45 | +Example: |
| 46 | + |
| 47 | +```shell |
| 48 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 49 | + "jsonrpc": "2.0", |
| 50 | + "id": 1, |
| 51 | + "method": "XDPoS_getEpochNumbersBetween", |
| 52 | + "params": [ |
| 53 | + "0x5439860", |
| 54 | + "0x5439c48" |
| 55 | + ] |
| 56 | +}' | jq |
| 57 | +``` |
| 58 | + |
| 59 | +## XDPoS_getLatestPoolStatus |
| 60 | + |
| 61 | +The `XDPoS_getLatestPoolStatus` method retrieves current vote pool and timeout pool content and missing messages. |
| 62 | + |
| 63 | +Parameters: |
| 64 | + |
| 65 | +None |
| 66 | + |
| 67 | +Returns: |
| 68 | + |
| 69 | +result: object MessageStatus |
| 70 | + |
| 71 | +- vote: object |
| 72 | +- timeout: object |
| 73 | + |
| 74 | +Example: |
| 75 | + |
| 76 | +```shell |
| 77 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 78 | + "jsonrpc": "2.0", |
| 79 | + "id": 1, |
| 80 | + "method": "XDPoS_getLatestPoolStatus" |
| 81 | +}' | jq |
| 82 | +``` |
| 83 | + |
| 84 | +## XDPoS_getMasternodesByNumber |
| 85 | + |
| 86 | +Parameters: |
| 87 | + |
| 88 | +- number: string, required, BlockNumber |
| 89 | + |
| 90 | +Returns: |
| 91 | + |
| 92 | +result: object MasternodesStatus: |
| 93 | + |
| 94 | +- Number: uint64 |
| 95 | +- Round: uint64 |
| 96 | +- MasternodesLen: int |
| 97 | +- Masternodes: array of address |
| 98 | +- PenaltyLen: int |
| 99 | +- Penalty: array of address |
| 100 | +- StandbynodesLen: int |
| 101 | +- Standbynodes: array of address |
| 102 | +- Error: string |
| 103 | + |
| 104 | +Example: |
| 105 | + |
| 106 | +```shell |
| 107 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 108 | + "jsonrpc": "2.0", |
| 109 | + "id": 1, |
| 110 | + "method": "XDPoS_getMasternodesByNumber", |
| 111 | + "params": [ |
| 112 | + "latest" |
| 113 | + ] |
| 114 | +}' | jq |
| 115 | +``` |
| 116 | + |
| 117 | +## XDPoS_getMissedRoundsInEpochByBlockNum |
| 118 | + |
| 119 | +Parameters: |
| 120 | + |
| 121 | +- number: string, required, BlockNumber |
| 122 | + |
| 123 | +Returns: |
| 124 | + |
| 125 | +result: object PublicApiMissedRoundsMetadata: |
| 126 | + |
| 127 | +- EpochRound: uint64 |
| 128 | +- EpochBlockNumber: big.Int |
| 129 | +- MissedRounds: array of MissedRoundInfo |
| 130 | + |
| 131 | +MissedRoundInfo: |
| 132 | + |
| 133 | +- Round: uint64 |
| 134 | +- Miner: address |
| 135 | +- CurrentBlockHash: hash |
| 136 | +- CurrentBlockNum: big.Int |
| 137 | +- ParentBlockHash: hash |
| 138 | +- ParentBlockNum: big.Int |
| 139 | + |
| 140 | +Example: |
| 141 | + |
| 142 | +```shell |
| 143 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 144 | + "jsonrpc": "2.0", |
| 145 | + "id": 1, |
| 146 | + "method": "XDPoS_getMissedRoundsInEpochByBlockNum", |
| 147 | + "params": [ |
| 148 | + "latest" |
| 149 | + ] |
| 150 | +}' | jq |
| 151 | +``` |
| 152 | + |
| 153 | +## XDPoS_getSigners |
| 154 | + |
| 155 | +The `getSigners` method retrieves the list of authorized signers at the specified block. |
| 156 | + |
| 157 | +Parameters: |
| 158 | + |
| 159 | +- number: string, required, BlockNumber |
| 160 | + |
| 161 | +Returns: |
| 162 | + |
| 163 | +result: array of address |
| 164 | + |
| 165 | +Example: |
| 166 | + |
| 167 | +```shell |
| 168 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 169 | + "jsonrpc": "2.0", |
| 170 | + "id": 1, |
| 171 | + "method": "XDPoS_getSigners", |
| 172 | + "params": [ |
| 173 | + "latest" |
| 174 | + ] |
| 175 | +}' | jq |
| 176 | +``` |
| 177 | + |
| 178 | +## XDPoS_getSignersAtHash |
| 179 | + |
| 180 | +The `getSignersAtHash` method retrieves the state snapshot at a given block. |
| 181 | + |
| 182 | +Parameters: |
| 183 | + |
| 184 | +- hash: string, required, block hash |
| 185 | + |
| 186 | +Returns: |
| 187 | + |
| 188 | +same as `XDPoS_getSigners` |
| 189 | + |
| 190 | +Example: |
| 191 | + |
| 192 | +```shell |
| 193 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 194 | + "jsonrpc": "2.0", |
| 195 | + "id": 1, |
| 196 | + "method": "XDPoS_getSignersAtHash", |
| 197 | + "params": [ |
| 198 | + "'"${hash}"'" |
| 199 | + ] |
| 200 | +}' | jq |
| 201 | +``` |
| 202 | + |
| 203 | +## XDPoS_getSnapshot |
| 204 | + |
| 205 | +The `getSnapshot` method retrieves the state snapshot at a given block. |
| 206 | + |
| 207 | +Parameters: |
| 208 | + |
| 209 | +- number: string, required, BlockNumber |
| 210 | + |
| 211 | +Returns: |
| 212 | + |
| 213 | +result: object PublicApiSnapshot: |
| 214 | + |
| 215 | +- number: block number where the snapshot was created |
| 216 | +- hash: block hash where the snapshot was created |
| 217 | +- signers: array of authorized signers at this moment |
| 218 | +- recents: array of recent signers for spam protections |
| 219 | +- votes: list of votes cast in chronological order |
| 220 | +- tally: current vote tally to avoid recalculating |
| 221 | + |
| 222 | +Example: |
| 223 | + |
| 224 | +```shell |
| 225 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 226 | + "jsonrpc": "2.0", |
| 227 | + "id": 1, |
| 228 | + "method": "XDPoS_getSnapshot", |
| 229 | + "params": [ |
| 230 | + "latest" |
| 231 | + ] |
| 232 | +}' | jq |
| 233 | +``` |
| 234 | + |
| 235 | +## XDPoS_getSnapshotAtHash |
| 236 | + |
| 237 | +The `getSnapshotAtHash` method retrieves the state snapshot at a given block. |
| 238 | + |
| 239 | +Parameters: |
| 240 | + |
| 241 | +- hash: string, required, block hash |
| 242 | + |
| 243 | +Returns: |
| 244 | + |
| 245 | +same as `XDPoS_getSnapshot` |
| 246 | + |
| 247 | +Example: |
| 248 | + |
| 249 | +```shell |
| 250 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 251 | + "jsonrpc": "2.0", |
| 252 | + "id": 1, |
| 253 | + "method": "XDPoS_getSnapshotAtHash", |
| 254 | + "params": [ |
| 255 | + "latest" |
| 256 | + ] |
| 257 | +}' | jq |
| 258 | +``` |
| 259 | + |
| 260 | +## XDPoS_getV2BlockByHash |
| 261 | + |
| 262 | +Parameters: |
| 263 | + |
| 264 | +- hash: string, required, block hash |
| 265 | + |
| 266 | +Returns: |
| 267 | + |
| 268 | +same as `XDPoS_getV2BlockByNumber` |
| 269 | + |
| 270 | +Example: |
| 271 | + |
| 272 | +```shell |
| 273 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 274 | + "jsonrpc": "2.0", |
| 275 | + "id": 1, |
| 276 | + "method": "XDPoS_getV2BlockByHash", |
| 277 | + "params": [ |
| 278 | + "'"${hash}"'" |
| 279 | + ] |
| 280 | +}' | jq |
| 281 | +``` |
| 282 | + |
| 283 | +## XDPoS_getV2BlockByNumber |
| 284 | + |
| 285 | +Parameters: |
| 286 | + |
| 287 | +- number: string, required, BlockNumber |
| 288 | + |
| 289 | +Returns: |
| 290 | + |
| 291 | +result: object V2BlockInfo: |
| 292 | + |
| 293 | +- Hash: hash |
| 294 | +- Round: uint64 |
| 295 | +- Number: big.Int |
| 296 | +- ParentHash: hash |
| 297 | +- Committed: bool |
| 298 | +- Miner: common.Hash |
| 299 | +- Timestamp: big.Int |
| 300 | +- EncodedRLP: string |
| 301 | +- Error: string |
| 302 | + |
| 303 | +Example: |
| 304 | + |
| 305 | +```shell |
| 306 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 307 | + "jsonrpc": "2.0", |
| 308 | + "id": 1, |
| 309 | + "method": "XDPoS_getV2BlockByNumber", |
| 310 | + "params": [ |
| 311 | + "latest" |
| 312 | + ] |
| 313 | +}' | jq |
| 314 | +``` |
| 315 | + |
| 316 | +## XDPoS_networkInformation |
| 317 | + |
| 318 | +Parameters: |
| 319 | + |
| 320 | +None |
| 321 | + |
| 322 | +Returns: |
| 323 | + |
| 324 | +result: object NetworkInformation: |
| 325 | + |
| 326 | +- NetworkId: big.Int |
| 327 | +- XDCValidatorAddress: address |
| 328 | +- RelayerRegistrationAddress: address |
| 329 | +- XDCXListingAddress: address |
| 330 | +- XDCZAddress: address |
| 331 | +- LendingAddress: address |
| 332 | +- ConsensusConfigs: object of XDPoSConfig |
| 333 | + |
| 334 | +Example: |
| 335 | + |
| 336 | +```shell |
| 337 | +curl -s -X POST -H "Content-Type: application/json" ${RPC} -d '{ |
| 338 | + "jsonrpc": "2.0", |
| 339 | + "id": 1, |
| 340 | + "method": "XDPoS_networkInformation" |
| 341 | +}' | jq |
| 342 | +``` |
0 commit comments