Files
rippled/include/xrpl/core/NetworkIDService.h
2026-01-14 15:51:11 +00:00

37 lines
844 B
C++

#ifndef XRPL_CORE_NETWORKIDSERVICE_H_INCLUDED
#define XRPL_CORE_NETWORKIDSERVICE_H_INCLUDED
#include <cstdint>
namespace xrpl {
/** Service that provides access to the network ID.
This service provides read-only access to the network ID configured
for this server. The network ID identifies which network (mainnet,
testnet, devnet, or custom network) this server is configured to
connect to.
Well-known network IDs:
- 0: Mainnet
- 1: Testnet
- 2: Devnet
- 1025+: Custom networks (require NetworkID field in transactions)
*/
class NetworkIDService
{
public:
virtual ~NetworkIDService() = default;
/** Get the configured network ID
*
* @return The network ID this server is configured for
*/
virtual std::uint32_t
getNetworkID() const = 0;
};
} // namespace xrpl
#endif