2017-01-25 18:51:41 +01:00
|
|
|
// Copyright 2015-2017 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
|
|
|
|
2016-10-04 19:05:46 +02:00
|
|
|
use jsonrpc_core::Error;
|
2017-01-11 20:02:27 +01:00
|
|
|
use futures::BoxFuture;
|
2016-06-07 22:52:48 +02:00
|
|
|
|
2016-12-12 02:57:19 +01:00
|
|
|
use v1::types::{Bytes, H160, H256, U256, ReleaseInfo};
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_min_gas_price(&self, U256) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_gas_floor_target(&self, U256) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_gas_ceil_target(&self, U256) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_extra_data(&self, Bytes) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_author(&self, H160) -> Result<bool, Error>;
|
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")]
|
2016-12-05 22:31:38 +01:00
|
|
|
fn set_engine_signer(&self, H160, String) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_transactions_limit(&self, usize) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn set_tx_gas_limit(&self, U256) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn add_reserved_peer(&self, String) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn remove_reserved_peer(&self, String) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn drop_non_reserved_peers(&self) -> Result<bool, Error>;
|
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")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn accept_non_reserved_peers(&self) -> Result<bool, Error>;
|
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
|
|
|
///
|
2016-10-31 16:58:35 +01:00
|
|
|
/// Deprecated. Use `set_mode("active")` instead.
|
2016-11-06 12:51:53 +01:00
|
|
|
#[rpc(name = "parity_startNetwork")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn start_network(&self) -> Result<bool, Error>;
|
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
|
|
|
///
|
2016-11-05 10:38:00 +01:00
|
|
|
/// Deprecated. Use `set_mode("offline")` instead.
|
2016-11-06 12:51:53 +01:00
|
|
|
#[rpc(name = "parity_stopNetwork")]
|
2016-10-04 19:05:46 +02:00
|
|
|
fn stop_network(&self) -> Result<bool, Error>;
|
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")]
|
2016-10-31 16:58:35 +01:00
|
|
|
fn set_mode(&self, String) -> Result<bool, Error>;
|
2016-11-06 12:51:53 +01:00
|
|
|
|
|
|
|
/// Hash a file content under given URL.
|
|
|
|
#[rpc(async, name = "parity_hashContent")]
|
2017-01-11 20:02:27 +01:00
|
|
|
fn hash_content(&self, String) -> BoxFuture<H256, Error>;
|
2016-12-12 02:57:19 +01:00
|
|
|
|
|
|
|
/// Is there a release ready for install?
|
|
|
|
#[rpc(name = "parity_upgradeReady")]
|
|
|
|
fn upgrade_ready(&self) -> Result<Option<ReleaseInfo>, Error>;
|
|
|
|
|
|
|
|
/// Execute a release which is ready according to upgrade_ready().
|
|
|
|
#[rpc(name = "parity_executeUpgrade")]
|
|
|
|
fn execute_upgrade(&self) -> Result<bool, Error>;
|
2016-06-07 22:52:48 +02:00
|
|
|
}
|
2016-11-06 12:51:53 +01:00
|
|
|
}
|