File tree Expand file tree Collapse file tree 15 files changed +343
-552
lines changed
Expand file tree Collapse file tree 15 files changed +343
-552
lines changed Original file line number Diff line number Diff line change 2727 timeout-minutes : 25
2828 steps :
2929 - uses : actions/checkout@v4
30+ with :
31+ submodules : recursive
32+ fetch-depth : 0
3033 - uses : ./.github/workflows/rafiki/env-setup
3134 - run : pnpm --filter backend build:deps
3235 - run : NODE_OPTIONS="--max-old-space-size=4096" pnpm --filter backend test:ci
5356 timeout-minutes : 5
5457 steps :
5558 - uses : actions/checkout@v4
59+ with :
60+ submodules : recursive
61+ fetch-depth : 0
5662 - uses : ./.github/workflows/rafiki/env-setup
5763 - run : pnpm --filter auth build:deps
5864 - run : pnpm --filter auth test
@@ -143,6 +149,9 @@ jobs:
143149 steps :
144150 - name : Checkout code
145151 uses : actions/checkout@v4
152+ with :
153+ submodules : recursive
154+ fetch-depth : 0
146155
147156 - name : Setup environment
148157 uses : ./.github/workflows/rafiki/env-setup
@@ -166,6 +175,9 @@ jobs:
166175 steps :
167176 - name : Checkout code
168177 uses : actions/checkout@v4
178+ with :
179+ submodules : recursive
180+ fetch-depth : 0
169181
170182 - name : Setup environment
171183 uses : ./.github/workflows/rafiki/env-setup
@@ -396,6 +408,8 @@ jobs:
396408 - backend
397409 - frontend
398410 steps :
411+ - name : Checkout code
412+ uses : actions/checkout@v4
399413 - name : Set up Docker Buildx
400414 uses : docker/setup-buildx-action@v3
401415 - name : Build
Original file line number Diff line number Diff line change 1+ [submodule "open-payments-specifications "]
2+ path = open-payments-specifications
3+ url = https://github.com/interledger/open-payments-specifications.git
Original file line number Diff line number Diff line change 1414** /styles /* .css
1515.docusaurus
1616.cache-loader
17- .astro
17+ .astro
18+ open-payments-specifications /**
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ Clone the Rafiki repository
6767``` sh
6868git clone https://github.com/interledger/rafiki.git
6969cd rafiki
70+ git submodule update --init --recursive
7071```
7172
7273Install Node.js
@@ -94,6 +95,22 @@ Install dependencies
9495pnpm i
9596```
9697
98+ ### Git submodules
99+
100+ This repository uses a git submodule for Open Payments specifications located at ` open-payments-specifications/ ` .
101+
102+ - Initialize submodules after cloning:
103+
104+ ``` sh
105+ git submodule update --init --recursive
106+ ```
107+
108+ - Alternatively, clone the repository with submodules in one step:
109+
110+ ``` sh
111+ git clone --recurse-submodules https://github.com/interledger/rafiki.git
112+ ```
113+
97114### Local Development
98115
99116The Rafiki local environment is the best way to explore Rafiki locally. The [ localenv] ( localenv ) directory contains instructions for setting up a local playground. Please refer to the README for each individual package for more details.
Original file line number Diff line number Diff line change @@ -79,6 +79,20 @@ Remove volumes and images
7979pnpm localenv:compose down --volumes --rmi all
8080```
8181
82+ ### Note on git submodules
83+
84+ Rafiki uses a git submodule for Open Payments specifications (` open-payments-specifications/ ` ). Ensure submodules are initialized before building or running the Local Playground:
85+
86+ ``` sh
87+ git submodule update --init --recursive
88+ ```
89+
90+ Alternatively, clone the repository with submodules in one step:
91+
92+ ``` sh
93+ git clone --recurse-submodules https://github.com/interledger/rafiki.git
94+ ```
95+
8296# Environment components
8397
8498![ Docker compose environment] ( ../packages/documentation/public/img/localenv.png )
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ FROM base AS builder
3535COPY package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./
3636COPY packages/auth ./packages/auth
3737COPY packages/token-introspection ./packages/token-introspection
38+ COPY open-payments-specifications/openapi ./open-payments-specifications/openapi
3839
3940RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
4041 pnpm install \
@@ -59,6 +60,7 @@ COPY --from=prod-deps /home/rafiki/packages/auth/knexfile.js ./packages/auth/kne
5960COPY --from=builder /home/rafiki/packages/auth/migrations/ ./packages/auth/migrations
6061COPY --from=builder /home/rafiki/packages/auth/dist ./packages/auth/dist
6162COPY --from=builder /home/rafiki/packages/token-introspection/dist ./packages/token-introspection/dist
63+ COPY --from=builder /home/rafiki/open-payments-specifications/openapi ./open-payments-specifications/openapi
6264
6365USER root
6466
Original file line number Diff line number Diff line change @@ -14,10 +14,7 @@ import { createAccessTokenRoutes } from './accessToken/routes'
1414import { createGrantRoutes } from './grant/routes'
1515import { createInteractionRoutes } from './interaction/routes'
1616import { createOpenAPI } from '@interledger/openapi'
17- import {
18- createUnauthenticatedClient as createOpenPaymentsClient ,
19- getAuthServerOpenAPI
20- } from '@interledger/open-payments'
17+ import { createUnauthenticatedClient as createOpenPaymentsClient } from '@interledger/open-payments'
2118import { createInteractionService } from './interaction/service'
2219import { getTokenIntrospectionOpenAPI } from 'token-introspection'
2320import { Redis } from 'ioredis'
@@ -187,7 +184,12 @@ export function initIocContainer(
187184 )
188185
189186 container . singleton ( 'openApi' , async ( ) => {
190- const authServerSpec = await getAuthServerOpenAPI ( )
187+ const authServerSpec = await createOpenAPI (
188+ path . resolve (
189+ __dirname ,
190+ '../../../open-payments-specifications/openapi/auth-server.yaml'
191+ )
192+ )
191193 const idpSpec = await createOpenAPI (
192194 path . resolve ( __dirname , './openapi/specs/id-provider.yaml' )
193195 )
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ FROM base AS builder
3535COPY package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./
3636COPY packages/backend ./packages/backend
3737COPY packages/token-introspection ./packages/token-introspection
38+ COPY open-payments-specifications/openapi ./open-payments-specifications/openapi
3839
3940RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
4041 pnpm install \
@@ -60,6 +61,7 @@ COPY --from=builder /home/rafiki/packages/backend/migrations/ ./packages/backend
6061COPY --from=builder /home/rafiki/packages/backend/dist ./packages/backend/dist
6162COPY --from=builder /home/rafiki/packages/token-introspection/dist ./packages/token-introspection/dist
6263COPY --from=builder /home/rafiki/packages/backend/knexfile.js ./packages/backend/knexfile.js
64+ COPY --from=builder /home/rafiki/open-payments-specifications/openapi ./open-payments-specifications/openapi
6365
6466USER root
6567
Original file line number Diff line number Diff line change @@ -9,11 +9,9 @@ import net from 'net'
99import dns from 'dns'
1010import { createHmac } from 'crypto'
1111
12- import {
13- createAuthenticatedClient as createOpenPaymentsClient ,
14- getResourceServerOpenAPI ,
15- getWalletAddressServerOpenAPI
16- } from '@interledger/open-payments'
12+ import { createAuthenticatedClient as createOpenPaymentsClient } from '@interledger/open-payments'
13+ import { createOpenAPI } from '@interledger/openapi'
14+ import path from 'path'
1715import { StreamServer } from '@interledger/stream-receiver'
1816import axios from 'axios'
1917import {
@@ -301,8 +299,18 @@ export function initIocContainer(
301299 } )
302300
303301 container . singleton ( 'openApi' , async ( ) => {
304- const resourceServerSpec = await getResourceServerOpenAPI ( )
305- const walletAddressServerSpec = await getWalletAddressServerOpenAPI ( )
302+ const resourceServerSpec = await createOpenAPI (
303+ path . resolve (
304+ __dirname ,
305+ '../../../open-payments-specifications/openapi/resource-server.yaml'
306+ )
307+ )
308+ const walletAddressServerSpec = await createOpenAPI (
309+ path . resolve (
310+ __dirname ,
311+ '../../../open-payments-specifications/openapi/wallet-address-server.yaml'
312+ )
313+ )
306314
307315 return {
308316 resourceServerSpec,
You can’t perform that action at this time.
0 commit comments