You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Is your feature request related to a problem? Please describe.
For example, with the Reth client it is possible to define custom namespaces for extending functionality, such as adding RPC and subscription methods. Some call with method eth_subscribe and params ["newHeads"] might have a custom implementation (for some reason) in a custom namespace with method my_eth_subscribe and params ["myNewHeads"]
The current implementations of the JsonRpcClient trait bakes in the "eth_subscribe" string in a number of places, which makes it unable to support calling of these custom methods
subscribe() will call eth_subscribe under the hood. This can be avoided by making your own request() and passing the channel_id into a SubscriptionStream, although this is more fiddly...
... and the above is actually not possible because the TransactionManager will only add a channel_id to its channel map field if the method is eth_subscribe. So attempting to listen to the stream you requested will error
reconnect() method also hardcodes the eth_subscribe method for its attempted reconnection to a stream
Describe the solution you'd like
Support for additional methods in the subscription case, through careful removal of reliance on the string "eth_subscribe"
Describe alternatives you've considered
Current workaround is to simply use the eth namespace in extending Reth, which allows the ethers calls to work
Additionally, one can not use ethers and instead roll their own websocket connection capabilities with tungstenite or other
Additional context
The text was updated successfully, but these errors were encountered:
danielharrisgsr
changed the title
Support for Custom Namespaces in eth_subscribe and eth_call
Support for Custom Namespaces in subscribe (other than eth_subscribe)
Feb 5, 2024
danielharrisgsr
changed the title
Support for Custom Namespaces in subscribe (other than eth_subscribe)
Support for other methods in subscribe (other than eth_subscribe)
Feb 5, 2024
Is your feature request related to a problem? Please describe.
For example, with the Reth client it is possible to define custom namespaces for extending functionality, such as adding RPC and subscription methods. Some call with method
eth_subscribe
and params["newHeads"]
might have a custom implementation (for some reason) in a custom namespace with methodmy_eth_subscribe
and params["myNewHeads"]
The current implementations of the
JsonRpcClient
trait bakes in the"eth_subscribe"
string in a number of places, which makes it unable to support calling of these custom methodssubscribe()
will calleth_subscribe
under the hood. This can be avoided by making your ownrequest()
and passing thechannel_id
into aSubscriptionStream
, although this is more fiddly...channel_id
to its channel map field if the method iseth_subscribe
. So attempting to listen to the stream you requested will errorreconnect()
method also hardcodes theeth_subscribe
method for its attempted reconnection to a streamDescribe the solution you'd like
Support for additional methods in the subscription case, through careful removal of reliance on the string
"eth_subscribe"
Describe alternatives you've considered
eth
namespace in extending Reth, which allows the ethers calls to worktungstenite
or otherAdditional context
The text was updated successfully, but these errors were encountered: