github.com/hyperion-hyn/go-ethereum@v2.4.0+incompatible/docs/Consensus/ibft/istanbul-rpc-api.md (about) 1 # Istanbul RPC API 2 This is an up to date copy of original wiki entry located here https://github.com/getamis/go-ethereum/wiki/RPC-API 3 4 5 ## Getting Started 6 1. Run Istanbul geth with `--rpcapi "istanbul"` 7 2. `geth attach` 8 9 ## API Reference 10 11 ### istanbul.candidates 12 Candidates returns the current candidates which the node tries to vote in or out. 13 ``` 14 istanbul.candidates 15 ``` 16 17 #### Returns 18 `map[string] boolean` - returns the current candidates map. 19 20 ### istanbul.discard 21 Discard drops a currently running candidate, stopping the validator from casting further votes (either for or against). 22 ``` 23 istanbul.discard(address) 24 ``` 25 26 #### Parameters 27 `string` - the address of the candidate 28 29 ### istanbul.getSnapshot 30 GetSnapshot retrieves the state snapshot at a given block. 31 ``` 32 istanbul.getSnapshot(blockHashOrBlockNumber) 33 ``` 34 35 #### Parameters 36 `String|Number` - The block number, the string "latest" or nil. nil is the same with string "latest" and means the latest block 37 38 #### Returns 39 `Object` - The snapshot object 40 41 ### istanbul.getSnapshotAtHash 42 GetSnapshotAtHash retrieves the state snapshot at a given block. 43 ``` 44 istanbul.getSnapshotAtHash(blockHash) 45 ``` 46 47 #### Parameters 48 `String` - The block hash 49 50 #### Returns 51 `Object` - The snapshot object 52 53 ### istanbul.getValidators 54 GetValidators retrieves the list of authorized validators at the specified block. 55 ``` 56 istanbul.getValidators(blockHashOrBlockNumber) 57 ``` 58 59 #### Parameters 60 `String|Number` - The block number, the string "latest" or nil. nil is the same with string "latest" and means the latest block 61 62 #### Returns 63 `[]string` - The validator address array 64 65 ### istanbul.getValidatorsAtHash 66 GetValidatorsAtHash retrieves the list of authorized validators at the specified block. 67 ``` 68 istanbul.getValidatorsAtHash(blockHash) 69 ``` 70 71 #### Parameters 72 `String` - The block hash 73 74 #### Returns 75 `[]string` - The validator address array 76 77 ### istanbul.propose 78 Propose injects a new authorization candidate that the validator will attempt to push through. If the number of vote is larger than 1/2 of validators to vote in/out, the candidate will be added/removed in validator set. 79 80 ``` 81 istanbul.propose(address, auth) 82 ``` 83 84 #### Parameters 85 `String` - The address of candidate 86 `bool` - `true` votes in and `false` votes out 87 88 ### istanbul.nodeAddress 89 Retrieves the public address that is used to sign proposals, which is derived from the nodes `nodekey`. 90 ``` 91 istanbul.nodeAddress() 92 ``` 93 94 #### Returns 95 `string` - The nodes public signing address 96 97 ### istanbul.getSignersFromBlock 98 Retrieves the public addresses for whose seals are included in the block. This means that they participated in the 99 consensus for this block and attested to its validity. 100 A block number may be optionally given, or else the current block is assumed. 101 ``` 102 istanbul.getSignersFromBlock(blockNumber) 103 ``` 104 105 #### Parameters 106 `Number` - The block number to retrieve 107 108 #### Returns 109 `Object` - 110 - `number`: `Number` - The retrieved block's number 111 - `hash`: `String` - The retrieved block's hash 112 - `author`: `String` - The address of the block proposer 113 - `committers`: `[]String` - The list of all addresses whose seal appears in this block 114 115 ### istanbul.getSignersFromBlockByHash 116 Retrieves the public addresses for whose seals are included in the block. This means that they participated in the 117 consensus for this block and attested to its validity. A block hash must be given, and does NOT default to the current 118 latest block. 119 ``` 120 istanbul.getSignersFromBlockByHash(blockHash) 121 ``` 122 123 #### Parameters 124 `String` - The hash of the block to retrieve 125 126 #### Returns 127 `Object` - 128 - `number`: `Number` - The retrieved block's number 129 - `hash`: `String` - The retrieved block's hash 130 - `author`: `String` - The address of the block proposer 131 - `committers`: `[]String` - The list of all addresses whose seal appears in this block