pub struct RpcImpl {
pub pos_handler: Arc<PosVerifier>,
/* private fields */
}
Fields§
§pos_handler: Arc<PosVerifier>
Implementations§
source§impl RpcImpl
impl RpcImpl
pub fn new( exit: Arc<(Mutex<bool>, Condvar)>, consensus: SharedConsensusGraph, network: Arc<NetworkService>, tx_pool: SharedTransactionPool, accounts: Arc<AccountProvider>, pos_verifier: Arc<PosVerifier> ) -> Self
source§impl RpcImpl
impl RpcImpl
pub fn best_block_hash(&self) -> JsonRpcResult<H256>
pub fn gas_price(&self) -> CoreResult<U256>
pub fn epoch_number( &self, epoch_num: Option<EpochNumber> ) -> JsonRpcResult<U256>
pub fn block_by_epoch_number( &self, epoch_num: EpochNumber, include_txs: bool ) -> CoreResult<Option<RpcBlock>>
pub fn get_pos_reward_by_epoch( &self, epoch: EpochNumber ) -> JsonRpcResult<Option<PoSEpochReward>>
pub fn confirmation_risk_by_hash( &self, block_hash: H256 ) -> JsonRpcResult<Option<U256>>
pub fn block_by_hash( &self, hash: H256, include_txs: bool ) -> CoreResult<Option<RpcBlock>>
pub fn block_by_hash_with_pivot_assumption( &self, block_hash: H256, pivot_hash: H256, epoch_number: U64 ) -> CoreResult<RpcBlock>
pub fn block_by_block_number( &self, block_number: U64, include_txs: bool ) -> CoreResult<Option<RpcBlock>>
pub fn blocks_by_epoch(&self, num: EpochNumber) -> JsonRpcResult<Vec<H256>>
pub fn skipped_blocks_by_epoch( &self, num: EpochNumber ) -> JsonRpcResult<Vec<H256>>
pub fn next_nonce( &self, address: RpcAddress, num: Option<BlockHashOrEpochNumber> ) -> CoreResult<U256>
pub fn fee_history( &self, block_count: HexU64, newest_block: EpochNumber, reward_percentiles: Option<Vec<f64>> ) -> CoreResult<CfxFeeHistory>
pub fn max_priority_fee_per_gas(&self) -> CoreResult<U256>
source§impl RpcImpl
impl RpcImpl
pub fn add_latency(&self, id: NodeId, latency_ms: f64) -> JsonRpcResult<()>
pub fn add_peer( &self, node_id: NodeId, address: SocketAddr ) -> JsonRpcResult<()>
pub fn chain(&self) -> CoreResult<Vec<RpcBlock>>
pub fn drop_peer( &self, node_id: NodeId, address: SocketAddr ) -> JsonRpcResult<()>
pub fn get_block_count(&self) -> JsonRpcResult<u64>
pub fn get_goodput(&self) -> JsonRpcResult<String>
pub fn get_nodeid(&self, challenge: Vec<u8>) -> JsonRpcResult<Vec<u8>>
pub fn get_peer_info(&self) -> JsonRpcResult<Vec<PeerInfo>>
pub fn get_status(&self) -> CoreResult<RpcStatus>
pub fn say_hello(&self) -> JsonRpcResult<String>
pub fn stop(&self) -> JsonRpcResult<()>
pub fn pos_register( &self, voting_power: U64, version: Option<u8> ) -> JsonRpcResult<(Bytes, AccountAddress)>
pub fn pos_update_voting_power( &self, _pos_account: AccountAddress, _increased_voting_power: U64 ) -> JsonRpcResult<()>
pub fn pos_stop_election(&self) -> JsonRpcResult<Option<u64>>
pub fn pos_start_voting(&self, initialize: bool) -> CoreResult<()>
pub fn pos_stop_voting(&self) -> CoreResult<()>
pub fn pos_voting_status(&self) -> CoreResult<bool>
pub fn pos_start(&self) -> CoreResult<()>
pub fn pos_force_vote_proposal(&self, block_id: H256) -> CoreResult<()>
pub fn pos_force_propose( &self, round: U64, parent_block_id: H256, payload: Vec<TransactionPayload> ) -> CoreResult<()>
pub fn pos_trigger_timeout(&self, timeout_type: String) -> CoreResult<()>
pub fn pos_force_sign_pivot_decision( &self, block_hash: H256, height: U64 ) -> CoreResult<()>
pub fn pos_get_chosen_proposal(&self) -> CoreResult<Option<RpcPosBlock>>
source§impl RpcImpl
impl RpcImpl
pub fn txpool_clear(&self) -> JsonRpcResult<()>
pub fn net_node(&self, id: NodeId) -> JsonRpcResult<Option<(String, Node)>>
pub fn net_disconnect_node( &self, id: NodeId, op: Option<UpdateNodeOperation> ) -> JsonRpcResult<bool>
pub fn net_sessions( &self, node_id: Option<NodeId> ) -> JsonRpcResult<Vec<SessionDetails>>
pub fn net_throttling(&self) -> JsonRpcResult<Service>
pub fn txpool_tx_with_pool_info( &self, hash: H256 ) -> JsonRpcResult<TxWithPoolInfo>
pub fn txpool_get_account_transactions( &self, address: RpcAddress ) -> CoreResult<Vec<RpcTransaction>>
pub fn txpool_transaction_by_address_and_nonce( &self, address: RpcAddress, nonce: U256 ) -> CoreResult<Option<RpcTransaction>>
pub fn txpool_content( &self, address: Option<RpcAddress> ) -> CoreResult<BTreeMap<String, BTreeMap<String, BTreeMap<usize, Vec<RpcTransaction>>>>>
pub fn txpool_inspect( &self, address: Option<RpcAddress> ) -> CoreResult<BTreeMap<String, BTreeMap<String, BTreeMap<usize, Vec<String>>>>>
pub fn txpool_status(&self) -> JsonRpcResult<TxPoolStatus>
pub fn accounts(&self) -> CoreResult<Vec<RpcAddress>>
pub fn new_account(&self, password: String) -> CoreResult<RpcAddress>
pub fn unlock_account( &self, address: RpcAddress, password: String, duration: Option<U128> ) -> CoreResult<bool>
pub fn lock_account(&self, address: RpcAddress) -> CoreResult<bool>
pub fn sign( &self, data: Bytes, address: RpcAddress, password: Option<String> ) -> CoreResult<H520>
pub fn save_node_db(&self) -> JsonRpcResult<()>
pub fn get_client_version(&self) -> JsonRpcResult<String>
pub fn txpool_pending_nonce_range( &self, address: RpcAddress ) -> CoreResult<TxPoolPendingNonceRange>
pub fn txpool_next_nonce(&self, address: RpcAddress) -> CoreResult<U256>
pub fn account_pending_info( &self, address: RpcAddress ) -> CoreResult<Option<AccountPendingInfo>>
pub fn account_pending_transactions( &self, address: RpcAddress, maybe_start_nonce: Option<U256>, maybe_limit: Option<U64> ) -> CoreResult<AccountPendingTransactions>
Auto Trait Implementations§
impl !RefUnwindSafe for RpcImpl
impl Send for RpcImpl
impl Sync for RpcImpl
impl Unpin for RpcImpl
impl !UnwindSafe for RpcImpl
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Conv for T
impl<T> Conv for T
source§impl<T> ElementSatisfy<ElementNoConstrain> for T
impl<T> ElementSatisfy<ElementNoConstrain> for T
fn to_constrain_object(&self) -> &ElementNoConstrain
fn to_constrain_object_mut(&mut self) -> &mut ElementNoConstrain
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.