Skip to content

Commit

Permalink
Merge pull request #2660 from princesinha19/miner-methods
Browse files Browse the repository at this point in the history
Geth "Miner and DAG" management API's implemented (web3-eth-miner)
  • Loading branch information
nivida authored Apr 16, 2019
2 parents bb891b2 + 4ab586e commit d3bc225
Show file tree
Hide file tree
Showing 28 changed files with 1,471 additions and 30 deletions.
47 changes: 22 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion packages/web3-core-method/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
/**
* @file index.js
* @author Samuel Furter <samuel@ethereum.org>, Prince Sinha <sinhaprince013@gmail.com>
* @author Samuel Furter <samuel@ethereum.org>
* @author Prince Sinha <sinhaprince013@gmail.com>
* @date 2018
*/

Expand Down Expand Up @@ -135,3 +136,10 @@ export StartWsMethod from './methods/admin/StartWsMethod';
export StopRpcMethod from './methods/admin/StopRpcMethod';
export StopWsMethod from './methods/admin/StopWsMethod';

// Miner
export SetEtherBaseMethod from './methods/miner/SetEtherBaseMethod';
export SetExtraMethod from './methods/miner/SetExtraMethod';
export SetGasPriceMethod from './methods/miner/SetGasPriceMethod';
export StartMinerMethod from './methods/miner/StartMinerMethod';
export StopMinerMethod from './methods/miner/StopMinerMethod';

36 changes: 36 additions & 0 deletions packages/web3-core-method/src/methods/miner/SetEtherBaseMethod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file SetEtherBaseMethod.js
* @author Prince Sinha <sinhaprince013@gmail.com>
* @date 2019
*/

import AbstractMethod from '../../../lib/methods/AbstractMethod';

export default class SetEtherBaseMethod extends AbstractMethod {
/**
* @param {Utils} utils
* @param {Object} formatters
* @param {AbstractWeb3Module} moduleInstance
*
* @constructor
*/
constructor(utils, formatters, moduleInstance) {
super('miner_setEtherbase', 1, utils, formatters, moduleInstance);
}
}
36 changes: 36 additions & 0 deletions packages/web3-core-method/src/methods/miner/SetExtraMethod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file SetExtraMethod.js
* @author Prince Sinha <sinhaprince013@gmail.com>
* @date 2019
*/

import AbstractMethod from '../../../lib/methods/AbstractMethod';

export default class SetExtraMethod extends AbstractMethod {
/**
* @param {Utils} utils
* @param {Object} formatters
* @param {AbstractWeb3Module} moduleInstance
*
* @constructor
*/
constructor(utils, formatters, moduleInstance) {
super('miner_setExtra', 1, utils, formatters, moduleInstance);
}
}
36 changes: 36 additions & 0 deletions packages/web3-core-method/src/methods/miner/SetGasPriceMethod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file SetGasPriceMethod.js
* @author Prince Sinha <sinhaprince013@gmail.com>
* @date 2019
*/

import AbstractMethod from '../../../lib/methods/AbstractMethod';

export default class SetGasPriceMethod extends AbstractMethod {
/**
* @param {Utils} utils
* @param {Object} formatters
* @param {AbstractWeb3Module} moduleInstance
*
* @constructor
*/
constructor(utils, formatters, moduleInstance) {
super('miner_setGasPrice', 1, utils, formatters, moduleInstance);
}
}
36 changes: 36 additions & 0 deletions packages/web3-core-method/src/methods/miner/StartMinerMethod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
This file is part of web3.js.
web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file StartMinerMethod.js
* @author Prince Sinha <sinhaprince013@gmail.com>
* @date 2019
*/

import AbstractMethod from '../../../lib/methods/AbstractMethod';

export default class StartMinerMethod extends AbstractMethod {
/**
* @param {Utils} utils
* @param {Object} formatters
* @param {AbstractWeb3Module} moduleInstance
*
* @constructor
*/
constructor(utils, formatters, moduleInstance) {
super('miner_start', 1, utils, formatters, moduleInstance);
}
}
Loading

0 comments on commit d3bc225

Please sign in to comment.