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 27
27
timeout-minutes : 25
28
28
steps :
29
29
- uses : actions/checkout@v4
30
+ with :
31
+ submodules : recursive
32
+ fetch-depth : 0
30
33
- uses : ./.github/workflows/rafiki/env-setup
31
34
- run : pnpm --filter backend build:deps
32
35
- run : NODE_OPTIONS="--max-old-space-size=4096" pnpm --filter backend test:ci
53
56
timeout-minutes : 5
54
57
steps :
55
58
- uses : actions/checkout@v4
59
+ with :
60
+ submodules : recursive
61
+ fetch-depth : 0
56
62
- uses : ./.github/workflows/rafiki/env-setup
57
63
- run : pnpm --filter auth build:deps
58
64
- run : pnpm --filter auth test
@@ -143,6 +149,9 @@ jobs:
143
149
steps :
144
150
- name : Checkout code
145
151
uses : actions/checkout@v4
152
+ with :
153
+ submodules : recursive
154
+ fetch-depth : 0
146
155
147
156
- name : Setup environment
148
157
uses : ./.github/workflows/rafiki/env-setup
@@ -166,6 +175,9 @@ jobs:
166
175
steps :
167
176
- name : Checkout code
168
177
uses : actions/checkout@v4
178
+ with :
179
+ submodules : recursive
180
+ fetch-depth : 0
169
181
170
182
- name : Setup environment
171
183
uses : ./.github/workflows/rafiki/env-setup
@@ -396,6 +408,8 @@ jobs:
396
408
- backend
397
409
- frontend
398
410
steps :
411
+ - name : Checkout code
412
+ uses : actions/checkout@v4
399
413
- name : Set up Docker Buildx
400
414
uses : docker/setup-buildx-action@v3
401
415
- 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 14
14
** /styles /* .css
15
15
.docusaurus
16
16
.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
67
67
``` sh
68
68
git clone https://github.com/interledger/rafiki.git
69
69
cd rafiki
70
+ git submodule update --init --recursive
70
71
```
71
72
72
73
Install Node.js
@@ -94,6 +95,22 @@ Install dependencies
94
95
pnpm i
95
96
```
96
97
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
+
97
114
### Local Development
98
115
99
116
The 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
79
79
pnpm localenv:compose down --volumes --rmi all
80
80
```
81
81
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
+
82
96
# Environment components
83
97
84
98
![ 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
35
35
COPY package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./
36
36
COPY packages/auth ./packages/auth
37
37
COPY packages/token-introspection ./packages/token-introspection
38
+ COPY open-payments-specifications/openapi ./open-payments-specifications/openapi
38
39
39
40
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
40
41
pnpm install \
@@ -59,6 +60,7 @@ COPY --from=prod-deps /home/rafiki/packages/auth/knexfile.js ./packages/auth/kne
59
60
COPY --from=builder /home/rafiki/packages/auth/migrations/ ./packages/auth/migrations
60
61
COPY --from=builder /home/rafiki/packages/auth/dist ./packages/auth/dist
61
62
COPY --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
62
64
63
65
USER root
64
66
Original file line number Diff line number Diff line change @@ -14,10 +14,7 @@ import { createAccessTokenRoutes } from './accessToken/routes'
14
14
import { createGrantRoutes } from './grant/routes'
15
15
import { createInteractionRoutes } from './interaction/routes'
16
16
import { 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'
21
18
import { createInteractionService } from './interaction/service'
22
19
import { getTokenIntrospectionOpenAPI } from 'token-introspection'
23
20
import { Redis } from 'ioredis'
@@ -187,7 +184,12 @@ export function initIocContainer(
187
184
)
188
185
189
186
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
+ )
191
193
const idpSpec = await createOpenAPI (
192
194
path . resolve ( __dirname , './openapi/specs/id-provider.yaml' )
193
195
)
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ FROM base AS builder
35
35
COPY package.json pnpm-workspace.yaml .npmrc tsconfig.json tsconfig.build.json ./
36
36
COPY packages/backend ./packages/backend
37
37
COPY packages/token-introspection ./packages/token-introspection
38
+ COPY open-payments-specifications/openapi ./open-payments-specifications/openapi
38
39
39
40
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
40
41
pnpm install \
@@ -60,6 +61,7 @@ COPY --from=builder /home/rafiki/packages/backend/migrations/ ./packages/backend
60
61
COPY --from=builder /home/rafiki/packages/backend/dist ./packages/backend/dist
61
62
COPY --from=builder /home/rafiki/packages/token-introspection/dist ./packages/token-introspection/dist
62
63
COPY --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
63
65
64
66
USER root
65
67
Original file line number Diff line number Diff line change @@ -9,11 +9,9 @@ import net from 'net'
9
9
import dns from 'dns'
10
10
import { createHmac } from 'crypto'
11
11
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'
17
15
import { StreamServer } from '@interledger/stream-receiver'
18
16
import axios from 'axios'
19
17
import {
@@ -301,8 +299,18 @@ export function initIocContainer(
301
299
} )
302
300
303
301
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
+ )
306
314
307
315
return {
308
316
resourceServerSpec,
You can’t perform that action at this time.
0 commit comments