Closed slyofzero closed 8 months ago
I am following the example given here about the WSS method of blockSubscribe, to get data about the news blocks and the transactions in them.
Below is my implementation in JS -
socket.addEventListener("open", () => { const subscribeMessage = { jsonrpc: "2.0", id: "1", method: "blockSubscribe", params: [{ filter: "all" }], }; console.log("WSS stream started"); const messageString = JSON.stringify(subscribeMessage); socket.send(messageString); });
Response I get -
[Symbol(kType)]: 'message', [Symbol(kData)]: '{"id":"1","jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid/Unspported params for blockSubscribe."}}'
I am using the alchemy mainnet RPC for creating this WSS connection.
const subscribeMessage = { jsonrpc: "2.0", id: "1", method: "blockSubscribe", params: ["all"], };
Closing as this seems not related to solana-go.
I am following the example given here about the WSS method of blockSubscribe, to get data about the news blocks and the transactions in them.
Below is my implementation in JS -
Response I get -
I am using the alchemy mainnet RPC for creating this WSS connection.