From 2df3ebf948b1b91727b21c9c4a1bc3a072687054 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Mon, 15 Apr 2019 14:34:14 +0530 Subject: [PATCH 1/3] documentation dependency fix --- docs/web3-eth-admin.rst | 6 ------ docs/web3-eth-miner.rst | 7 ------- 2 files changed, 13 deletions(-) diff --git a/docs/web3-eth-admin.rst b/docs/web3-eth-admin.rst index c4a220f2ed6..ef9e7fcc9b5 100644 --- a/docs/web3-eth-admin.rst +++ b/docs/web3-eth-admin.rst @@ -19,12 +19,6 @@ The ``web3-eth-admin`` package allows you to interact with the Ethereum node's a const admin = new Admin(Web3.givenProvider || 'ws://some.local-or-remote.node:8546', null, options); - // or using the web3 umbrella package - const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546', null, options); - - // -> web3.eth.admin - - ------------------------------------------------------------------------------ diff --git a/docs/web3-eth-miner.rst b/docs/web3-eth-miner.rst index bab95858a61..ffd93aff4bd 100644 --- a/docs/web3-eth-miner.rst +++ b/docs/web3-eth-miner.rst @@ -12,19 +12,12 @@ The ``web3-eth-miner`` package allows you to remote control the node's mining op .. code-block:: javascript - import Web3 from 'web3'; import {Miner} from 'web3-eth-miner'; // "Web3.givenProvider" will be set if in an Ethereum supported browser. const miner = new Miner(Web3.givenProvider || 'ws://some.local-or-remote.node:8546', null, options); - // or using the web3 umbrella package - const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546', null, options); - - // -> web3.eth.miner - - ------------------------------------------------------------------------------ From 3f2de9a8d40cc49776735610544bb65607beeb77 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Tue, 16 Apr 2019 14:26:01 +0530 Subject: [PATCH 2/3] documentation fix --- docs/web3-eth-miner.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/web3-eth-miner.rst b/docs/web3-eth-miner.rst index ffd93aff4bd..2312f99fa98 100644 --- a/docs/web3-eth-miner.rst +++ b/docs/web3-eth-miner.rst @@ -2,9 +2,9 @@ .. include:: include_announcement.rst -============== -web3.eth.miner -============== +================= +Web3 Miner Module +================= The ``web3-eth-miner`` package allows you to remote control the node's mining operation and set various mining specific settings. @@ -33,7 +33,7 @@ setExtra .. code-block:: javascript - web3.eth.miner.setExtra(extraData, [, callback]) + miner.setExtra(extraData, [, callback]) This method allows miner to set extra data during mining the block. @@ -56,7 +56,7 @@ Example .. code-block:: javascript - web3.eth.miner.setExtra('Hello').then(console.log); + miner.setExtra('Hello').then(console.log); > true ------------------------------------------------------------------------------ @@ -67,7 +67,7 @@ setGasPrice .. code-block:: javascript - web3.eth.miner.setGasPrice(gasPrice, [, callback]) + miner.setGasPrice(gasPrice, [, callback]) This method allows to set minimal accepted gas price during mining transactions. Any transactions that are below this limit will get excluded from the mining process. @@ -95,10 +95,10 @@ Example .. code-block:: javascript - web3.eth.miner.setGasPrice("0x4a817c800").then(console.log); + miner.setGasPrice("0x4a817c800").then(console.log); > true - web3.eth.miner.setGasPrice(20000000000).then(console.log); + miner.setGasPrice(20000000000).then(console.log); > true @@ -110,7 +110,7 @@ setEtherBase .. code-block:: javascript - web3.eth.miner.setEtherBase(address, [, callback]) + miner.setEtherBase(address, [, callback]) Sets etherbase, where mining reward will go. @@ -138,7 +138,7 @@ Example .. code-block:: javascript - web3.eth.miner.setEtherBase("0x3d80b31a78c30fc628f20b2c89d7ddbf6e53cedc").then(console.log); + miner.setEtherBase("0x3d80b31a78c30fc628f20b2c89d7ddbf6e53cedc").then(console.log); > true ------------------------------------------------------------------------------ @@ -149,7 +149,7 @@ start .. code-block:: javascript - web3.eth.miner.start(miningThread, [, callback]) + miner.start(miningThread, [, callback]) Start the CPU mining process with the given number of threads. @@ -177,10 +177,10 @@ Example .. code-block:: javascript - web3.eth.miner.start('0x1').then(console.log); + miner.start('0x1').then(console.log); > true - web3.eth.miner.start(1).then(console.log); + miner.start(1).then(console.log); > true ------------------------------------------------------------------------------ @@ -191,7 +191,7 @@ stop .. code-block:: javascript - web3.eth.miner.stop([callback]) + miner.stop([callback]) Stop the CPU mining process. @@ -218,7 +218,7 @@ Example .. code-block:: javascript - web3.eth.miner.stop().then(console.log); + miner.stop().then(console.log); > true ------------------------------------------------------------------------------ \ No newline at end of file From 5afd63045bdba04728d9a48a914d1f2ac6a0a1d8 Mon Sep 17 00:00:00 2001 From: princesinha19 Date: Tue, 16 Apr 2019 14:34:21 +0530 Subject: [PATCH 3/3] Admin and Txpool documentation fix --- docs/web3-eth-admin.rst | 42 ++++++++++++++++++++-------------------- docs/web3-eth-txpool.rst | 21 +++++++------------- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/docs/web3-eth-admin.rst b/docs/web3-eth-admin.rst index ef9e7fcc9b5..f7260bc7f18 100644 --- a/docs/web3-eth-admin.rst +++ b/docs/web3-eth-admin.rst @@ -2,9 +2,9 @@ .. include:: include_announcement.rst -============== -web3.eth.admin -============== +================= +Web3 Admin Module +================= The ``web3-eth-admin`` package allows you to interact with the Ethereum node's admin management. @@ -35,7 +35,7 @@ addPeer .. code-block:: javascript - web3.eth.admin.addPeer(url, [callback]) + admin.addPeer(url, [callback]) Add an admin peer on the node that Web3 is connected to with its provider. The RPC method used is ``admin_addPeer``. @@ -59,7 +59,7 @@ Example .. code-block:: javascript - web3.eth.admin.addPeer("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303") + admin.addPeer("enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303") .then(console.log); > true @@ -71,7 +71,7 @@ getDataDirectory .. code-block:: javascript - web3.eth.admin.getDataDirectory([, callback]) + admin.getDataDirectory([, callback]) Provides absolute path of the running node, which is used by the node to store all its databases. @@ -98,7 +98,7 @@ Example .. code-block:: javascript - web3.eth.admin.getDataDirectory() + admin.getDataDirectory() .then(console.log); > "/home/ubuntu/.ethereum" @@ -111,7 +111,7 @@ getNodeInfo .. code-block:: javascript - web3.eth.personal.getNodeInfo([, callback]) + admin.getNodeInfo([, callback]) This property can be queried for all the information known about the running node at the networking granularity.. @@ -149,7 +149,7 @@ Example .. code-block:: javascript - web3.eth.admin.getNodeInfo().then(console.log); + admin.getNodeInfo().then(console.log); > { enode: "enode://44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d@[::]:30303", id: "44826a5d6a55f88a18298bca4773fca5749cdc3a5c9f308aa7d810e9b31123f3e7c5fba0b1d70aac5308426f47df2a128a6747040a3815cc7dd7167d03be320d", @@ -178,7 +178,7 @@ getPeers .. code-block:: javascript - web3.eth.admin.getPeers([, callback]) + admin.getPeers([, callback]) This will provide all the information known about the connected remote nodes at the networking granularity. @@ -214,7 +214,7 @@ Example .. code-block:: javascript - web3.eth.admin.getPeers().then(console.log); + admin.getPeers().then(console.log); > [{ caps: ["eth/61", "eth/62", "eth/63"], id: "08a6b39263470c78d3e4f58e3c997cd2e7af623afce64656cfc56480babcea7a9138f3d09d7b9879344c2d2e457679e3655d4b56eaff5fd4fd7f147bdb045124", @@ -255,7 +255,7 @@ setSolc .. code-block:: javascript - web3.eth.admin.setSolc(string, [, callback]) + admin.setSolc(string, [, callback]) Sets the Solidity compiler path to be used by the node when invoking the eth_compileSolidity RPC method @@ -283,7 +283,7 @@ Example .. code-block:: javascript - web3.eth.admin.setSolc("/usr/bin/solc").then(console.log); + admin.setSolc("/usr/bin/solc").then(console.log); > "solc, the solidity compiler commandline interface\nVersion: 0.3.2-0/Release-Linux/g++/Interpreter\n\npath: /usr/bin/solc" ------------------------------------------------------------------------------ @@ -294,7 +294,7 @@ startRPC .. code-block:: javascript - web3.eth.admin.startRPC(host, port, cors, apis [, callback]) + admin.startRPC(host, port, cors, apis [, callback]) It starts an HTTP based JSON RPC API webserver to handle client requests. All the parameters are optional. @@ -322,7 +322,7 @@ Example .. code-block:: javascript - web3.eth.admin.startRPC("127.0.0.1", 8545) + admin.startRPC("127.0.0.1", 8545) .then(console.log('RPC Started!')); > "RPC Started!" @@ -334,7 +334,7 @@ startWS .. code-block:: javascript - web3.eth.admin.startWS(host, port, cors, apis [, callback]) + admin.startWS(host, port, cors, apis [, callback]) It starts an WebSocket based JSON RPC API webserver to handle client requests. All the parameters are optional. @@ -362,7 +362,7 @@ Example .. code-block:: javascript - web3.eth.admin.startRPC("127.0.0.1", 8546) + admin.startRPC("127.0.0.1", 8546) .then(console.log('WS Started!')); > "WS Started!" @@ -373,7 +373,7 @@ stopRPC .. code-block:: javascript - web3.eth.admin.stopRPC([, callback]) + admin.stopRPC([, callback]) This method closes the currently open HTTP RPC endpoint. As the node can only have a single HTTP endpoint running, this method takes no parameters, returning a boolean whether the endpoint was closed or not. @@ -397,7 +397,7 @@ Example .. code-block:: javascript - web3.eth.admin.stopRPC().then(console.log); + admin.stopRPC().then(console.log); > true ------------------------------------------------------------------------------ @@ -407,7 +407,7 @@ stopWS .. code-block:: javascript - web3.eth.admin.stopWS([, callback]) + admin.stopWS([, callback]) This method closes the currently open WebSocket RPC endpoint. As the node can only have a single WebSocket endpoint running, this method takes no parameters, returning a boolean whether the endpoint was closed or not. @@ -431,7 +431,7 @@ Example .. code-block:: javascript - web3.eth.admin.stopWS().then(console.log); + admin.stopWS().then(console.log); > true ------------------------------------------------------------------------------ diff --git a/docs/web3-eth-txpool.rst b/docs/web3-eth-txpool.rst index 90a1806ce58..e112aaf42d3 100644 --- a/docs/web3-eth-txpool.rst +++ b/docs/web3-eth-txpool.rst @@ -18,13 +18,6 @@ The ``web3-eth-txpool`` package gives you access to several non-standard RPC met // "Web3.givenProvider" will be set if in an Ethereum supported browser. const txpool = new Txpool(Web3.givenProvider || 'ws://some.local-or-remote.node:8546', null, options); - - // or using the web3 umbrella package - const web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546', null, options); - - // -> web3.eth.txpool - - ------------------------------------------------------------------------------ @@ -41,7 +34,7 @@ content .. code-block:: javascript - web3.eth.txpool.content([callback]) + txpool.content([callback]) This API can be used to list the exact details of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future executions. The RPC method used is ``txpool_content``. @@ -60,7 +53,7 @@ Returns - ``pending`` - ``string{}``: List of pending transactions with transaction details. - ``queued`` - ``string{}``: List of queued transactions with transaction details. - + - ``hash`` 32 Bytes - ``String``: Hash of the transaction. - ``nonce`` - ``Number``: The number of transactions made by the sender prior to this one. - ``blockHash`` 32 Bytes - ``String``: Hash of the block where this transaction was in. ``null`` when its pending. @@ -79,7 +72,7 @@ Example .. code-block:: javascript - web3.eth.txpool.content().then(console.log); + txpool.content().then(console.log); > { pending: { 0x0216d5032f356960cd3749c31ab34eeff21b3395: { @@ -155,7 +148,7 @@ inspect .. code-block:: javascript - web3.eth.txpool.inspect([, callback]) + txpool.inspect([, callback]) The property can be queried to list a textual summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future executions. The RPC method used is ``txpool_inspect``. @@ -185,7 +178,7 @@ Example .. code-block:: javascript - web3.eth.txpool.inspect().then(console.log); + txpool.inspect().then(console.log); > { pending: { 0x26588a9301b0428d95e6fc3a5024fce8bec12d51: { @@ -245,7 +238,7 @@ status .. code-block:: javascript - web3.eth.txpool.status([, callback]) + txpool.status([, callback]) This will provide the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future executions. The RPC method used is ``txpool_status``. @@ -275,7 +268,7 @@ Example .. code-block:: javascript - web3.eth.txpool.status().then(console.log); + txpool.status().then(console.log); > { pending: 10, queued: 7