interledger4j / ilpv4-connector

An ILPv4 Connector implemented in Java
https://java-connector.ilpv4.dev
Apache License 2.0
19 stars 10 forks source link

Determine whether to support BTP #290

Open sappenin opened 4 years ago

sappenin commented 4 years ago

The Connector currently has a lot of excess functionality required to support stateful Link protocols, such as BTP. For example, see DefaultLinkManager. That implementation is used to construct Link objects for use by the Connector per that contract. However, it also tracks connection state, and destroys the Links if they disconnect. This is unnecessary for stateless Link transports like ILP-over-HTTP.

If we decide to get rid of BTP, we should spend some time designing a BTP proxy service that looks something like this:

            ┌───────────────────────────┐              ┌──────────────────────────────────────────────────┐                 
            │        BTP Cluster        │              │              ILP-over-HTTP Cluster               │                 
            └───────────────────────────┘              └──────────────────────────────────────────────────┘                 
   Websocket       ┌───────────────┐                   ┌───────────────────────────────┐     ┌─────────────┐                
◁───Clients──────▷ │BTP Connector1 │◁──ILP-over-HTTP──▷│                               │  ┌─▷│ Connector1  │      .─────.   
                   └───────────────┘                   │                               │  │  └─────────────┘     ╱       ╲  
   Websocket       ┌───────────────┐                   │                               │  │  ┌─────────────┐    ╱         ╲ 
◁───Clients───────▷│BTP Connector2 │◁─ILP-over-HTTP───▷│                               │  ├─▷│ Connector2  │   ;           :
                   └───────────────┘                   │ https://connector.example.com │  │  └─────────────┘   │  Shared   │
                           .                           │            (nginx)            │◁─┤        .           │ Datastore │
                          ( )                          │                               │  │       ( )          :           ;
                           '                           │                               │  │        '            ╲         ╱ 
   Websocket       ┌───────────────┐                   │                               │  │  ┌─────────────┐     ╲       ╱  
◁───Clients───────▷│BTP ConnectorN │◁─ILP-over-HTTP───▷│                               │  └─▷│ ConnectorN  │      ╲     ╱   
                   └───────────────┘                   └───────────────────────────────┘     └─────────────┘       `───'                                                               
sappenin commented 4 years ago

Also, see discussion from 08/23/2019 in the Slack protocols channel.