Expand description
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.
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 - peer
- socks
- A wrapper around a TCP stream that handles the SOCKS5 handshake. This module only
drives the handshake and returns the stream back to the caller. It does not
perform any I/O on the stream after the handshake is complete. The caller is
responsible for performing I/O on the stream.
This module is built on top of the
futurescrate instead of an specific async runtime. This allows the caller to use this module with any async runtime they want. - transport
Structs§
- Utreexo
Node Config - Configuration for the Utreexo node.