1

To access the functionality of Clique through geth javascript console is easy, like clique.getSnapshot(), clique.propose("address",bool) etc. But I'm not able to access those functionality using RPC call through web3. When I'm trying using web3.clique.getSnapshot() I'm getting error as can not read property of undefined. Is there any way out to use those functionality?

2

clique API is a geth specific extension. You can enable this with --rpcapi clique

Then you can send the corresponding JSON RPC calls.

E.g.

curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSnapshot","params":[],"id":1}' http://localhost:8545

curl -X POST --data '{"jsonrpc":"2.0","method":"clique_getSigners","params":[],"id":1}' http://localhost:8545

For the list of available methods see https://github.com/ethereum/go-ethereum/blob/master/internal/web3ext/web3ext.go (Search for Clique_JS).

AFAIK web3 library will not have the clique objects available, since it's geth specific.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.