current position:Home>How to start gananche through websocket

How to start gananche through websocket

2022-02-03 22:48:06 Q & A of Denglian community

gananche How to use websocket start-up ,geth The client can use the --ws Parameter setting however ganache Well ? I haven't found the relevant parameters for a long time

Take the answer 1:

gananche Will start by default WebSocket service .

You can link through the following code ( Pay attention to matching the ports you set )

let web3 = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:8545'))

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.

Random recommended