2020-09-22 14:53:52 +02:00
|
|
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
|
|
|
// This file is part of OpenEthereum.
|
2016-06-07 22:52:48 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
// OpenEthereum is free software: you can redistribute it and/or modify
|
2016-06-07 22:52:48 +02:00
|
|
|
// 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.
|
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
// OpenEthereum is distributed in the hope that it will be useful,
|
2016-06-07 22:52:48 +02:00
|
|
|
// 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
|
2020-09-22 14:53:52 +02:00
|
|
|
// along with OpenEthereum. If not, see <http://www.gnu.org/licenses/>.
|
2016-06-07 22:52:48 +02:00
|
|
|
|
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
|
|
|
|
2019-02-25 14:27:28 +01:00
|
|
|
use ethereum_types::{H160, H256, U256};
|
2017-11-14 11:38:17 +01:00
|
|
|
use jsonrpc_core::{BoxFuture, Result};
|
2019-02-05 14:31:19 +01:00
|
|
|
use jsonrpc_derive::rpc;
|
2016-06-07 22:52:48 +02:00
|
|
|
|
2020-08-14 12:24:16 +02:00
|
|
|
use v1::types::{Bytes, Transaction};
|
2016-06-07 22:52:48 +02:00
|
|
|
|
2019-02-07 14:34:24 +01:00
|
|
|
/// Parity-specific rpc interface for operations altering the account-related settings.
|
2019-11-11 21:57:38 +01:00
|
|
|
#[rpc(server)]
|
2019-02-07 14:34:24 +01:00
|
|
|
pub trait ParitySetAccounts {
|
|
|
|
/// Sets account for signing consensus messages.
|
|
|
|
#[rpc(name = "parity_setEngineSigner")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_engine_signer(&self, _: H160, _: String) -> Result<bool>;
|
2019-02-07 14:34:24 +01:00
|
|
|
}
|
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Parity-specific rpc interface for operations altering the settings.
|
2019-11-11 21:57:38 +01:00
|
|
|
#[rpc(server)]
|
2019-02-05 14:31:19 +01:00
|
|
|
pub trait ParitySet {
|
|
|
|
/// Sets new minimal gas price for mined blocks.
|
|
|
|
#[rpc(name = "parity_setMinGasPrice")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_min_gas_price(&self, _: U256) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Sets new gas floor target for mined blocks.
|
|
|
|
#[rpc(name = "parity_setGasFloorTarget")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_gas_floor_target(&self, _: U256) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Sets new gas ceiling target for mined blocks.
|
|
|
|
#[rpc(name = "parity_setGasCeilTarget")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_gas_ceil_target(&self, _: U256) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Sets new extra data for mined blocks.
|
|
|
|
#[rpc(name = "parity_setExtraData")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_extra_data(&self, _: Bytes) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Sets new author for mined block.
|
|
|
|
#[rpc(name = "parity_setAuthor")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_author(&self, _: H160) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-07 14:34:24 +01:00
|
|
|
/// Sets the secret of engine signer account.
|
|
|
|
#[rpc(name = "parity_setEngineSignerSecret")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_engine_signer_secret(&self, _: H256) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Sets the limits for transaction queue.
|
|
|
|
#[rpc(name = "parity_setTransactionsLimit")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_transactions_limit(&self, _: usize) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Sets the maximum amount of gas a single transaction may consume.
|
|
|
|
#[rpc(name = "parity_setMaxTransactionGas")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_tx_gas_limit(&self, _: U256) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Add a reserved peer.
|
|
|
|
#[rpc(name = "parity_addReservedPeer")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn add_reserved_peer(&self, _: String) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Remove a reserved peer.
|
|
|
|
#[rpc(name = "parity_removeReservedPeer")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn remove_reserved_peer(&self, _: String) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Drop all non-reserved peers.
|
|
|
|
#[rpc(name = "parity_dropNonReservedPeers")]
|
|
|
|
fn drop_non_reserved_peers(&self) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Accept non-reserved peers (default behavior)
|
|
|
|
#[rpc(name = "parity_acceptNonReservedPeers")]
|
|
|
|
fn accept_non_reserved_peers(&self) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Start the network.
|
|
|
|
///
|
|
|
|
/// @deprecated - Use `set_mode("active")` instead.
|
|
|
|
#[rpc(name = "parity_startNetwork")]
|
|
|
|
fn start_network(&self) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Stop the network.
|
|
|
|
///
|
|
|
|
/// @deprecated - Use `set_mode("offline")` instead.
|
|
|
|
#[rpc(name = "parity_stopNetwork")]
|
|
|
|
fn stop_network(&self) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Set the mode. Argument must be one of: "active", "passive", "dark", "offline".
|
|
|
|
#[rpc(name = "parity_setMode")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_mode(&self, _: String) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Set the network spec. Argument must be one of pre-configured chains or a filename.
|
|
|
|
#[rpc(name = "parity_setChain")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn set_spec_name(&self, _: String) -> Result<bool>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +01:00
|
|
|
/// Hash a file content under given URL.
|
|
|
|
#[rpc(name = "parity_hashContent")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn hash_content(&self, _: String) -> BoxFuture<H256>;
|
2020-08-05 06:08:03 +02:00
|
|
|
|
2019-02-05 14:31:19 +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")]
|
2019-11-11 21:57:38 +01:00
|
|
|
fn remove_transaction(&self, _: H256) -> Result<Option<Transaction>>;
|
2016-11-06 12:51:53 +01:00
|
|
|
}
|