Trait massa_api::MassaRpcServer

source ·
pub trait MassaRpcServer: Sized + Send + Sync + 'static {
Show 41 methods // Required methods fn stop_node(&self) -> RpcResult<()>; fn node_sign_message<'life0, 'async_trait>( &'life0 self, arg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = RpcResult<PubkeySig>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn add_staking_secret_keys<'life0, 'async_trait>( &'life0 self, arg: Vec<String>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn execute_read_only_bytecode<'life0, 'async_trait>( &'life0 self, arg: Vec<ReadOnlyBytecodeExecution>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<ExecuteReadOnlyResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn execute_read_only_call<'life0, 'async_trait>( &'life0 self, arg: Vec<ReadOnlyCall>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<ExecuteReadOnlyResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn remove_staking_addresses<'life0, 'async_trait>( &'life0 self, arg: Vec<Address>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_staking_addresses<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<PreHashSet<Address>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_ban_by_ip<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_ban_by_id<'life0, 'async_trait>( &'life0 self, arg: Vec<NodeId>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_peers_whitelist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IpAddr>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_add_to_peers_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_remove_from_peers_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_bootstrap_whitelist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IpAddr>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_bootstrap_whitelist_allow_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_add_to_bootstrap_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_remove_from_bootstrap_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_bootstrap_blacklist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IpAddr>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_add_to_bootstrap_blacklist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_remove_from_bootstrap_blacklist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_unban_by_ip<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn node_unban_by_id<'life0, 'async_trait>( &'life0 self, arg: Vec<NodeId>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<NodeStatus>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_cliques<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Clique>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_stakers<'life0, 'async_trait>( &'life0 self, page_request: Option<PageRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<PagedVec<(Address, u64)>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_operations<'life0, 'async_trait>( &'life0 self, arg: Vec<OperationId>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<OperationInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_endorsements<'life0, 'async_trait>( &'life0 self, arg: Vec<EndorsementId>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<EndorsementInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_blocks<'life0, 'async_trait>( &'life0 self, arg: Vec<BlockId>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<BlockInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_blockclique_block_by_slot<'life0, 'async_trait>( &'life0 self, arg: Slot, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Block>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_graph_interval<'life0, 'async_trait>( &'life0 self, arg: TimeInterval, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<BlockSummary>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_datastore_entries<'life0, 'async_trait>( &'life0 self, arg: Vec<DatastoreEntryInput>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DatastoreEntryOutput>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_addresses<'life0, 'async_trait>( &'life0 self, arg: Vec<Address>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<AddressInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_addresses_bytecode<'life0, 'async_trait>( &'life0 self, args: Vec<AddressFilter>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Vec<u8>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_slots_transfers<'life0, 'async_trait>( &'life0 self, arg: Vec<Slot>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Vec<Transfer>>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send_operations<'life0, 'async_trait>( &'life0 self, arg: Vec<OperationInput>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<OperationId>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_filtered_sc_output_event<'life0, 'async_trait>( &'life0 self, arg: EventFilter, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<SCOutputEvent>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_openrpc_spec<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Value>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_deferred_call_quote<'life0, 'async_trait>( &'life0 self, arg: Vec<DeferredCallsQuoteRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DeferredCallsQuoteResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_deferred_call_info<'life0, 'async_trait>( &'life0 self, arg: Vec<String>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DeferredCallResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_deferred_call_ids_by_slot<'life0, 'async_trait>( &'life0 self, arg: Vec<Slot>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DeferredCallsSlotResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_addresses_datastore_keys<'life0, 'async_trait>( &'life0 self, arg: Vec<GetAddressDatastoreKeysRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<GetAddressDatastoreKeysResponse>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided method fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the MassaRpc RPC API.

Required Methods§

source

fn stop_node(&self) -> RpcResult<()>

Gracefully stop the node.

source

