Struct grin_api::Foreign [−][src]
pub struct Foreign<B, P, V> where
B: BlockChain,
P: PoolAdapter,
V: VerifierCache + 'static, { pub peers: Weak<Peers>, pub chain: Weak<Chain>, pub tx_pool: Weak<RwLock<TransactionPool<B, P, V>>>, pub sync_state: Weak<SyncState>, }
Expand description
Fields
peers: Weak<Peers>chain: Weak<Chain>tx_pool: Weak<RwLock<TransactionPool<B, P, V>>>sync_state: Weak<SyncState>Implementations
Create a new API instance with the chain, transaction pool, peers and sync_state. All subsequent
API calls will operate on this instance of node API.
Arguments
peers- A non-owning reference of the peers.chain- A non-owning reference of the chain.tx_pool- A non-owning reference of the transaction pool.peers- A non-owning reference of the peers.sync_state- A non-owning reference of thesync_state.
Returns
- An instance of the Node holding references to the current chain, transaction pool, peers and sync_state.
pub fn get_header(
&self,
height: Option<u64>,
hash: Option<Hash>,
commit: Option<String>
) -> Result<BlockHeaderPrintable, Error>
[src]
pub fn get_header(
&self,
height: Option<u64>,
hash: Option<Hash>,
commit: Option<String>
) -> Result<BlockHeaderPrintable, Error>
[src]Gets block header given either a height, a hash or an unspent output commitment. Only one parameters is needed. If multiple parameters are provided only the first one in the list is used.
Arguments
height- block height.hash- block hash.commit- output commitment.
Returns
- Result Containing:
- A
BlockHeaderPrintable - or
Errorif an error is encountered.
Gets block details given either a height, a hash or an unspent output commitment. Only one parameters is needed. If multiple parameters are provided only the first one in the list is used.
Arguments
height- block height.hash- block hash.commit- output commitment.include_proof- include range proofs for outputs. Default: falseinclude_merkle_proof- include merkle proofs (for unspent coinbase outputs). Default: false
Returns
- Result Containing:
- A
BlockPrintable - or
Errorif an error is encountered.
pub fn get_kernel(
&self,
excess: String,
min_height: Option<u64>,
max_height: Option<u64>
) -> Result<LocatedTxKernel, Error>
[src]
pub fn get_kernel(
&self,
excess: String,
min_height: Option<u64>,
max_height: Option<u64>
) -> Result<LocatedTxKernel, Error>
[src]Returns a LocatedTxKernel based on the kernel excess.
The min_height and max_height parameters are both optional.
If not supplied, min_height will be set to 0 and max_height will be set to the head of the chain.
The method will start at the block height max_height and traverse the kernel MMR backwards,
until either the kernel is found or min_height is reached.
Arguments
excess- kernel excess to look for.min_height- minimum height to stop the lookup.max_height- maximum height to start the lookup.
Returns
- Result Containing:
- A
LocatedTxKernel - or
Errorif an error is encountered.
Retrieves details about specifics outputs. Supports retrieval of multiple outputs in a single request. Support retrieval by both commitment string and block height.
Arguments
commits- a vector of unspent output commitments.start_height- start height to start the lookup.end_height- end height to stop the lookup.include_proof- whether or not to include the range proof in the response.include_merkle_proof- whether or not to include the merkle proof in the response.
Returns
- Result Containing:
- An
OutputPrintable - or
Errorif an error is encountered.
UTXO traversal. Retrieves last utxos since a start_index until a max.
Arguments
start_index- start index in the MMR.end_index- optional index so stop in the MMR.max- max index in the MMR.include_proof- whether or not to include the range proof in the response.
Returns
- Result Containing:
- An
OutputListing - or
Errorif an error is encountered.
pub fn get_pmmr_indices(
&self,
start_block_height: u64,
end_block_height: Option<u64>
) -> Result<OutputListing, Error>
[src]
pub fn get_pmmr_indices(
&self,
start_block_height: u64,
end_block_height: Option<u64>
) -> Result<OutputListing, Error>
[src]Retrieves the PMMR indices based on the provided block height(s).
Arguments
start_block_height- start index in the MMR.end_block_height- optional index so stop in the MMR.
Returns
- Result Containing:
- An
OutputListing - or
Errorif an error is encountered.
Get TOR address on this node. Return none if TOR is not running.
Trait Implementations
impl<B, P, V> ForeignRpc for Foreign<B, P, V> where
B: BlockChain,
P: PoolAdapter,
V: VerifierCache + 'static,
[src]
impl<B, P, V> ForeignRpc for Foreign<B, P, V> where
B: BlockChain,
P: PoolAdapter,
V: VerifierCache + 'static,
[src]Networked version of Foreign::get_header. Read more
Networked version of Foreign::get_block. Read more
Networked version with all parameters of Foreign::get_block. Read more
Networked version of Foreign::get_version. Read more
fn get_kernel(
&self,
excess: String,
min_height: Option<u64>,
max_height: Option<u64>
) -> Result<LocatedTxKernel, ErrorKind>
[src]
fn get_kernel(
&self,
excess: String,
min_height: Option<u64>,
max_height: Option<u64>
) -> Result<LocatedTxKernel, ErrorKind>
[src]Networked version of Foreign::get_kernel. Read more
Networked version of Foreign::get_outputs. Read more
Networked version of Foreign::get_unspent_outputs. Read more
fn get_pmmr_indices(
&self,
start_block_height: u64,
end_block_height: Option<u64>
) -> Result<OutputListing, ErrorKind>
[src]
fn get_pmmr_indices(
&self,
start_block_height: u64,
end_block_height: Option<u64>
) -> Result<OutputListing, ErrorKind>
[src]Networked version of Foreign::get_pmmr_indices. Read more
Networked version of Foreign::get_pool_size. Read more
Networked version of Foreign::get_stempool_size. Read more
Networked version of Foreign::get_unconfirmed_transactions. Read more
Networked version of Foreign::push_transaction. Read more
Networked version of Owner::get_libp2p_peers. Read more
Networked version of Owner::get_libp2p_messages. Read more
Auto Trait Implementations
impl<B, P, V> !RefUnwindSafe for Foreign<B, P, V>
impl<B, P, V> !UnwindSafe for Foreign<B, P, V>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
impl<T> SafeBorrow<T> for T where
T: ?Sized,
impl<T> SafeBorrow<T> for T where
T: ?Sized,
pub fn borrow_replacement(ptr: &T) -> &T
pub fn borrow_replacement(ptr: &T) -> &T
Given ptr, which was obtained from a prior call to Self::borrow(),
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self. Read more
type Output = T
type Output = T
Should always be Self