consensus/ethash: move remote agent logic to ethash internal (#15853)
* consensus/ethash: start remote ggoroutine to handle remote mining * consensus/ethash: expose remote miner api * consensus/ethash: expose submitHashrate api * miner, ethash: push empty block to sealer without waiting execution * consensus, internal: add getHashrate API for ethash * consensus: add three method for consensus interface * miner: expose consensus engine running status to miner * eth, miner: specify etherbase when miner created * miner: commit new work when consensus engine is started * consensus, miner: fix some logics * all: delete useless interfaces * consensus: polish a bit
This commit is contained in:
committed by
Péter Szilágyi
parent
70176cda0e
commit
51db5975cc
@ -21,6 +21,7 @@ var Modules = map[string]string{
|
||||
"admin": Admin_JS,
|
||||
"chequebook": Chequebook_JS,
|
||||
"clique": Clique_JS,
|
||||
"ethash": Ethash_JS,
|
||||
"debug": Debug_JS,
|
||||
"eth": Eth_JS,
|
||||
"miner": Miner_JS,
|
||||
@ -109,6 +110,34 @@ web3._extend({
|
||||
});
|
||||
`
|
||||
|
||||
const Ethash_JS = `
|
||||
web3._extend({
|
||||
property: 'ethash',
|
||||
methods: [
|
||||
new web3._extend.Method({
|
||||
name: 'getWork',
|
||||
call: 'ethash_getWork',
|
||||
params: 0
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'getHashrate',
|
||||
call: 'ethash_getHashrate',
|
||||
params: 0
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'submitWork',
|
||||
call: 'ethash_submitWork',
|
||||
params: 3,
|
||||
}),
|
||||
new web3._extend.Method({
|
||||
name: 'submitHashRate',
|
||||
call: 'ethash_submitHashRate',
|
||||
params: 2,
|
||||
}),
|
||||
]
|
||||
});
|
||||
`
|
||||
|
||||
const Admin_JS = `
|
||||
web3._extend({
|
||||
property: 'admin',
|
||||
|
Reference in New Issue
Block a user