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

Enable multi-hop ILP payments #2229

Open
1 task
mkurapov opened this issue Nov 28, 2023 · 0 comments
Open
1 task

Enable multi-hop ILP payments #2229

mkurapov opened this issue Nov 28, 2023 · 0 comments
Labels
story Major feature that can be broken up into smaller tasks

Comments

@mkurapov
Copy link
Contributor

mkurapov commented Nov 28, 2023

Context

We want to see if we are able to send ILP packets across different peers running Rafiki.

Say we have Rafiki instances A, B, C, where A is peered with B, and B is peered with C. Since they are all running ILP connectors, we should theoretically be able to send a payment from A to C.

It looks like currently this isn't supported. Whenever we try a payment from A to C, we end up not being able to a) resolve state.streamDestination in createStreamAddressMiddleware and by extension, fetch the outgoing account in createAccountMiddleware (which should end up being the peer of the next hop).

However, we already have files that seem to do the functionality that we want in packages/backend/src/payment-method/ilp/connector/ilp-routing. There is a README in the folder that might be helpful.

Additionally, we have some commented out code in the connector that should be able to enable the routing:

export async function createConnectorService({
logger,
redis,
ratesService,
accountingService,
walletAddressService,
incomingPaymentService,
peerService,
streamServer,
ilpAddress
}: ServiceDependencies): Promise<Rafiki> {
return createApp(
{
//router: router,
logger: logger.child({
service: 'ConnectorService'
}),
accounting: accountingService,
walletAddresses: walletAddressService,
incomingPayments: incomingPaymentService,
peers: peerService,
redis,
rates: ratesService,
streamServer
},

This issue will be about making this code work to support multi-hop ILP payments. We should test this by spinning up another Rafiki instance in the local playground, peering with one of the default instances only (ie. happy-life-bank), and sending a payment from cloud-nine to the new instance. A branch with a 3-Rafiki instance localplayground is available here: main...rp--multi-hop-setup

Resources

https://github.com/interledger/rafiki/blob/7f332c725a9050fcd70566ea0e8b310a86578f18/packages/connector/src/connector.ts

https://interledger.org/developers/rfcs/ilp-addresses/
https://github.dev/interledger/rafiki/tree/7f332c725a9050fcd70566ea0e8b310a86578f18

Todos

@mkurapov mkurapov self-assigned this Nov 28, 2023
@github-project-automation github-project-automation bot moved this to Backlog in Rafiki Nov 28, 2023
@mkurapov mkurapov changed the title Enable mutli-hop ILP payments Enable multi-hop ILP payments Dec 5, 2023
@mkurapov mkurapov removed their assignment Apr 2, 2024
@mkurapov mkurapov added the story Major feature that can be broken up into smaller tasks label Oct 1, 2024
@mkurapov mkurapov moved this to Q3 2024 in High Level Roadmap Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
story Major feature that can be broken up into smaller tasks
Projects
Status: Future
Status: Backlog
Development

No branches or pull requests

1 participant