github.com/bencicandrej/quorum@v2.2.6-0.20190909091323-878cab86f711+incompatible/docs/Consensus/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