xrpld
Loading...
Searching...
No Matches
xrpl::NetworkIDService Class Referenceabstract

Service that provides access to the network ID. More...

#include <NetworkIDService.h>

Inheritance diagram for xrpl::NetworkIDService:

Public Member Functions

virtual ~NetworkIDService ()=default
virtual std::uint32_t getNetworkID () const noexcept=0
 Get the configured network ID.

Detailed Description

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)

Definition at line 20 of file NetworkIDService.h.

Constructor & Destructor Documentation

◆ ~NetworkIDService()

virtual xrpl::NetworkIDService::~NetworkIDService ( )
virtualdefault

Member Function Documentation

◆ getNetworkID()

virtual std::uint32_t xrpl::NetworkIDService::getNetworkID ( ) const
nodiscardpure virtualnoexcept

Get the configured network ID.

Returns
The network ID this server is configured for

Implemented in xrpl::NetworkIDServiceImpl, and xrpl::test::TestNetworkIDService.