Module network
Expand description
Bitcoin network.
The term “network” is overloaded, here Network
refers to the specific
Bitcoin network we are operating on e.g., signet, regtest. The terms
“network” and “chain” are often used interchangeably for this concept.
§Example: encoding a network’s magic bytes
use bitcoin::Network;
use bitcoin::consensus::encode::serialize;
let network = Network::Bitcoin;
let bytes = serialize(&network.magic());
assert_eq!(&bytes[..], &[0xF9, 0xBE, 0xB4, 0xD9]);
Modules§
- as_
core_ arg - Module for serialization/deserialization of network variants into/from Bitcoin Core values
Structs§
- Parse
Network Error - An error in parsing network string.
- Unknown
Chain Hash Error - Error in parsing network from chain hash.
Enums§
- Network
- The cryptocurrency network to act on.
- Network
Kind - What kind of network we are on.