[−][src]Struct exonum::blockchain::Blockchain
Shared Exonum blockchain instance.
This is essentially a smart pointer to shared blockchain resources (storage,
cryptographic keys, and a sender of transactions). It can be converted into a BlockchainMut
instance, which combines these resources with behavior (i.e., a set of services).
Methods
impl Blockchain
[src]
pub fn new(
database: impl Into<Arc<dyn Database>>,
service_keypair: (PublicKey, SecretKey),
api_sender: ApiSender
) -> Self
[src]
database: impl Into<Arc<dyn Database>>,
service_keypair: (PublicKey, SecretKey),
api_sender: ApiSender
) -> Self
Constructs a blockchain for the given database
.
pub fn build_for_tests() -> Self
[src]
Creates a non-persisting blockchain, all data in which is irrevocably lost on drop.
The created blockchain cannot send transactions; an attempt to do so will result in an error.
pub fn snapshot(&self) -> Box<dyn Snapshot>
[src]
Creates a read-only snapshot of the current storage state.
pub fn last_hash(&self) -> Hash
[src]
pub fn last_block(&self) -> Block
[src]
Returns the latest committed block.
pub fn pool_size(&self) -> u64
[src]
Returns the transactions pool size.
pub fn get_saved_peers(&self) -> HashMap<PublicKey, Verified<Connect>>
[src]
Returns Connect
messages from peers saved in the cache, if any.
pub fn sender(&self) -> &ApiSender
[src]
Returns reference to the transactions sender.
pub fn service_keypair(&self) -> &(PublicKey, SecretKey)
[src]
Returns reference to the service key pair of the current node.
Trait Implementations
impl AsRef<Blockchain> for BlockchainMut
[src]
fn as_ref(&self) -> &Blockchain
[src]
impl Clone for Blockchain
[src]
fn clone(&self) -> Blockchain
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Blockchain
[src]
Auto Trait Implementations
impl Send for Blockchain
impl Sync for Blockchain
impl Unpin for Blockchain
impl !UnwindSafe for Blockchain
impl !RefUnwindSafe for Blockchain
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,