Using Websockets with Web3
Web3 can connect to our Ethereum node using Websockets. Websockets will let us keep a two-way connection open between our browser and our client. This means that our geth node will be able to push real-time updates to our browser.
We'll use this on our page to instantly draw any pixels that are purchased.
In order to use Websockets with
geth, we need to add some parameters to our
geth command. They look like the flags we used for
rpc only they begin with
ws. Here's the command, which you can copy and paste from the video notes: