@celo/network-utils"static-node-utils"StaticNodeUtils

Class: StaticNodeUtils

Hierarchy

  • StaticNodeUtils

Index

Methods

Methods

Static getRegionalStaticNodesAsync

getRegionalStaticNodesAsync(networkName: string, region?: undefined | string): Promise‹string›

Defined in static-node-utils.ts:110

Fetches the static nodes (as JSON data) from Google Storage corresponding to the best available region for this caller. If the network is not working, the method will reject the returned promise along with the response data from Google API.

Parameters:

Name Type Description
networkName string Name of the network to fetch config for
region? undefined | string -

Returns: Promise‹string›


Static getStaticNodeRegion

getStaticNodeRegion(networkName: string, tz?: undefined | string): string

Defined in static-node-utils.ts:88

Resolves the best region to use for static node connections.

remarks This method currently uses the interpreter's timezone and the IANA timezone database to establish what region of the world the client is in, then map that to a static list of static node clusters run by cLabs. If the timezone is not set according to the user's location, this method may route them to suboptimal set of static nodes. The resolution method may be replaced in the future.

Parameters:

Name Type Description
networkName string Name of the network to get a region for.
tz? undefined | string -

Returns: string


Static getStaticNodesAsync

getStaticNodesAsync(networkName: string): Promise‹string›

Defined in static-node-utils.ts:123

Fetches the static nodes (as JSON data) from Google Storage. If the network is not working, the method will reject the returned promise along with the response data from Google API.

Parameters:

Name Type Description
networkName string Name of the network to fetch config for

Returns: Promise‹string›


Static getStaticNodesGoogleStorageBucketName

getStaticNodesGoogleStorageBucketName(): string

Defined in static-node-utils.ts:74

Returns: string