Closed nukec closed 3 years ago
SubscribeSignature
is working as we have used it in multiple places without any issue.
Are you connecting to the websocket after getting the streaming client instance and before using it?
ok seems like it's an issue with custom rpc, i have to add referrer header into the client. is that possible with clientfactory that you expose?
No it's not possible currently, it's something we already thought about adding but haven't had the time for it
no custom rpc can be used with solnet then as figment requires auth header, quicknode referrer and rpcpool same. ill see if i can do PR but dont have time more than a quick fix so might just use it for myself.
I haven't tested it yet, but you can inject your own HttpClient
in one of the ClientFactory.GetClient
methods, so you could add the headers / referrer in your own instanced HttpClient
.
I'm going to read the docs on the Websockets and how to do auth there
Further research: have you tried to use the custom link including the authentication parameters when calling GetClient
? IT seems most RPC services just need to append the key/token to the URL, so it should work without any changes. And for figment, you can do just from the URL too - append /api_key/IRpcClient
created with a given HttpClient
instance.
Closed by #240
I haven't tested it yet, but you can inject your own
HttpClient
in one of theClientFactory.GetClient
methods, so you could add the headers / referrer in your own instancedHttpClient
. I'm going to read the docs on the Websockets and how to do auth there
Can this be released ?
Further research: have you tried to use the custom link including the authentication parameters when calling
GetClient
? IT seems most RPC services just need to append the key/token to the URL, so it should work without any changes. And for figment, you can do just from the URL too - append /api_key//. The only one that seems unsupported is GenesysGo, but just in the websocket connection, as you can still inject headers on a IRpcClient
created with a givenHttpClient
instance.
This doens't work as I've tried putting url directly:
services.AddSingleton(ClientFactory.GetClient(chainConfiguration.Cluster));
And it spits error still:
My bad, thought we had released that stuff. Gonna do it in the meantime. In the meantime, what custom RPC service are you using?
figment, quicknode
The new version is released, you can now inject your own HttpClient
or ClientWebSocket
and should be able to add any headers from there
Describe the bug When trying to subscribe to signature i do not get response while transaction is finalized on explorer.
To Reproduce
Expected behavior Get response and hit Debug. Also see there are no tests on this, so not really sure this was ever properly tested?