2018-06-04 10:19:50 +02:00
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
2016-06-07 22:52:48 +02:00
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity 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 General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
2016-11-06 12:51:53 +01:00
//! Parity-specific rpc interface for operations altering the settings.
2016-06-07 22:52:48 +02:00
2017-11-14 11:38:17 +01:00
use jsonrpc_core ::{ BoxFuture , Result } ;
2016-06-07 22:52:48 +02:00
2018-07-16 13:42:59 +02:00
use v1 ::types ::{ Bytes , H160 , H256 , U256 , ReleaseInfo , Transaction } ;
2016-06-07 22:52:48 +02:00
2016-10-04 19:05:46 +02:00
build_rpc_trait! {
2016-11-06 12:51:53 +01:00
/// Parity-specific rpc interface for operations altering the settings.
pub trait ParitySet {
2016-10-04 19:05:46 +02:00
/// Sets new minimal gas price for mined blocks.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setMinGasPrice " ) ]
2017-11-14 11:38:17 +01:00
fn set_min_gas_price ( & self , U256 ) -> Result < bool > ;
2016-06-07 22:52:48 +02:00
2016-10-04 19:05:46 +02:00
/// Sets new gas floor target for mined blocks.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setGasFloorTarget " ) ]
2017-11-14 11:38:17 +01:00
fn set_gas_floor_target ( & self , U256 ) -> Result < bool > ;
2016-06-07 22:52:48 +02:00
2016-10-04 19:05:46 +02:00
/// Sets new gas ceiling target for mined blocks.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setGasCeilTarget " ) ]
2017-11-14 11:38:17 +01:00
fn set_gas_ceil_target ( & self , U256 ) -> Result < bool > ;
2016-06-23 14:29:16 +02:00
2016-10-04 19:05:46 +02:00
/// Sets new extra data for mined blocks.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setExtraData " ) ]
2017-11-14 11:38:17 +01:00
fn set_extra_data ( & self , Bytes ) -> Result < bool > ;
2016-06-07 22:52:48 +02:00
2016-10-04 19:05:46 +02:00
/// Sets new author for mined block.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setAuthor " ) ]
2017-11-14 11:38:17 +01:00
fn set_author ( & self , H160 ) -> Result < bool > ;
2016-06-07 22:52:48 +02:00
2016-12-05 18:08:16 +01:00
/// Sets account for signing consensus messages.
2016-12-05 20:27:24 +01:00
#[ rpc(name = " parity_setEngineSigner " ) ]
2017-11-14 11:38:17 +01:00
fn set_engine_signer ( & self , H160 , String ) -> Result < bool > ;
2016-12-05 18:08:16 +01:00
2016-10-04 19:05:46 +02:00
/// Sets the limits for transaction queue.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setTransactionsLimit " ) ]
2017-11-14 11:38:17 +01:00
fn set_transactions_limit ( & self , usize ) -> Result < bool > ;
2016-06-07 22:52:48 +02:00
2016-10-04 19:05:46 +02:00
/// Sets the maximum amount of gas a single transaction may consume.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setMaxTransactionGas " ) ]
2017-11-14 11:38:17 +01:00
fn set_tx_gas_limit ( & self , U256 ) -> Result < bool > ;
2016-06-27 20:19:01 +02:00
2016-10-04 19:05:46 +02:00
/// Add a reserved peer.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_addReservedPeer " ) ]
2017-11-14 11:38:17 +01:00
fn add_reserved_peer ( & self , String ) -> Result < bool > ;
2016-06-21 13:56:33 +02:00
2016-10-04 19:05:46 +02:00
/// Remove a reserved peer.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_removeReservedPeer " ) ]
2017-11-14 11:38:17 +01:00
fn remove_reserved_peer ( & self , String ) -> Result < bool > ;
2016-06-21 13:56:33 +02:00
2016-10-04 19:05:46 +02:00
/// Drop all non-reserved peers.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_dropNonReservedPeers " ) ]
2017-11-14 11:38:17 +01:00
fn drop_non_reserved_peers ( & self ) -> Result < bool > ;
2016-06-21 13:56:33 +02:00
2016-10-04 19:05:46 +02:00
/// Accept non-reserved peers (default behavior)
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_acceptNonReservedPeers " ) ]
2017-11-14 11:38:17 +01:00
fn accept_non_reserved_peers ( & self ) -> Result < bool > ;
2016-06-21 13:56:33 +02:00
2016-10-04 19:05:46 +02:00
/// Start the network.
2016-11-06 12:51:53 +01:00
///
2017-02-01 10:58:09 +01:00
/// @deprecated - Use `set_mode("active")` instead.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_startNetwork " ) ]
2017-11-14 11:38:17 +01:00
fn start_network ( & self ) -> Result < bool > ;
2016-07-11 17:02:42 +02:00
2016-10-04 19:05:46 +02:00
/// Stop the network.
2016-10-31 16:58:35 +01:00
///
2017-02-01 10:58:09 +01:00
/// @deprecated - Use `set_mode("offline")` instead.
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_stopNetwork " ) ]
2017-11-14 11:38:17 +01:00
fn stop_network ( & self ) -> Result < bool > ;
2016-10-31 16:58:35 +01:00
2016-11-05 10:38:00 +01:00
/// Set the mode. Argument must be one of: "active", "passive", "dark", "offline".
2016-11-06 12:51:53 +01:00
#[ rpc(name = " parity_setMode " ) ]
2017-11-14 11:38:17 +01:00
fn set_mode ( & self , String ) -> Result < bool > ;
2016-11-06 12:51:53 +01:00
2018-01-05 13:49:07 +01:00
/// Set the network spec. Argument must be one of: "foundation", "ropsten", "morden", "kovan", "olympic", "classic", "dev", "expanse", "musicoin" or a filename.
2017-03-13 12:10:53 +01:00
#[ rpc(name = " parity_setChain " ) ]
2017-11-14 11:38:17 +01:00
fn set_spec_name ( & self , String ) -> Result < bool > ;
2017-03-13 12:10:53 +01:00
2016-11-06 12:51:53 +01:00
/// Hash a file content under given URL.
2017-10-05 12:35:01 +02:00
#[ rpc(name = " parity_hashContent " ) ]
2017-11-14 11:38:17 +01:00
fn hash_content ( & self , String ) -> BoxFuture < H256 > ;
2016-12-12 02:57:19 +01:00
/// Is there a release ready for install?
#[ rpc(name = " parity_upgradeReady " ) ]
2017-11-14 11:38:17 +01:00
fn upgrade_ready ( & self ) -> Result < Option < ReleaseInfo > > ;
2016-12-12 02:57:19 +01:00
/// Execute a release which is ready according to upgrade_ready().
#[ rpc(name = " parity_executeUpgrade " ) ]
2017-11-14 11:38:17 +01:00
fn execute_upgrade ( & self ) -> Result < bool > ;
2017-03-19 08:46:51 +01:00
/// Removes transaction from transaction queue.
/// Makes sense only for transactions that were not propagated to other peers yet
/// like scheduled transactions or transactions in future.
/// It might also work for some local transactions with to low gas price
/// or excessive gas limit that are not accepted by other peers whp.
/// Returns `true` when transaction was removed, `false` if it was not found.
#[ rpc(name = " parity_removeTransaction " ) ]
2017-11-14 11:38:17 +01:00
fn remove_transaction ( & self , H256 ) -> Result < Option < Transaction > > ;
2016-06-07 22:52:48 +02:00
}
2016-11-06 12:51:53 +01:00
}