diff --git a/packages/documentation/astro.config.mjs b/packages/documentation/astro.config.mjs index 75eeced402..0662c571ed 100644 --- a/packages/documentation/astro.config.mjs +++ b/packages/documentation/astro.config.mjs @@ -121,6 +121,10 @@ export default defineConfig({ label: 'Assets', link: '/integration/requirements/assets' }, + { + label: 'Peers', + link: '/integration/requirements/peers' + }, { label: 'Wallet addresses', link: '/integration/requirements/wallet-addresses' @@ -144,50 +148,56 @@ export default defineConfig({ ] }, { - label: 'Docker Compose', - link: '/integration/prod/docker-compose' - }, - { - label: 'Helm and Kubernetes', - link: '/integration/prod/helm-k8s' - }, - { - label: 'Services', + label: 'Test locally', collapsed: true, items: [ { - label: 'Auth service', - link: '/integration/services/auth-service' - }, - { - label: 'Backend service', - link: '/integration/services/backend-service' + label: 'Local playground', + link: '/integration/playground/overview' }, { - label: 'Frontend service', - link: '/integration/services/frontend-service' + label: 'Autopeering', + link: '/integration/playground/autopeering' }, { - label: 'Token introspection', - link: '/integration/services/token-introspection' + label: 'Test network', + link: '/integration/playground/testnet' } ] }, { - label: 'Test locally', + label: 'Deployment', collapsed: true, items: [ { - label: 'Local playground', - link: '/integration/playground/overview' + label: 'Services', + collapsed: true, + items: [ + { + label: 'Auth service', + link: '/integration/deployment/services/auth-service' + }, + { + label: 'Backend service', + link: '/integration/deployment/services/backend-service' + }, + { + label: 'Frontend service', + link: '/integration/deployment/services/frontend-service' + }, + { + label: 'Token introspection', + link: '/integration/deployment/services/token-introspection' + } + ] }, { - label: 'Autopeering', - link: '/integration/playground/autopeering' + label: 'Docker Compose', + link: '/integration/deployment/docker-compose' }, { - label: 'Test network', - link: '/integration/playground/testnet' + label: 'Helm and Kubernetes', + link: '/integration/deployment/helm-k8s' } ] } @@ -201,10 +211,6 @@ export default defineConfig({ label: 'Rafiki Admin', link: '/admin/admin-user-guide' }, - { - label: 'Manage peering relationships', - link: '/admin/manage-peering' - }, { label: 'Manage liquidity', link: '/admin/manage-liquidity' diff --git a/packages/documentation/src/content/docs/admin/admin-user-guide.mdx b/packages/documentation/src/content/docs/admin/admin-user-guide.mdx index 30e93626ae..68251354f6 100644 --- a/packages/documentation/src/content/docs/admin/admin-user-guide.mdx +++ b/packages/documentation/src/content/docs/admin/admin-user-guide.mdx @@ -6,14 +6,14 @@ import { LinkOut } from '@interledger/docs-design-system' import { LargeImg } from '@interledger/docs-design-system' -The Rafiki Admin application provides tools to manage peers, assets, wallet addresses, webhooks, payments, and account settings. It functions as an interface to the Rafiki [backend service](/integration/services/backend-service/) and all actions performed, such as fetching data or executing commands, are passed to the Rafiki `backend` service. The purpose of this document is to help you navigate and use the Rafiki Admin application effectively. +The Rafiki Admin application provides tools to manage peers, assets, wallet addresses, webhooks, payments, and account settings. It functions as an interface to the Rafiki [backend service](/integration/deployment/services/backend-service/) and all actions performed, such as fetching data or executing commands, are passed to the Rafiki `backend` service. The purpose of this document is to help you navigate and use the Rafiki Admin application effectively. ## Getting started ### Prerequisites - Familiarity with general Rafiki concepts. The [Rafiki overview](/overview/overview) is a great place to start. -- Running the Rafiki `frontend` package. See [Frontend service](/integration/services/frontend-service) for more information. +- Running the Rafiki `frontend` package. See [Frontend service](/integration/deployment/services/frontend-service) for more information. ## Identity and user management diff --git a/packages/documentation/src/content/docs/admin/manage-peering.mdx b/packages/documentation/src/content/docs/admin/manage-peering.mdx deleted file mode 100644 index c01db8b25f..0000000000 --- a/packages/documentation/src/content/docs/admin/manage-peering.mdx +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Manage peering relationships ---- - -import { CodeBlock, LinkOut } from '@interledger/docs-design-system' - -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](/integration/services/backend-service#interledger-connector) (ideally Rafiki). -- Agree on an [asset](/overview/concepts/accounting#assets) 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 - - - -```graphql -mutation CreatePeer($input: CreatePeerInput!) { - createPeer(input: $input) { - code - success - message - peer { - id - asset { - code - scale - } - staticIlpAddress - name - } - } -} -``` - - - -### Example - - - -```json -{ - "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": - } -} -``` - - - -
- -| Variable | Description | Required | -| -------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------- | -| `assetID` | The ID of the asset that you and your peer will use to ultimately settle your net obligations outside of Interledger. | Y | -| `staticILPaddress` | Your peer’s static ILP address (the example uses `g.othergreatwallet`) | Y | -| `name` | Your peer’s name (the example uses “The Other Great Wallet”) | Y | -| `http.incoming.authTokens` | The token your peer will use to present and connect to and send packets to your Rafiki instance. | Y | -| `http.outgoing.endpoint` | Your peer’s connector endpoint. By default it is on local port 0.0.0.0:3002 | Y | -| `http.outgoing.authtoken` | The token that you will use to present to your peer and connect to and send packets to their Rafiki instance. | Y | -| `initialLiquidity` | Initial amount of liquidity to deposit for peer. Liquidity can also be deposited using the `DepositPeerLiquidity` mutation. | N | - -
- - - -```json -{ - "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](/admin/admin-user-guide#create-peer) application. Ideally, this will be done using your [local Rafiki environment](/integration/playground/overview/#running-the-local-environment). - -Refer to the [Rafiki Admin application user guide](/admin/admin-user-guide/#peers) for more information on adding peers. diff --git a/packages/documentation/src/content/docs/integration/prod/docker-compose.mdx b/packages/documentation/src/content/docs/integration/deployment/docker-compose.mdx similarity index 96% rename from packages/documentation/src/content/docs/integration/prod/docker-compose.mdx rename to packages/documentation/src/content/docs/integration/deployment/docker-compose.mdx index 9f206994b4..05be891bad 100644 --- a/packages/documentation/src/content/docs/integration/prod/docker-compose.mdx +++ b/packages/documentation/src/content/docs/integration/deployment/docker-compose.mdx @@ -10,7 +10,7 @@ This guide is an example of deploying Rafiki using Docker Compose with Nginx as ### Domain and subdomains setup -We will map the [Open Payments resource server](/integration/services/backend-service#open-payments) to your domain, and the [ILP Connector](/integration/services/backend-service#interledger-connector), [Open Payments auth server](/integration/services/auth-service), and [Admin UI](/integration/services/frontend-service) to subdomains. Using the DNS host of your choice, set up your domain and subdomains according to the following recommended convention: +We will map the [Open Payments resource server](/integration/deployment/services/backend-service#open-payments) to your domain, and the [ILP Connector](/integration/deployment/services/backend-service#interledger-connector), [Open Payments auth server](/integration/deployment/services/auth-service), and [Admin UI](/integration/deployment/services/frontend-service) to subdomains. Using the DNS host of your choice, set up your domain and subdomains according to the following recommended convention:
diff --git a/packages/documentation/src/content/docs/integration/prod/helm-k8s.mdx b/packages/documentation/src/content/docs/integration/deployment/helm-k8s.mdx similarity index 100% rename from packages/documentation/src/content/docs/integration/prod/helm-k8s.mdx rename to packages/documentation/src/content/docs/integration/deployment/helm-k8s.mdx diff --git a/packages/documentation/src/content/docs/integration/services/auth-service.mdx b/packages/documentation/src/content/docs/integration/deployment/services/auth-service.mdx similarity index 89% rename from packages/documentation/src/content/docs/integration/services/auth-service.mdx rename to packages/documentation/src/content/docs/integration/deployment/services/auth-service.mdx index a262c4cd66..01865bc6c5 100644 --- a/packages/documentation/src/content/docs/integration/services/auth-service.mdx +++ b/packages/documentation/src/content/docs/integration/deployment/services/auth-service.mdx @@ -41,7 +41,7 @@ An identity provider (IdP) is a system or service that manages user authenticati Integration with an [IdP](/integration/requirements/idp) is required when using Rafiki’s `auth` service because the Open Payments standard requires interactive outgoing payment _grant_ requests. In an interactive request, there must be explicit interaction by an individual (e.g., a client's end-user) to approve or deny the grant. In this case, the grant must be explicitly approved before an outgoing payment is created. :::note -Rafiki’s [`frontend`](/integration/services/frontend-service) service requires an IdP for authentication and user management of your [Rafiki Admin](/admin/admin-user-guide) users. Out of the box, Rafiki uses Ory Kratos, a cloud-based user management system. Kratos is for internal use only and **cannot** be used as your customer-facing Open Payments authorization server. +Rafiki’s [`frontend`](/integration/deployment/services/frontend-service) service requires an IdP for authentication and user management of your [Rafiki Admin](/admin/admin-user-guide) users. Out of the box, Rafiki uses Ory Kratos, a cloud-based user management system. Kratos is for internal use only and **cannot** be used as your customer-facing Open Payments authorization server. ::: For more information about interactive grants and how they work with identity providers, review our [Identity Provider](/integration/requirements/idp) page and the Grant negotiation and authorization page in the Open Payments docs. diff --git a/packages/documentation/src/content/docs/integration/services/backend-service.mdx b/packages/documentation/src/content/docs/integration/deployment/services/backend-service.mdx similarity index 92% rename from packages/documentation/src/content/docs/integration/services/backend-service.mdx rename to packages/documentation/src/content/docs/integration/deployment/services/backend-service.mdx index b9115744c8..199c4f61ed 100644 --- a/packages/documentation/src/content/docs/integration/services/backend-service.mdx +++ b/packages/documentation/src/content/docs/integration/deployment/services/backend-service.mdx @@ -27,7 +27,7 @@ You must also set the environment variables for the `backend` service. ## Open Payments -The `backend` service exposes the Open Payments APIs, which are auth-protected using an opinionated version of the Grant Negotiation and Authorization Protocol (GNAP). Review the [`auth`](/integration/services/auth-service) service page for more details about grant authorization and authentication. +The `backend` service exposes the Open Payments APIs, which are auth-protected using an opinionated version of the Grant Negotiation and Authorization Protocol (GNAP). Review the [`auth`](/integration/deployment/services/auth-service) service page for more details about grant authorization and authentication. The `backend` service allows you to manage Open Payments incoming payments, quotes, and outgoing payments. Quotes and outgoing payments call the ILP connector, described in the next section, to send ILP packets. Quoting sends unfulfillable probe packets, for example to determine a transaction’s cost before executing the payment. Outgoing payments send packets as part of executing the payment. @@ -39,7 +39,7 @@ Some of the responsibilities of a connector include: - Authenticating packets against ILP account credentials. - Forwarding packets to a sender or receiver. -- Rejecting a packet for any number of reasons, including expiration, insufficient liquidity, rate limit exceeded, or if the amount exceeds the `maxPacketAmount` [agreed to](/admin/manage-peering) by the connector and its peer. +- Rejecting a packet for any number of reasons, including expiration, insufficient liquidity, rate limit exceeded, or if the amount exceeds the `maxPacketAmount` [agreed to](/integration/requirements/peers#prerequisites) by the connector and its peer. - Converting currencies. - Fulfilling packets with an internal STREAM server. @@ -48,7 +48,7 @@ The `backend` service includes an HTTP server listening on the configured `CONNE Similarly, if a packet's destination address corresponds to a peer, your connector will forward the packet to your peer over HTTP, along with your peer's outgoing HTTP `authToken`. :::note[Auth tokens] -You and your peer should have exchanged incoming and outgoing auth tokens as part of establishing your [peering relationship](/admin/manage-peering). +You and your peer should have exchanged incoming and outgoing auth tokens as part of establishing your [peering relationship](/integration/requirements/peers#prerequisites). ::: A packet can either continue on to your peer via HTTP or terminate at your Rafiki instance's STREAM server. If the packet terminates at your STREAM server, your connector will attempt to extract and decode the payment tag from the packet's destination address. When your connector successfully matches the tag with a locally managed wallet address or incoming payment, the connector will not forward the packet. Instead, it will credit the corresponding balance and track the total amount received in Redis to support STREAM receipts. Packets addressed to a wallet address happen via SPSP. diff --git a/packages/documentation/src/content/docs/integration/services/frontend-service.mdx b/packages/documentation/src/content/docs/integration/deployment/services/frontend-service.mdx similarity index 94% rename from packages/documentation/src/content/docs/integration/services/frontend-service.mdx rename to packages/documentation/src/content/docs/integration/deployment/services/frontend-service.mdx index 20c07828f6..aa450a5eb7 100644 --- a/packages/documentation/src/content/docs/integration/services/frontend-service.mdx +++ b/packages/documentation/src/content/docs/integration/deployment/services/frontend-service.mdx @@ -11,7 +11,7 @@ Rafiki’s Ory Kratos, a secure and fully open-source identity management solution. :::danger[Disabling authentication] diff --git a/packages/documentation/src/content/docs/integration/services/token-introspection.mdx b/packages/documentation/src/content/docs/integration/deployment/services/token-introspection.mdx similarity index 100% rename from packages/documentation/src/content/docs/integration/services/token-introspection.mdx rename to packages/documentation/src/content/docs/integration/deployment/services/token-introspection.mdx diff --git a/packages/documentation/src/content/docs/integration/playground/overview.mdx b/packages/documentation/src/content/docs/integration/playground/overview.mdx index f078cdb9ef..861247296a 100644 --- a/packages/documentation/src/content/docs/integration/playground/overview.mdx +++ b/packages/documentation/src/content/docs/integration/playground/overview.mdx @@ -14,12 +14,12 @@ This suite of packages includes:
-| Package name | Services | -| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| [`backend`](/integration/services/backend-service) | | -| [`auth`](/integration/services/auth-service) | GNAP auth server | -| `mock-account-servicing-entity` | mocks an account servicing entity | -| [`frontend`](/integration/services/frontend-service) | Remix app to expose a UI for Rafiki admin management via interaction with the Backend Admin APIs | +| Package name | Services | +| --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| [`backend`](/integration/deployment/services/backend-service) | | +| [`auth`](/integration/deployment/services/auth-service) | GNAP auth server | +| `mock-account-servicing-entity` | mocks an account servicing entity | +| [`frontend`](/integration/deployment/services/frontend-service) | Remix app to expose a UI for Rafiki admin management via interaction with the Backend Admin APIs |
diff --git a/packages/documentation/src/content/docs/integration/requirements/idp.mdx b/packages/documentation/src/content/docs/integration/requirements/idp.mdx index 4c839264d7..73d9db77d9 100644 --- a/packages/documentation/src/content/docs/integration/requirements/idp.mdx +++ b/packages/documentation/src/content/docs/integration/requirements/idp.mdx @@ -44,7 +44,7 @@ Your IdP: The purpose of an Open Payments authorization server is to grant permission to clients to access the Open Payments APIs. These APIs are used to create incoming payments, quotes, and outgoing payments against an account holder's account. -Rafiki's [auth service](/integration/services/auth-service) provides you with a reference implementation of an Open Payments authorization server. You can use the service as an alternative to developing your own in-house service. +Rafiki's [auth service](/integration/deployment/services/auth-service) provides you with a reference implementation of an Open Payments authorization server. You can use the service as an alternative to developing your own in-house service. The authorization server extends an HTTP API for your IdP to use to start and finish interactions, collect authorization, get information about a grant, and communicate whether an end-user has authorized a grant. The API's [endpoints](#interaction-endpoints) are described below. diff --git a/packages/documentation/src/content/docs/integration/requirements/peers.mdx b/packages/documentation/src/content/docs/integration/requirements/peers.mdx new file mode 100644 index 0000000000..0e37425cda --- /dev/null +++ b/packages/documentation/src/content/docs/integration/requirements/peers.mdx @@ -0,0 +1,291 @@ +--- +title: Peers +--- + +import { CodeBlock, LinkOut } from '@interledger/docs-design-system' + +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. Peering establishes the connections needed for your Rafiki instance to interact with another account servicing entity (ASE). The purpose of this guide is to help you set up and manage peers. + +While this guide focuses on the conceptual and technical steps of adding and managing peers via the Backend Admin API, the Rafiki Admin application offers the same functionality in a user-friendly interface. + +Refer to the [Rafiki Admin user guide](/admin/admin-user-guide#peers) for detailed instructions and examples of creating and managing peers through the application. + +:::tip +Whether you are using the Backend Admin API or the Rafiki Admin application, the underlying configurations and requirements remain the same. Choose the interface that best suits your individual workflow. +::: + +## Prerequisites + +:::note +Peering is not required unless you want to participate in transactions with another ASE on the Interledger network. For foundational peering concepts, refer to the Peers section of [Interledger Concepts](/overview/concepts/interledger/#peers). +::: + +Before adding a peer, you and the account servicing entity you intend to peer with must both: + +- Run an implementation of an [Interledger connector](/integration/deployment/services/backend-service#interledger-connector) (ideally Rafiki). +- Agree on an [asset](/overview/concepts/accounting#assets) 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. For more information, refer to [Assets](/integration/requirements/assets/). +- Exchange static Interledger (ILP) addresses with your peer. Your ILP address is self-assigned during Rafiki setup and stored locally as the `ILP_ADDRESS` environment variable for the `backend` service. +- 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. + +### Optional settings + +- Deposit an `initialLiquidity` for your peer. Liquidity can also be deposited later using the `depositPeerLiquidity` mutation. +- Define a `maxPacketAmount` value, which specifies the maximum packet size you are willing to accept from the peer. Your peer's `maxPacketAmount` value does not need to match, as this value is independently set by each ASE. If omitted, payments will not be broken into smaller packets. + +## Set up peering in Rafiki + +The basic workflow of setting up a peering relationship starts with adding the agreed upon asset and then adding a peer. + +### Add an asset + +As mentioned in the prerequisites, an asset must be added to your Rafiki instance before creating a peering relationship. To learn how to add an asset, refer to [Assets](/integration/requirements/assets/). + +### Add a peer + +After adding an asset, add a peer using the `createPeer` GraphQL mutation. + +#### `createPeer` + + + +```graphql +mutation CreatePeer($input: CreatePeerInput!) { + createPeer(input: $input) { + code + success + message + peer { + id + asset { + code + scale + } + staticIlpAddress + name + } + } +} +``` + + + +##### Example + + + +```json +{ + "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": + } +} +``` + + + +
+ +| Variable | Description | Required | +| -------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------- | +| `assetID` | The ID of the asset that you and your peer will use to ultimately settle your net obligations outside of Interledger. | Y | +| `staticILPaddress` | Your peer’s static ILP address (the example uses `g.othergreatwallet`) | Y | +| `name` | Your peer’s name (the example uses “The Other Great Wallet”) | Y | +| `http.incoming.authTokens` | An array of auth tokens accepted by your Rafiki instance for authenticating incoming packets from your peer. | Y | +| `http.outgoing.endpoint` | Your peer’s connector endpoint. By default it is on local port 0.0.0.0:3002 | Y | +| `http.outgoing.authToken` | The auth token presented to your peer for authenticating outgoing packets from your Rafiki instance. | Y | +| `initialLiquidity` | Initial amount of liquidity to deposit for peer. Liquidity can also be deposited using the `DepositPeerLiquidity` mutation. | N | + +
+ + + +```json +{ + "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" + } + } + } +} +``` + + + +## Manage peers + +Once a peer has been added to your Rafiki instance, there is minimal ongoing management required. Most peer interactions focus on monitoring liquidity and ensuring smooth payment flows. In rare cases, you may need to update a peer's configuration due to changes in their technical details or remove a peer created in error, as long as no payments have been exchanged. These actions help ensure your Rafiki instance stays up to date with operational changes. + +### Edit a peer + +
+How to edit a peer +Occasionally, you may need to adjust peering configurations or address any changes communicated by the peer. Some examples include updating new endpoints or tokens, technical settings like the maximum packet amount, or peer liquidity thresholds. + +In this example we are going to update the peer we just created. Rather than change any of the peering details, we can add some optional details that we didn't include when we created the peer. We will define the `maxPacketAmount` and the `liquidityThreshold`. + +#### `updatePeer` + + + +```graphql +mutation UpdatePeer($input: UpdatePeerInput!) { + updatePeer(input: $input) { + peer { + id + name + http { + outgoing { + authToken + endpoint + } + } + maxPacketAmount + liquidityThreshold + } + } +} +``` + + + +##### Example + +The input object for the update operation only requires that the `id` is present. All other variables are optional. For this example we will include the required `id` variable, as well as the optional variables of the fields we wish to update. In this case, `maxPacketAmount` and `liquidityThreshold`. + + + +```json +{ + "input": { + "id": "480ef339-7842-4501-a905-923fc1339cef", + "maxPacketAmount": 1000, + "liquidityThreshold": 100 + } +} +``` + + + +
+ +| Variable | Description | Required | +| -------------------- | ------------------------------------------------------------------------------------------------------ | -------- | +| `id` | The ID of the peer you wish to update. | Y | +| `maxPacketAmount` | Maximum packet size you are willing to accept from the peer. | N | +| `liquidityThreshold` | A webhook event will notify the Account Servicing Entity if peer liquidity falls below this new value. | N | + +
+ + + +```json +{ + "data": { + "updatePeer": { + "code": "200", + "success": true, + "message": "Updated ILP Peer", + "peer": { + "id": "480ef339-7842-4501-a905-923fc1339cef", + "name": "The Other Great Wallet", + "http": { + "outgoing": { + "authToken": "test", + "endpoint": "http://peering-test:3002" + } + }, + "maxPacketAmount": 1000, + "liquidityThreshold": 100 + } + } + } +} +``` + + +
+ +### Delete a peer + +
+How to delete a peer +Deleting a peer is an action that removes a peer from your Rafiki instance. There are specific rules and considerations to keep in mind before initating this irreversible operation. + +A peer can only be deleted if no payments have been made to or received from that peer. This ensures that historical payment records are preserved. If you attempt to delete a peer with payment history, the backend will throw an error, preventing the deletion. + +Deleting a peer is useful in situations where there were configuration errors when the peer was first created like an incorrect auth token or ILP address. + +:::danger +Deleting a peer is permanent and cannot be reversed. If you delete a peer in error, you must create another new peer. +::: + +#### `deletePeer` + + + +```graphql +mutation DeletePeer($input: DeletePeerInput!) { + deletePeer(input: $input) { + success + } +} +``` + + + +##### Example + + + +```json +{ + "input": { + "id": "480ef339-7842-4501-a905-923fc1339cef" + } +} +``` + + + +
+ +| Variable | Description | Required | +| -------- | -------------------------------------- | -------- | +| `id` | The ID of the peer you wish to delete. | Y | + +
+ + + +```json +{ + "data": { + "deletePeer": { + "success": true + } + } +} +``` + + +
diff --git a/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx b/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx index 756bb1a841..071612998c 100644 --- a/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx +++ b/packages/documentation/src/content/docs/integration/requirements/webhook-events.mdx @@ -24,7 +24,7 @@ Rafiki doesn't hold _user_ account balances. Instead, Rafiki keeps track of the For Rafiki to notify you about webhook events, you must expose a webhook endpoint that listens for the events dispatched by Rafiki. These events notify your system of time-sensitive status updates, warnings, and errors so that you can react accordingly. -When an event occurs, the [`backend`](/integration/services/backend-service) service makes a request to your configured webhook endpoint. The `backend` service expects a `200` status in return. +When an event occurs, the [`backend`](/integration/deployment/services/backend-service) service makes a request to your configured webhook endpoint. The `backend` service expects a `200` status in return.
diff --git a/packages/documentation/src/content/docs/overview/concepts/accounting.mdx b/packages/documentation/src/content/docs/overview/concepts/accounting.mdx index 9ea2b75982..3fa0a247a3 100644 --- a/packages/documentation/src/content/docs/overview/concepts/accounting.mdx +++ b/packages/documentation/src/content/docs/overview/concepts/accounting.mdx @@ -60,7 +60,7 @@ $\frac{10000}{10^2} =100.00$ USD TigerBeetle is a high-performance distributed financial accounting database used by Rafiki’s `backend` service to store account balance data at the ILP layer. Both liquidity and settlement accounts in Rafiki correspond to TigerBeetle credit and debit accounts, respectively. TigerBeetle only holds balance data without any additional ILP packet metadata. For detailed information on TigerBeetle, including its consensus mechanism and its limitations, visit the official TigerBeetle documentation and blog. -You have the flexibility to choose whether to use TigerBeetle or opt for a separate Postgres database. However, TigerBeetle is recommended due to its speed, efficiency, and dedicated design for handling double ledger accounting. For more information about Tigerbeetle in a production environment, see [Running Rafiki in production](/integration/prod/helm-k8s/#tigerbeetle). +You have the flexibility to choose whether to use TigerBeetle or opt for a separate Postgres database. However, TigerBeetle is recommended due to its speed, efficiency, and dedicated design for handling double ledger accounting. For more information about Tigerbeetle in a production environment, see [Running Rafiki in production](/integration/deployment/helm-k8s/#tigerbeetle). ## Liquidity diff --git a/packages/documentation/src/content/docs/overview/concepts/interledger.mdx b/packages/documentation/src/content/docs/overview/concepts/interledger.mdx index 580b32bd3d..8398fd2e7a 100644 --- a/packages/documentation/src/content/docs/overview/concepts/interledger.mdx +++ b/packages/documentation/src/content/docs/overview/concepts/interledger.mdx @@ -18,7 +18,7 @@ Each packet represents a conditional IOU which affects financial accounting bala Interledger itself is a network of computers that enables sending payment messages across payment networks. Each computer on the network is called a node. -For two nodes on the Interledger network to exchange ILP packets with one another, the two nodes must be peers. There are a number of [requirements](/admin/manage-peering) that both you and your potential peer must meet in order to form a peering relationship. +For two nodes on the Interledger network to exchange ILP packets with one another, the two nodes must be peers. There are a number of [requirements](/integration/requirements/peers#prerequisites) that both you and your potential peer must meet in order to form a peering relationship. Since the purpose of peering is to facilitate payments, which often involves extending lines of credit, your peer should be someone you trust. We strongly recommend you and your potential peer define your expectations and outline your agreements in a legally-binding document peering with one another. @@ -30,7 +30,7 @@ Each node on the Interledger network can take on the role of sender, connector, - Connector - An intermediary between a sender and receiver that forwards ILP packets. Connectors can facilitate payments to or from anyone they’re peered with. - Receiver - The final recipient of the ILP packets and, as such, the payment. -If the sender and receiver nodes are peers, then the payment flow is straightforward and no intermediary connector nodes are needed. However, if the sender and receiver aren’t peers, then the payment must be routed through one or more connectors. Rafiki’s [backend service](/integration/services/backend-service#interledger-connector) includes an Interledger connector for sending and receiving ILP packets. +If the sender and receiver nodes are peers, then the payment flow is straightforward and no intermediary connector nodes are needed. However, if the sender and receiver aren’t peers, then the payment must be routed through one or more connectors. Rafiki’s [backend service](/integration/deployment/services/backend-service#interledger-connector) includes an Interledger connector for sending and receiving ILP packets. In the image below, the sender node (A) and the receiver node (C) share a common peer (B). In payments from the sender to the receiver, node B performs the role of connector to facilitate payments between the two. diff --git a/packages/documentation/src/content/docs/overview/concepts/open-payments.mdx b/packages/documentation/src/content/docs/overview/concepts/open-payments.mdx index ca7c364e7c..8a5d30539f 100644 --- a/packages/documentation/src/content/docs/overview/concepts/open-payments.mdx +++ b/packages/documentation/src/content/docs/overview/concepts/open-payments.mdx @@ -31,8 +31,8 @@ We strongly encourage you to familiarize yourself with the Open Payments standar ## Rafiki's backend service -Rafiki’s [`backend`](/integration/services/backend-service) service is the main service for handling business logic and external communication. The service is responsible for, among other things, exposing the endpoints of the Open Payments APIs for clients to perform account management tasks. Every request and response is validated against the Open Payments specification. +Rafiki’s [`backend`](/integration/deployment/services/backend-service) service is the main service for handling business logic and external communication. The service is responsible for, among other things, exposing the endpoints of the Open Payments APIs for clients to perform account management tasks. Every request and response is validated against the Open Payments specification. ## Rafiki's auth service -Rafiki’s [`auth`](/integration/services/auth-service) service is a reference implementation of an opinionated Open Payments authorization server. The authorization server is responsible for delegating authorization (via grants) to clients to use the Open Payments APIs, resolving clients’ public keys to authenticate and authorize incoming requests, and creating payments and quotes on the backend. Open Payments leverages the Grant Negotiation and Authorization Protocol (GNAP) for delegating authorization. You can learn more about the protocol by reviewing its specification. +Rafiki’s [`auth`](/integration/deployment/services/auth-service) service is a reference implementation of an opinionated Open Payments authorization server. The authorization server is responsible for delegating authorization (via grants) to clients to use the Open Payments APIs, resolving clients’ public keys to authenticate and authorize incoming requests, and creating payments and quotes on the backend. Open Payments leverages the Grant Negotiation and Authorization Protocol (GNAP) for delegating authorization. You can learn more about the protocol by reviewing its specification. diff --git a/packages/documentation/src/content/docs/resources/architecture.mdx b/packages/documentation/src/content/docs/resources/architecture.mdx index 1b1f794e83..b227a013a0 100644 --- a/packages/documentation/src/content/docs/resources/architecture.mdx +++ b/packages/documentation/src/content/docs/resources/architecture.mdx @@ -6,9 +6,9 @@ import { LinkOut } from '@interledger/docs-design-system' Rafiki is a collection of three services that run together. Each one can be scaled horizontally. -- [Backend](/integration/services/backend-service) - The main service, responsible for handling business logic and external communication -- [Auth](/integration/services/auth-service) - A reference implementation of an Open Payments authorization server, used for grant authorization and authentication -- [Frontend](/integration/services/frontend-service) - An optional internal user interface, called the [Rafiki Admin](/admin/admin-user-guide), for you to manage your Rafiki instance +- [Backend](/integration/deployment/services/backend-service) - The main service, responsible for handling business logic and external communication +- [Auth](/integration/deployment/services/auth-service) - A reference implementation of an Open Payments authorization server, used for grant authorization and authentication +- [Frontend](/integration/deployment/services/frontend-service) - An optional internal user interface, called the [Rafiki Admin](/admin/admin-user-guide), for you to manage your Rafiki instance These services rely on a number of databases. @@ -21,6 +21,6 @@ These services rely on a number of databases. , used by the `backend` service for accounting balances at the ILP layer - A Redis database used by the `backend` service as a cache to share STREAM connection details across processes -An additional package for [token introspection](/integration/services/token-introspection) is also included with Rafiki. This is an internal package that requires no action on your part if you’re using Rafiki’s `auth` service. +An additional package for [token introspection](/integration/deployment/services/token-introspection) is also included with Rafiki. This is an internal package that requires no action on your part if you’re using Rafiki’s `auth` service. Rafiki architecture diagram diff --git a/packages/frontend/app/routes/peers.$peerId.tsx b/packages/frontend/app/routes/peers.$peerId.tsx index a59d8701c0..0458ddae16 100644 --- a/packages/frontend/app/routes/peers.$peerId.tsx +++ b/packages/frontend/app/routes/peers.$peerId.tsx @@ -214,7 +214,7 @@ export default function ViewPeerPage() { List of valid tokens to accept when receiving incoming{' '} ILP packets {' '} @@ -234,7 +234,7 @@ export default function ViewPeerPage() { Valid auth token to present when sending outgoing{' '} ILP packets {' '} diff --git a/packages/frontend/app/routes/peers.create.tsx b/packages/frontend/app/routes/peers.create.tsx index c8d2cc1413..2ddb1324b4 100644 --- a/packages/frontend/app/routes/peers.create.tsx +++ b/packages/frontend/app/routes/peers.create.tsx @@ -149,7 +149,7 @@ export default function CreatePeerPage() { List of valid tokens to accept when receiving incoming{' '} ILP packets {' '} @@ -168,7 +168,7 @@ export default function CreatePeerPage() { Valid auth token to present when sending outgoing{' '} ILP packets {' '}