📍admin.startWS()

Description: Starts a WebSocket RPC server for interacting with the node. Only one WebSocket endpoint can be active at a time.

Parameters

Name

Type

Description

host

string

Network interface to open the listener socket on (defaults to "localhost").

port

hexNumber

Network port to open the listener socket on (defaults to 8545).

cors

string

Cross-Origin Resource Sharing (CORS) header to use (defaults to "").

apis

string

API modules to offer over this interface (defaults to "eth,net,web3").

Returns

Type

Description

boolean

Indicates whether the WebSocket RPC listener was successfully opened.

Last updated