For the complete documentation index, see llms.txt. This page is also available as Markdown.

PeerNetworkId

Enum representing the peer network ID. Used for broadcasting to the P2P network and can be used to determine the parent of a subnet.


Usage

import { PeerNetworkId } from '@stacks/network';

if (network.peerNetworkId === PeerNetworkId.Mainnet) {
  console.log('Connected to mainnet peer network');
}

Notes

  • For mainnet/testnet, the v2/info response .network_id refers to the chain ID, not the peer network ID.

  • For subnets, .network_id refers to the peer network ID.

  • The .parent_network_id refers to the actual peer network ID of the parent in both cases.

Reference Link


Definition

enum PeerNetworkId {
  Mainnet = 0x17000000,
  Testnet = 0xff000000,
}

Values

Value
Number
Description

Mainnet

0x17000000

Mainnet peer network ID

Testnet

0xff000000

Testnet peer network ID

Last updated

Was this helpful?