Skip to content
GitHub

Manage peering relationships

To join the Interledger network and be able to send and receive payments, you must add one or more peer(s) to your Rafiki instance.

Prerequisites

Before you add a peer, you and the account servicing entity (ASE) you intend to peer with must both:

  • Run an implementation of an Interledger connector (ideally Rafiki).
  • Agree on an asset for the peering relationship. You can set up multiple peering relationships with the same peer based on different assets. At least one asset shared by you and your peer must be added to your Rafiki instance prior to setting up the peering relationship.
  • Agree on a maxPacketAmount value, which specifies how many packets a payment is split into.
  • Communicate your respective static Interledger (ILP) addresses.
  • Communicate a connection endpoint for the other peer to send packets to.
  • Exchange auth tokens for the connection endpoint.
  • Agree on a settlement mechanism (a means of paying one another for the successful forwarding and delivery of packets), which is outside the scope of Interledger and Rafiki.

Optionally, you may also deposit an initial liquidity for your peer.

Add peer using the CreatePeer GraphQL mutation

Example CreatePeer Mutation

mutation CreatePeer($input: CreatePeerInput!) {
createPeer(input: $input) {
code
success
message
peer {
id
asset {
code
scale
}
staticIlpAddress
name
}
}
}

Example

Example JSON request

{
"input": {
"staticIlpAddress": "g.othergreatwallet",
"name": "The Other Great Wallet"
"http": {
"incoming": {"authTokens": ["mytoken"]},
"outgoing": {"endpoint": "ilp.othergreatwallet.com", "authToken": "theirtoken"}
},
"assetId": "INSERT_ASSET_ID",
"initialLiquidity": <optionally, an intial amount of liquity to provision. Liquidity can also be deposited via the `DepositPeerLiquidity`>
}
}
VariableDescriptionRequired
assetIDThe ID of the asset that you and your peer will use to ultimately settle your net obligations outside of Interledger.Y
staticILPaddressYour peer’s static ILP address (the example uses g.othergreatwallet)Y
nameYour peer’s name (the example uses “The Other Great Wallet”)Y
http.incoming.authTokensThe token your peer will use to present and connect to and send packets to your Rafiki instance.Y
http.outgoing.endpointYour peer’s connector endpoint. By default it is on local port 0.0.0.0:3002Y
http.outgoing.authtokenThe token that you will use to present to your peer and connect to and send packets to their Rafiki instance.Y
initialLiquidityInitial amount of liquidity to deposit for peer. Liquidity can also be deposited using the DepositPeerLiquidity mutation.N

Example JSON Response

{
"data": {
"createPeer": {
"code": "200",
"success": true,
"message": "Created ILP Peer",
"peer": {
"id": "480ef339-7842-4501-a905-923fc1339cef",
"asset": {
"code": "USD",
"scale": 2
},
"staticIlpAddress": "g.othergreatwallet",
"name": "The Other Great Wallet"
}
}
}
}

Add a peer using Rafiki Admin

Alternatively, a peer can be added through the Rafiki Admin application. Ideally, this will be done using your local Rafiki environment.

Refer to the Rafiki Admin application user guide for more information on adding peers.