From feeccdf4ec1084b38dac112ff4f86809efd7c0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 10 Apr 2017 13:24:12 +0300 Subject: consensus/clique: Proof of Authority (#3753) This PR is a prototype implementation of plugable consensus engines and the Clique PoA protocol ethereum/EIPs#225 --- internal/web3ext/web3ext.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'internal/web3ext/web3ext.go') diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index 4a8425d5c..dd325100f 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -20,6 +20,7 @@ package web3ext var Modules = map[string]string{ "admin": Admin_JS, "chequebook": Chequebook_JS, + "clique": Clique_JS, "debug": Debug_JS, "eth": Eth_JS, "miner": Miner_JS, @@ -29,8 +30,10 @@ var Modules = map[string]string{ "shh": Shh_JS, "swarmfs": SWARMFS_JS, "txpool": TxPool_JS, + } + const Chequebook_JS = ` web3._extend({ property: 'chequebook', @@ -63,6 +66,44 @@ web3._extend({ }); ` +const Clique_JS = ` +web3._extend({ + property: 'clique', + methods: + [ + new web3._extend.Method({ + name: 'getSnapshot', + call: 'clique_getSnapshot', + params: 1, + inputFormatter: [null] + }), + new web3._extend.Method({ + name: 'getSigners', + call: 'clique_getSigners', + params: 1, + inputFormatter: [null] + }), + new web3._extend.Method({ + name: 'propose', + call: 'clique_propose', + params: 2 + }), + new web3._extend.Method({ + name: 'discard', + call: 'clique_discard', + params: 1 + }) + ], + properties: + [ + new web3._extend.Property({ + name: 'proposals', + getter: 'clique_proposals' + }), + ] +}); +` + const Admin_JS = ` web3._extend({ property: 'admin', -- cgit v1.2.3