dshackle icon indicating copy to clipboard operation
dshackle copied to clipboard

FR: More Selective Routes

Open MysticRyuujin opened this issue 5 years ago • 1 comments

In the config we can create routes e.g.

  routes:
    - id: eth
      blockchain: ethereum

These routes (i.e. /eth) are then sent to the nodes as defined by their chain: ethereum tag.

What I'd like to be able to do is create a route (e.g. /geth) and be able to only send those requests to specific nodes.

Example:

  routes:
    - id: eth
      blockchain: ethereum
    - id: geth
      blockchain: ethereum
    - id: nethermind
      blockchain: ethereum

  upstreams:
    - id: geth01
      chain: ethereum
      routes:
        - eth
        - geth
...
    - id: nethermind01
      chain: ethereum
      routes:
        - eth
        - nethermind

This would allow all nodes to process requests to /eth and only target nodes to /whatever

I THINK you already have something like with with grpc? I know there's a labels tag, but I don't think we can use those at all with the JSON RPC? Maybe we could do something like /eth?provider=Nethermind if we had a lable called provider?

I don't particularly care in what way this would be implemented but it would be nice.

MysticRyuujin avatar Dec 08 '20 21:12 MysticRyuujin

That's possible to add actually. You're right that it's already possible with gRPC protocol, and can fairly simply added to the proxy config. I see as an additional option to a route, with labels to select an upstream. That could be nice to have

splix avatar Dec 08 '20 23:12 splix