Skip to content

Add WebSocket support

Dagur Valberg Johannsson requested to merge github/fork/dagurval/ws into master

Created by: dagurval

This adds experimental websocket support on ports 50003 for mainnet, 60003 for testnet.

It is currently implemented by proxying websocket connections to our RPC listening interface. It's implemented with code from the wstcp project.

Ideally we should not be proxying, but rather responding to RPC requests directly on the websocket socket. This is the end goal, but requires more refactoring. This PR is first step towards good websocket support.

Test plan:

./contrib/run_functional_tests.sh

A websocket client has been added to contrib/websocket-client.

websocket-client % node cli.js blockchain.address.get_balance bitcoincash:prnc2exht3zxlrqqcat690tc85cvfuypngh7szx6mk
{ confirmed: 217784148852, unconfirmed: 0 }

The PR is deployed on bitcoincash.network. When all instances of bch.imaginary.cash with bitcoincash.network in the electrum-cash integration test, the tests pass.

Merge request reports