Skip to content

request

request(options): Promise<StatusMap>

Defined in: packages/core/src/agent/subnetStatus/index.ts:94

Requests information from a subnet’s read_state endpoint. Can be used to request information about the subnet’s time, canister ranges, public key, node keys, and metrics.

SubnetStatusOptions

The configuration for the subnet status request.

Promise<StatusMap>

A map populated with data from the requested paths. Each path is a key in the map, and the value is the data obtained from the certificate for that path.

SubnetStatusOptions for detailed options.

const status = await subnetStatus.request({
subnetId: IC_ROOT_SUBNET_ID,
paths: ['time', 'nodeKeys'],
agent,
});
const time = status.get('time');
const nodeKeys = status.get('nodeKeys');