Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] SubscribeSlotInfo issue #472

Open
NightWuYo opened this issue Nov 27, 2024 · 0 comments
Open

[Bug] SubscribeSlotInfo issue #472

NightWuYo opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@NightWuYo
Copy link

I found that Solnet cannot subscribe Quicknode endpoints (cannot detect results), the difference is, in Quicknode endpoints, 'subscription' field comes first in params, but in api.mainnet-beta.solana.com, 'result' field comes first.
I'm wondering if this is because Solnet relies on the order of the params.

Working version:

Data

{"jsonrpc":"2.0","method":"slotNotification","params":{"result":{"slot":303986310,"parent":303986309,"root":303986278},"subscription":4783444}}

Code

var streamingClient = ClientFactory.GetStreamingClient("wss://api.mainnet-beta.solana.com"); await streamingClient.ConnectAsync(); var subscription = await streamingClient.SubscribeSlotInfoAsync( (state, data) => { Log.Information("Slot {Slot} at {Time}", data.Slot, DateTimeOffset.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")); });

Not working with Quicknode endpoints:

Data

{"jsonrpc":"2.0","method":"slotNotification","params":{"subscription":11263,"result":{"slot":343082753,"parent":343082752,"root":343082721}}}

Code

var streamingClient = ClientFactory.GetStreamingClient("wss://tame-cool-borough.solana-devnet.quiknode.pro/ca7e417575b2778a022f76bd72989cba039f2efe/"); await streamingClient.ConnectAsync(); var subscription = await streamingClient.SubscribeSlotInfoAsync( (state, data) => { Log.Information("Slot {Slot} at {Time}", data.Slot, DateTimeOffset.Now.ToString("yyyy-MM-ddTHH:mm:ss.fffZ")); });

@NightWuYo NightWuYo added the bug Something isn't working label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants