The server node is a Node.js server-based component for interacting with the Connext network. The server node manages its private key that it uses for signing channel messages.
Use the following Docker commands to run as a single container using SQLite.
To use PostgreSQL, the node needs to be run in a docker-compose stack. A production-ready example can be found here: https://github.com/connext/vector-router-docker-compose/blob/main/docker-compose.node.yml#L0-L1
To subscribe to the server-node's event emitter, the JS client uses webhooks. A program that wants to listen for the server-node's events needs to implement an HTTP server that can accept POST requests which the server-node POSTs to when events are generated. The JS client uses a mapping of EVTs which should be posted to when the HTTP request is received to allow for more powerful filtering capabilities behind an easy to use interface.
A full example can be found in the implementation of the router module, here are relevant snippets:
The node process is configurable via the node.config.json file.
Allows access to admin-only methods
Specifies the URL to use to connect to each chain's provider, keyed by chainId
debug, info, warn, or error
Specifies the maximum log level that will be printed
The url used to access the messaging service. In production, use https://messaging.connext.network.
If provided, the node will use this mnemonic. If not provided, the node will use a hard coded mnemonic with testnet funds in dev-mode (production=false). If not provided in prod, docker secrets will be used to manage the mnemonic; this is a much safer place to store a mnemonic that eg holds mainnet funds.
The port number on which the stack should be exposed to the outside world.