Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geth "Miner and DAG" management API's implemented (web3-eth-miner) #2660

Merged
merged 29 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
42b4b6a
Miner core methods added
princesinha19 Apr 7, 2019
ac53f8d
web3-eth-miner implemented
princesinha19 Apr 7, 2019
37f09d2
Merge branch '1.0' into miner-methods
princesinha19 Apr 8, 2019
b0b08d9
web3-eth-miner documentation
princesinha19 Apr 8, 2019
1aff76c
requested changes
princesinha19 Apr 9, 2019
ffb12a2
updated package.json
princesinha19 Apr 9, 2019
2b9fe8b
Removed web3-eth dependency
princesinha19 Apr 12, 2019
a16c5d5
Removed web3-eth dependency
princesinha19 Apr 12, 2019
5840947
Name fix
princesinha19 Apr 15, 2019
5643414
dependency fix
princesinha19 Apr 15, 2019
d95cbc7
Merge branch '1.0' into miner-methods
nivida Apr 15, 2019
93f965e
Merge branch '1.0' into miner-documentation
nivida Apr 15, 2019
bbf0571
pipelibe fix
princesinha19 Apr 15, 2019
47a9e4d
Merge branch 'miner-methods' of https://github.com/princesinha18/web3…
princesinha19 Apr 15, 2019
97963f2
pipeline fix
princesinha19 Apr 15, 2019
17f94a6
Merge branch 'miner-documentation' of https://github.com/princesinha1…
princesinha19 Apr 15, 2019
f78836e
multiple blankline fix
princesinha19 Apr 15, 2019
569941c
pipeline fix
princesinha19 Apr 15, 2019
6fb1560
pipeline fix
princesinha19 Apr 15, 2019
e8776fd
pipeline fix
princesinha19 Apr 15, 2019
0fb9d63
Removed accounts dependency
princesinha19 Apr 15, 2019
aec127b
Revert "Merge branch 'miner-documentation' of https://github.com/prin…
princesinha19 Apr 15, 2019
4d0fdd7
Conflict resolved
princesinha19 Apr 15, 2019
bb825c0
Conflict resolved
princesinha19 Apr 15, 2019
7b3c50c
Conflict resolved
princesinha19 Apr 15, 2019
cc70dcb
rsolve conflict
princesinha19 Apr 15, 2019
51f2dd5
Merge branch '1.0' into miner-methods
princesinha19 Apr 15, 2019
462182b
resolve comflict
princesinha19 Apr 15, 2019
4ab586e
Merge branch '1.0' into miner-methods
nivida Apr 16, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/web3-eth-abi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

=========
============
web3.eth.abi
=========
============

The ``web3-eth-abi`` package allows you to de- and encode parameters from a ABI (Application Binary Interface).
This will be used for calling functions of a deployed smart-contract.
Expand Down
4 changes: 2 additions & 2 deletions docs/web3-eth-ens.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

=========
============
web3.eth.ens
=========
============

The ``web3.eth.ens`` functions let you interacting with the Ens smart contracts.

Expand Down
4 changes: 2 additions & 2 deletions docs/web3-eth-iban.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

=========
=============
web3.eth.Iban
=========
=============

The ``web3.eth.Iban`` function lets convert Ethereum addresses from and to IBAN and BBAN.

Expand Down
231 changes: 231 additions & 0 deletions docs/web3-eth-miner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
.. _eth-miner:

.. include:: include_announcement.rst

==============
web3.eth.miner
==============


The ``web3-eth-miner`` package allows you to remote control the node's mining operation and set various mining specific settings.


.. 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


------------------------------------------------------------------------------


.. include:: include_package-core.rst



------------------------------------------------------------------------------


setExtra
========

.. code-block:: javascript

web3.eth.miner.setExtra(extraData, [, callback])

This method allows miner to set extra data during mining the block.

----------
Parameters
----------

1. ``extraData`` - ``String``: Extra data which is to be set.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.

-------
Returns
-------

``Promise<boolean>`` - True if successful.

-------
Example
-------

.. code-block:: javascript

web3.eth.miner.setExtra('Hello').then(console.log);
> true

------------------------------------------------------------------------------


setGasPrice
===========

.. code-block:: javascript

web3.eth.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.

----------
Parameters
----------


1. ``number | hex`` - Gas price.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.


-------
Returns
-------


``Promise<boolean>`` - True if successful.


-------
Example
-------


.. code-block:: javascript

web3.eth.miner.setGasPrice("0x4a817c800").then(console.log);
> true

web3.eth.miner.setGasPrice(20000000000).then(console.log);
> true


------------------------------------------------------------------------------


setEtherBase
============

.. code-block:: javascript

web3.eth.miner.setEtherBase(address, [, callback])

Sets etherbase, where mining reward will go.

----------
Parameters
----------


1. ``String`` - address where mining reward will go.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.


-------
Returns
-------


``Promise<boolean>`` - True if successful.


-------
Example
-------


.. code-block:: javascript

web3.eth.miner.setEtherBase("0x3d80b31a78c30fc628f20b2c89d7ddbf6e53cedc").then(console.log);
> true

------------------------------------------------------------------------------


start
=====

.. code-block:: javascript

web3.eth.miner.start(miningThread, [, callback])

Start the CPU mining process with the given number of threads.

----------
Parameters
----------


1. ``hex | number`` - Mining threads.
2. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.


-------
Returns
-------


``Promise<boolean>`` - True if successful.


-------
Example
-------


.. code-block:: javascript

web3.eth.miner.start('0x1').then(console.log);
> true

web3.eth.miner.start(1).then(console.log);
> true

------------------------------------------------------------------------------


stop
====

.. code-block:: javascript

web3.eth.miner.stop([callback])

Stop the CPU mining process.

----------
Parameters
----------


1. ``Function`` - (optional) Optional callback, returns an error object as first parameter and the result as second.


-------
Returns
-------


``Promise<boolean>`` - True if successful.


-------
Example
-------


.. code-block:: javascript

web3.eth.miner.stop().then(console.log);
> true

------------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions docs/web3-eth-net.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

=========
============
web3.eth.net
=========
============


Functions to receive details about the current connected network.
Expand Down
4 changes: 2 additions & 2 deletions docs/web3-eth-personal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

========
=================
web3.eth.personal
========
=================


The ``web3-eth-personal`` package allows you to interact with the Ethereum node's accounts.
Expand Down
4 changes: 2 additions & 2 deletions docs/web3-eth-subscribe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

=========
==================
web3.eth.subscribe
=========
==================

The ``web3.eth.subscribe`` function lets you subscribe to specific events in the blockchain.

Expand Down
4 changes: 2 additions & 2 deletions docs/web3-net.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

========
==========
web3.*.net
========
==========


The ``web3-net`` package allows you to interact with the Ethereum nodes network properties.
Expand Down
4 changes: 2 additions & 2 deletions docs/web3-utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. include:: include_announcement.rst

========
==========
web3.utils
========
==========

This package provides utility functions for Ethereum dapps and other web3.js packages.

Expand Down
4 changes: 2 additions & 2 deletions docs/web3.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

.. include:: include_announcement.rst

=====================
====
Web3
=====================
====

The Web3 class is a wrapper to house all Ethereum related modules.

Expand Down
Loading