Required a WebSocket RPC for Polygon-Edge Chain #509
-
Required a WebSocket RPC for Polygon-Edge ChainDescriptionI am making a block explorer of a chain that I have made using Polygon Edge and I require a WebSocket RPC URL for Block Explorer so it can auto reload the information |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello @rahul-spirit Here are the basic steps for instantiating a WS connection: You can use this tool for testing WS quickly: By default when you run the polygon SDK, it sets up the WS interface, so there is no need to additionally configure it Opening a WS connection with websocat tool:
👆 This is for a localhost where the HTTP port is 8545. Notice the /ws at the end. After you’ve opened up the WS connection, you can query it like the regular JSON RPC, by sending a json request to the open connection, for example:
Let me know how that goes and whether you need any further assistance. |
Beta Was this translation helpful? Give feedback.
Hello @rahul-spirit
Here are the basic steps for instantiating a WS connection:
You can use this tool for testing WS quickly:
https://github.com/vi/websocat
By default when you run the polygon SDK, it sets up the WS interface, so there is no need to additionally configure it
Opening a WS connection with websocat tool:
👆
This is for a localhost where the HTTP port is 8545. Notice the /ws at the end.
After you’ve opened up the WS connection, you can query it like the regular JSON RPC, by sending a json request to the open connection, for example:
Let me know how that goes and whether you nee…