Skip to main content

forest/networks/
network_name.rs

1// Copyright 2019-2026 ChainSafe Systems
2// SPDX-License-Identifier: Apache-2.0, MIT
3
4//! There are two concepts of "network name" in Forest:
5//! 1. [`GenesisNetworkName`]: The network name as defined in the genesis block.
6//!    This is not necessarily the same as the network name that the node is
7//!    currently on.
8//! 2. [`StateNetworkName`]: The network name as defined by the state of the node.
9//!    This is the network name that the node is currently on.
10
11/// The network name as defined in the genesis block.
12/// This is not necessarily the same as the network name that the node is
13/// currently on. This is used by `libp2p` layer and the message pool.
14#[derive(derive_more::Display, derive_more::From, derive_more::Into, derive_more::AsRef)]
15#[from(String, &str)]
16pub struct GenesisNetworkName(String);
17
18/// The network name as defined by the state of the node.
19/// This is the network name that the node is currently on.
20#[derive(derive_more::Display, derive_more::From, derive_more::Into, derive_more::AsRef)]
21#[from(String, &str)]
22pub struct StateNetworkName(String);