Expand description
§Floresta Wire
This crate provides the core networking logic for a full node using libfloresta,
including the P2P network and the mempool. You can easily integrate it with any
other crate that provides a BlockchainInterface and UpdatableChainstate
implementation.
A node also gives you a handle that you can use to send messages to the node,
like requesting blocks, mempool transactions or asking to connect with a given
peer.
Re-exports§
pub use rustreexo;
Modules§
- address_
man - Address manager is a module that keeps track of known peer addresses and associated metadata. This module is very important in keeping our node protected against targeted attacks, like eclipse attacks.
- block_
proof - This module defines the structures and methods for handling Utreexo proofs in the context of messaging in the bitcoin network.
- error
- node
- Main file for this blockchain. A node is the central task that runs and handles important events, such as new blocks, peer connection/disconnection, new addresses, etc. A node should not care about peer-specific messages, peers’ll handle things like pings.
- node_
context - During the lifetime of a Bitcoin client, we have a couple of phases that are slightly different
from each other, having to implement their own state-machines and logic for handing requests.
While we could simply put everything in one struct and have a single
implblock, that would create a massive amount of if’s in the code, taking different paths depending on which state are we in. For that reason, we define the basics of a node, like code shared by all the states into one base struct calledUtreexoNode, we then further refine this struct using fine-tunedContexts, that should implement NodeContext and are passed-in as a generic parameter by the caller. - node_
interface - node_interface, which holds
NodeInterfaceand related methods that define the API to interact with the floresta node - p2p_
wire 🔒 - Main module for the p2p chain. This is a blockchain provider, just like cli-chain, but it’s backed by p2p Bitcoin’s p2p network.
Structs§
- Utreexo
Node Config - Configuration for the Utreexo node.
Enums§
- Transport
Protocol - Bitcoin nodes can communicate using different transport layer protocols.
Traits§
- Node
Hooks - NodeHooks is a trait that defines the hooks that a node can use to interact with the network and the blockchain. Every time an event happens, the node will call the corresponding hook.