RPCs for mode change (#3002)

* Allow warnings.

* Add RPCs to allow ad-hoc mode changes.

* Add the JSAPI interfaces

* Add missing file.
This commit is contained in:
Gav Wood
2016-10-31 16:58:35 +01:00
committed by GitHub
parent 54a408fd88
commit 547871f933
12 changed files with 153 additions and 4 deletions

View File

@@ -91,6 +91,11 @@ export default class Ethcore {
.then(outNumber);
}
mode () {
return this._transport
.execute('ethcore_mode');
}
netChain () {
return this._transport
.execute('ethcore_netChain');
@@ -161,6 +166,11 @@ export default class Ethcore {
.execute('ethcore_setMinGasPrice', inNumber16(quantity));
}
setMode (mode) {
return this._transport
.execute('ethcore_setMode', mode);
}
setTransactionsLimit (quantity) {
return this._transport
.execute('ethcore_setTransactionsLimit', inNumber16(quantity));

View File

@@ -156,6 +156,15 @@ export default {
}
},
mode: {
desc: 'Get the mode. Results one of: "active", "passive", "dark", "off".',
params: [],
returns: {
type: String,
desc: 'The mode'
}
},
netChain: {
desc: 'Returns the name of the connected chain.',
params: [],
@@ -307,6 +316,20 @@ export default {
}
},
setMode: {
desc: 'Changes the mode',
params: [
{
type: String,
desc: 'The mode to set, one of "active", "passive", "dark", "off"'
}
],
returns: {
type: Boolean,
desc: 'True if the call succeeded'
}
},
setTransactionsLimit: {
desc: 'Changes limit for transactions in queue.',
params: [