Classes

ClientConfiguration

Use this to provide initialization-time configuration to the Client. This is a simplified version of the configuration that is used for regular nodes, since not all configuration knobs are available when running inside a browser.

Constructors

new ClientConfiguration()

new ClientConfiguration(): [ClientConfiguration](ClientConfiguration)

Creates a default client configuration that can be used to change the client's configuration.

Use its instantiateClient() method to launch the client and connect to the network.

Methods

build()

build(): [PlainClientConfiguration](../interfaces/PlainClientConfiguration)

Returns a plain configuration object to be passed to Client.create.


desiredPeerCount()

desiredPeerCount(`desired_peer_count`): `void`

Sets the desired number of peers the client should try to connect to. Default is 12.

ParameterType
Firstnumber

free()

free(): `void`

logLevel()

logLevel(`log_level`): `void`

Sets the log level that is used when logging to the console.

Possible values are 'trace' | 'debug' | 'info' | 'warn' | 'error'. Default is 'info'.

ParameterType
Firststring

network()

network(`network`): `void`

Sets the network ID the client should use. Input is case-insensitive.

Possible values are 'MainAlbatross' | 'TestAlbatross' | 'DevAlbatross'. Default is 'MainAlbatross'.

ParameterType
Firststring

onlySecureWsConnections()

onlySecureWsConnections(`only_secure_ws_connections`): `void`

Sets whether the client should only connect to secure WebSocket connections. Default is true.

ParameterType
Firstboolean

peerCountMax()

peerCountMax(`peer_count_max`): `void`

Sets the maximum number of peers the client should connect to. Default is 50.

ParameterType
Firstnumber

peerCountPerIpMax()

peerCountPerIpMax(`peer_count_per_ip_max`): `void`

Sets the maximum number of peers the client should connect to per IP address. Default is 10.

ParameterType
Firstnumber

peerCountPerSubnetMax()

peerCountPerSubnetMax(`peer_count_per_subnet_max`): `void`

Sets the maximum number of peers the client should connect to per subnet. Default is 10.

ParameterType
Firstnumber

seedNodes()

seedNodes(`seeds`): `void`

Sets the list of seed nodes that are used to connect to the Nimiq Albatross network.

Each array entry must be a proper Multiaddr format string.

ParameterType
Firstany[]

On this page