fn node_sign_message<'life0, 'async_trait>( &'life0 self, arg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = RpcResult<PubkeySig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sign message with node’s key. Returns the public key that signed the message and the signature.

source

fn add_staking_secret_keys<'life0, 'async_trait>( &'life0 self, arg: Vec<String>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a vector of new secret(private) keys for the node to use to stake. No confirmation to expect.

source

fn execute_read_only_bytecode<'life0, 'async_trait>( &'life0 self, arg: Vec<ReadOnlyBytecodeExecution>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<ExecuteReadOnlyResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute bytecode in read-only mode.

source

fn execute_read_only_call<'life0, 'async_trait>( &'life0 self, arg: Vec<ReadOnlyCall>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<ExecuteReadOnlyResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute an SC function in read-only mode.

source

fn remove_staking_addresses<'life0, 'async_trait>( &'life0 self, arg: Vec<Address>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove a vector of addresses used to stake. No confirmation to expect.

source

fn get_staking_addresses<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<PreHashSet<Address>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return hash set of staking addresses.

source

fn node_ban_by_ip<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Bans given IP address(es). No confirmation to expect.

source

fn node_ban_by_id<'life0, 'async_trait>( &'life0 self, arg: Vec<NodeId>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Bans given node id. No confirmation to expect.

source

fn node_peers_whitelist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IpAddr>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns node peers whitelist IP address(es).

source

fn node_add_to_peers_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add IP address(es) to node peers whitelist. No confirmation to expect. Note: If the ip was unknown it adds it to the known peers, otherwise it updates the peer type

source

fn node_remove_from_peers_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove from peers whitelist given IP address(es). keep it as standard No confirmation to expect.

source

fn node_bootstrap_whitelist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IpAddr>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns node bootstrap whitelist IP address(es).

source

fn node_bootstrap_whitelist_allow_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Allow everyone to bootstrap from the node. remove bootstrap whitelist configuration file.

source

fn node_add_to_bootstrap_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add IP address(es) to node bootstrap whitelist.

source

fn node_remove_from_bootstrap_whitelist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove IP address(es) to bootstrap whitelist.

source

fn node_bootstrap_blacklist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<IpAddr>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns node bootstrap blacklist IP address(es).

source

fn node_add_to_bootstrap_blacklist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add IP address(es) to node bootstrap blacklist.

source

fn node_remove_from_bootstrap_blacklist<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove IP address(es) to bootstrap blacklist.

source

fn node_unban_by_ip<'life0, 'async_trait>( &'life0 self, arg: Vec<IpAddr>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unban given IP address(es). No confirmation to expect.

source

fn node_unban_by_id<'life0, 'async_trait>( &'life0 self, arg: Vec<NodeId>, ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unban given node id. No confirmation to expect.

source

fn get_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<NodeStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Summary of the current state: time, last final blocks (hash, thread, slot, timestamp), clique count, connected nodes count.

source

fn get_cliques<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Clique>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get cliques.

source

fn get_stakers<'life0, 'async_trait>( &'life0 self, page_request: Option<PageRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<PagedVec<(Address, u64)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the active stakers and their active roll counts for the current cycle.

source

fn get_operations<'life0, 'async_trait>( &'life0 self, arg: Vec<OperationId>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<OperationInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns operation(s) information associated to a given list of operation(s) ID(s).

source

fn get_endorsements<'life0, 'async_trait>( &'life0 self, arg: Vec<EndorsementId>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<EndorsementInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns endorsement(s) information associated to a given list of endorsement(s) ID(s)

source

fn get_blocks<'life0, 'async_trait>( &'life0 self, arg: Vec<BlockId>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<BlockInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns block(s) information associated to a given list of block(s) ID(s)

source

fn get_blockclique_block_by_slot<'life0, 'async_trait>( &'life0 self, arg: Slot, ) -> Pin<Box<dyn Future<Output = RpcResult<Option<Block>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get information on the block at a slot in the blockclique. If there is no block at this slot a None is returned.

source

fn get_graph_interval<'life0, 'async_trait>( &'life0 self, arg: TimeInterval, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<BlockSummary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the block graph within the specified time interval. Optional parameters: from <time_start> (included) and to <time_end> (excluded) millisecond timestamp

source

fn get_datastore_entries<'life0, 'async_trait>( &'life0 self, arg: Vec<DatastoreEntryInput>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DatastoreEntryOutput>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get multiple datastore entries.

source

fn get_addresses<'life0, 'async_trait>( &'life0 self, arg: Vec<Address>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<AddressInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get addresses.

source

fn get_addresses_bytecode<'life0, 'async_trait>( &'life0 self, args: Vec<AddressFilter>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get addresses bytecode.

source

fn get_slots_transfers<'life0, 'async_trait>( &'life0 self, arg: Vec<Slot>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<Vec<Transfer>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all the transfers for a slot

source

fn send_operations<'life0, 'async_trait>( &'life0 self, arg: Vec<OperationInput>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<OperationId>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Adds operations to pool. Returns operations that were ok and sent to pool.

source

fn get_filtered_sc_output_event<'life0, 'async_trait>( &'life0 self, arg: EventFilter, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<SCOutputEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get events optionally filtered by:

  • start slot
  • end slot
  • emitter address
  • original caller address
  • operation id
source

fn get_openrpc_spec<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get OpenRPC specification.

source

fn get_deferred_call_quote<'life0, 'async_trait>( &'life0 self, arg: Vec<DeferredCallsQuoteRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DeferredCallsQuoteResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

DeferredCall quote

source

fn get_deferred_call_info<'life0, 'async_trait>( &'life0 self, arg: Vec<String>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DeferredCallResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

DeferredCall get info

source

fn get_deferred_call_ids_by_slot<'life0, 'async_trait>( &'life0 self, arg: Vec<Slot>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<DeferredCallsSlotResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List deferred calls for given slot

source

fn get_addresses_datastore_keys<'life0, 'async_trait>( &'life0 self, arg: Vec<GetAddressDatastoreKeysRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<GetAddressDatastoreKeysResponse>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get keys gor given address

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§