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()
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.
Returns |
---|
ClientConfiguration |
Methods
build()
Returns a plain configuration object to be passed to Client.create
.
Returns |
---|
PlainClientConfiguration |
desiredPeerCount()
Sets the desired number of peers the client should try to connect to.
Default is 12
.
Parameter | Type |
---|---|
First | number |
free()
logLevel()
Sets the log level that is used when logging to the console.
Possible values are 'trace' | 'debug' | 'info' | 'warn' | 'error'
.
Default is 'info'
.
Parameter | Type |
---|---|
First | string |
network()
Sets the network ID the client should use. Input is case-insensitive.
Possible values are 'MainAlbatross' | 'TestAlbatross' | 'DevAlbatross'
.
Default is 'MainAlbatross'
.
Parameter | Type |
---|---|
First | string |
onlySecureWsConnections()
Sets whether the client should only connect to secure WebSocket connections.
Default is true
.
Parameter | Type |
---|---|
First | boolean |
peerCountMax()
Sets the maximum number of peers the client should connect to.
Default is 50
.
Parameter | Type |
---|---|
First | number |
peerCountPerIpMax()
Sets the maximum number of peers the client should connect to per IP address.
Default is 10
.
Parameter | Type |
---|---|
First | number |
peerCountPerSubnetMax()
Sets the maximum number of peers the client should connect to per subnet.
Default is 10
.
Parameter | Type |
---|---|
First | number |
seedNodes()
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.
Parameter | Type |
---|---|
First | any [] |