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

feat!: fx and interscheme implementation #1058

Open
wants to merge 134 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 130 commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
0b62904
feat: added db migration scripts for fx
vijayg10 Nov 8, 2023
0062b7a
feat(3574): update prepare-handler to deal with FX transfers (#988)
geka-evk Nov 16, 2023
07f2888
feat(3574): added FX endpoints to seeds (#989)
geka-evk Nov 17, 2023
a70d482
feat: implement changes in position handler for FX (#986)
vijayg10 Nov 22, 2023
2dc6a1f
chore(snapshot): 17.4.0-snapshot.3
vijayg10 Nov 22, 2023
fbc3252
chore(snapshot): 17.4.0-snapshot.4
vijayg10 Nov 22, 2023
e9d0ba2
chore(snapshot): 17.4.0-snapshot.5
vijayg10 Nov 22, 2023
853c90a
chore(snapshot): 17.4.0-snapshot.6
vijayg10 Nov 22, 2023
745802f
chore(snapshot): 17.4.0-snapshot.7
vijayg10 Nov 22, 2023
55d56f5
chore(snapshot): 17.4.0-snapshot.8
vijayg10 Nov 22, 2023
7f5c80d
fix: positions
vijayg10 Nov 22, 2023
98f7fdc
fix: disable unit tests for snapshot
vijayg10 Nov 22, 2023
1fb4904
chore(snapshot): 17.4.0-snapshot.9
vijayg10 Nov 22, 2023
70d0732
chore: added docs
vijayg10 Nov 22, 2023
29136ea
chore: updated doc
vijayg10 Nov 23, 2023
a883a33
fix: normal fulfil
vijayg10 Nov 23, 2023
8be45cd
fix: normal flow
vijayg10 Nov 23, 2023
cbfe0dd
fix: updated fx diagram
vijayg10 Nov 28, 2023
c3e8af8
chore: dep update
vijayg10 Dec 4, 2023
a0e5ae6
chore(snapshot): 17.4.0-snapshot.10
vijayg10 Dec 4, 2023
77e7ff1
feat(mojaloop/#3689): fx quotes changes (#995)
oderayi Mar 8, 2024
224a3d3
chore(snapshot): 17.4.0-snapshot.12
oderayi Mar 8, 2024
c2b64c7
ci: disable unit tests and test coverage runs for snapshots
oderayi Mar 8, 2024
8155ba0
chore(snapshot): 17.4.0-snapshot.13
oderayi Mar 8, 2024
1dc7032
Merge branch main of https://github.com/mojaloop/central-ledger into …
vijayg10 Mar 13, 2024
831da00
Merge branch feat/fx-impl of https://github.com/mojaloop/central-ledg…
vijayg10 Mar 13, 2024
0979ae5
fix: manual changes from upstream commits
vijayg10 Mar 13, 2024
6df1384
chore(snapshot): 17.7.0-snapshot.0
vijayg10 Mar 13, 2024
5df3536
chore(mojaloop/#3820): fix current tests and merge in main (#1000)
kleyow Apr 2, 2024
b4ad846
test(mojaloop/#3819): harden fx prepare flow (#1002)
kleyow Apr 10, 2024
4218622
Merge branch 'main' into feat/fx-impl
geka-evk Apr 18, 2024
d917f00
test(mojaloop/#3819): prepare handler testing (#1004)
kleyow Apr 22, 2024
cf80376
chore: standardise position prepare handler (#1005)
vijayg10 Apr 23, 2024
46d7adb
feat(mojaloop/#3844): added corner cases impl. for FX; added unit-tes…
geka-evk Apr 23, 2024
ad4dd53
fix: removed fx position prepare integration tests in non batch mode …
vijayg10 Apr 24, 2024
82d2bd4
chore: fix int tests, lint and update deps (#1013)
kleyow Apr 26, 2024
05c4ce9
chore: removed unneeded kafkaHelper; excluded some files from test-co…
geka-evk Apr 27, 2024
afc4c5c
feat(mojaloop/#3844): added integration tests for fxFulfil flow (#1011)
geka-evk Apr 29, 2024
d1e1fcc
test: added transferFulfilReject.end() (#1027)
geka-evk Apr 30, 2024
cb9de40
feat: fx fulfil position batching (#1019)
vijayg10 May 1, 2024
13c95ae
chore(mojaloop/#3819): update functional tests and move fulfil int te…
kleyow May 2, 2024
7124fab
chore: add integration tests for pos fulfil fx (#1030)
vijayg10 May 3, 2024
5988eae
feat(mojaloop/#3818): added sequence and ER diagrams for transfer/fxT…
geka-evk May 7, 2024
3dba614
feat(mojaloop/#3903): update interal state on fx fulfil to RECEIVED_F…
kleyow May 10, 2024
031e16c
chore: update harness (#1031)
kleyow May 10, 2024
0b6606a
feat(mojaloop/#3904): add position event timeout reserved batch handl…
kleyow May 17, 2024
85c3499
Update README.md
vijayg10 May 27, 2024
8194902
feat: implemented timeout handler for fx (#1036)
vijayg10 May 28, 2024
f2e84ea
Merge branch main of https://github.com/mojaloop/central-ledger into …
vijayg10 May 28, 2024
1c76665
feat: enable sending events directly to Kafka (#1037)
kalinkrustev May 28, 2024
0eea335
chore(snapshot): 17.7.0-snapshot.3
kalinkrustev May 28, 2024
08c295d
feat(mojaloop/#3904): add position event fx timeout reserved batch ha…
kleyow May 31, 2024
88724f0
chore(snapshot): 17.7.0-snapshot.4
kleyow Jun 5, 2024
f71911d
audit fix and dep update
kleyow Jun 5, 2024
6d644f3
audit fix and dep update
kleyow Jun 5, 2024
7df16eb
chore(snapshot): 17.7.0-snapshot.5
kleyow Jun 5, 2024
97f5f70
image scan
kleyow Jun 5, 2024
08dd88b
chore(snapshot): 17.7.0-snapshot.6
kleyow Jun 5, 2024
e3caa32
image scan
kleyow Jun 5, 2024
e8f7816
chore(snapshot): 17.7.0-snapshot.7
kleyow Jun 5, 2024
3face13
node version
kleyow Jun 5, 2024
a653a02
chore(snapshot): 17.7.0-snapshot.8
kleyow Jun 5, 2024
7185622
revert pipeline changes to get working snapshot
kleyow Jun 7, 2024
42c84b3
chore(snapshot): 17.7.0-snapshot.9
kleyow Jun 7, 2024
5600fe1
fix typo
kleyow Jun 7, 2024
930ed0e
chore(snapshot): 17.7.0-snapshot.10
kleyow Jun 7, 2024
9498a49
fix command
kleyow Jun 7, 2024
77764c9
chore(snapshot): 17.7.0-snapshot.11
kleyow Jun 7, 2024
c484da7
fix: remove trx.rollback() (#1051)
kalinkrustev Jun 13, 2024
6736dee
fix: produce followup messages in parallel (#1052)
kalinkrustev Jun 13, 2024
ca5dca5
chore(snapshot): 17.7.0-snapshot.12
kalinkrustev Jun 13, 2024
5dda925
fix: #3932 participant currency validation for fx (#1041)
vijayg10 Jun 19, 2024
67a1c5b
fix: avoid extra db call (#1055)
kalinkrustev Jun 19, 2024
40dd4f8
chore(snapshot): 17.7.0-snapshot.13
kalinkrustev Jun 20, 2024
1f41175
chore(snapshot): 17.7.0-snapshot.14
kalinkrustev Jun 20, 2024
79c2afe
feat(csi-164): parameterize switch id (#1057)
oderayi Jun 25, 2024
3178a32
fix: migration scripts
vijayg10 Jun 26, 2024
bc0c4df
chore(snapshot): 17.7.0-snapshot.17
vijayg10 Jun 26, 2024
bc30603
fix: migration scripts
vijayg10 Jun 26, 2024
adaf989
chore(snapshot): 17.7.0-snapshot.18
vijayg10 Jun 26, 2024
5980b21
chore(snapshot): 17.7.0-snapshot.19
oderayi Jun 27, 2024
22c070b
chore(snapshot): 17.7.0-snapshot.20
oderayi Jun 27, 2024
56da4c3
Merge remote-tracking branch 'origin/main' into feat/fx-impl
kleyow Jul 4, 2024
e5c6a53
feat: extend admin api to support proxy participants (#1043)
kleyow Jul 8, 2024
0562282
fix: allow isProxy
kalinkrustev Jul 9, 2024
fef1a57
feat(mojaloop/csi-190): add new state and functionality to handle pro…
kleyow Jul 15, 2024
eaa0ce0
feat(csi-22): add proxy lib to handlers (#1060)
kleyow Jul 18, 2024
2cc0af6
feat(mojaloop/#3998): proxy obligation tracking for position changes …
oderayi Jul 23, 2024
ba1188d
fix: consider HUB_ID when seeding the hub (#1073)
kalinkrustev Jul 26, 2024
c908e94
fix: fsp id validation (#1074)
kalinkrustev Jul 30, 2024
c8e6bd6
fix: Cannot read properties of undefined
kalinkrustev Jul 30, 2024
a114ac0
chore(snapshot): 17.8.0-snapshot.1
kalinkrustev Jul 30, 2024
81ef52a
fix: name validation
kalinkrustev Jul 31, 2024
fb6798c
chore(snapshot): 17.8.0-snapshot.2
kalinkrustev Jul 31, 2024
611248d
fix: isProxy validation (#1075)
kalinkrustev Aug 1, 2024
a92187f
feat(csi-22): add prepare participant substitution (#1065)
kleyow Aug 1, 2024
2d7abfe
feat: fulfil obligation tracking (#1063)
vijayg10 Aug 6, 2024
835f672
chore(snapshot): 17.8.0-snapshot.3
kleyow Aug 8, 2024
09376df
feat(mojaloop/#3885): add migrations for storing fxQuotes (#1076)
kleyow Aug 14, 2024
a3738cd
Merge remote-tracking branch 'origin/feat/fx-impl' into feat/fx-impl
kleyow Aug 14, 2024
a8d36d5
chore(snapshot): 17.8.0-snapshot.4
kleyow Aug 14, 2024
d1a594e
feat: impl fx abort (#1077)
vijayg10 Aug 16, 2024
348f12a
chore: migration fixes (#1078)
kleyow Aug 19, 2024
06e08bc
feat: position zero messages (#1079)
vijayg10 Aug 22, 2024
420fc71
chore: add logging for admin api, proxy lookup, participant domain (#…
kleyow Aug 22, 2024
6253688
chore(snapshot): 17.8.0-snapshot.10
kleyow Aug 22, 2024
0f5192c
fix: fx fulfil header validation (#1084)
vijayg10 Aug 23, 2024
8d906d2
chore(snapshot): 17.8.0-snapshot.13
vijayg10 Aug 23, 2024
6afbc6e
ci: make redis cluster default for integration tests (#1083)
oderayi Aug 23, 2024
efe0f24
fix: fx fulfil header validation2 (#1085)
vijayg10 Aug 23, 2024
986b3d8
fix: skip validation when payer and payee are represented by proxy (#…
kleyow Aug 26, 2024
3a72c64
chore(snapshot): 17.8.0-snapshot.15
vijayg10 Aug 26, 2024
bc7b3eb
feat(csi/551): add transfer state change for proxied fxTransfer (#1087)
kleyow Sep 3, 2024
3cae6f2
fix: remove misleading commit and rollback (#1089)
kalinkrustev Sep 4, 2024
33f765d
fix: duplicate fx transfers (#1097)
vijayg10 Sep 12, 2024
eb54f67
feat(csi-633): added externalParticipant model; added JSDocs; updated…
geka-evk Sep 13, 2024
8151468
Revert "feat(csi-633): added externalParticipant model; added JSDocs;…
geka-evk Sep 13, 2024
d5b3479
fix: get fx transfer not working (#1098)
vijayg10 Sep 13, 2024
bcc6fa9
fix: fx transfer extension (#1102)
kalinkrustev Sep 16, 2024
3182803
fix: retify int tests (#1104)
kleyow Sep 16, 2024
b6e9e2b
fix: fix abort callback (#1106)
vijayg10 Sep 17, 2024
99d94df
Revert "fix: fix abort callback" (#1109)
vijayg10 Sep 17, 2024
c1a1e17
chore(snapshot): 17.8.0-snapshot.22
kalinkrustev Sep 17, 2024
0fb97a7
fix: gp failure fixes for interscheme and fx changes (#1091)
oderayi Sep 18, 2024
60ea20b
feat(csi/643): add fx-notify publishing on payer init fxTranfer succe…
kleyow Sep 18, 2024
4bf39b7
chore(snapshot): 17.8.0-snapshot.28
kalinkrustev Sep 18, 2024
610031f
fix: position changes (#1108)
vijayg10 Sep 18, 2024
69a424e
feat(csi-318): added externalParticipant table (#1092)
geka-evk Sep 19, 2024
afa1828
feat(csi-634): added mock-knex lib to mock mysql in unit-tests (#1113)
geka-evk Sep 20, 2024
cc1d482
feat: add ULID support (#1114)
kalinkrustev Sep 25, 2024
56055c3
Fix code scanning alert no. 9: Missing regular expression anchor
kalinkrustev Sep 30, 2024
5661049
fix: uuid/ulid regex
kalinkrustev Sep 30, 2024
0e4fc9e
test: start using mojaloop/build orb (#1115)
kalinkrustev Oct 11, 2024
03acfb7
fix: sonar security hot spots
kalinkrustev Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ executors:
BASH_ENV: /etc/profile ## Ref: https://circleci.com/docs/env-vars/#alpine-linux
NVM_ARCH_UNOFFICIAL_OVERRIDE: x64-musl ## Ref: https://github.com/nvm-sh/nvm/issues/1102#issuecomment-550572252
docker:
- image: node:18-alpine3.19 # Ref: https://hub.docker.com/_/node?tab=tags&page=1&name=alpine
- image: node:18.20.3-alpine3.19 # Ref: https://hub.docker.com/_/node/tags?name=18.20.3-alpine3.19

default-machine:
working_directory: *WORKING_DIR
Expand Down Expand Up @@ -309,8 +309,8 @@ jobs:
name: Build Docker local image
command: |
source ~/.profile
export DOCKER_NODE_VERSION="$NVMRC_VERSION-alpine"
echo "export DOCKER_NODE_VERSION=$NVMRC_VERSION-alpine" >> $BASH_ENV
export DOCKER_NODE_VERSION="$NVMRC_VERSION-alpine3.19"
echo "export DOCKER_NODE_VERSION=$NVMRC_VERSION-alpine3.19" >> $BASH_ENV
echo "Building Docker image: ${DOCKER_ORG:-mojaloop}/$CIRCLE_PROJECT_REPONAME:local --build-arg NODE_VERSION=$DOCKER_NODE_VERSION"
docker build -t ${DOCKER_ORG:-mojaloop}/$CIRCLE_PROJECT_REPONAME:local --build-arg NODE_VERSION=$DOCKER_NODE_VERSION .
- run:
Expand Down Expand Up @@ -343,6 +343,7 @@ jobs:
command: mkdir -p ./test/results
- run:
name: Execute integration tests
no_output_timeout: 15m
command: |
# Set Node version to default (Note: this is needed on Ubuntu)
nvm use default
Expand Down Expand Up @@ -494,14 +495,14 @@ jobs:
- run:
name: Pull base image locally
command: |
echo "Pulling docker image: node:$NVMRC_VERSION-alpine"
docker pull node:$NVMRC_VERSION-alpine
echo "Pulling docker image: node:$NVMRC_VERSION-alpine3.19"
docker pull node:$NVMRC_VERSION-alpine3.19
## Analyze the base and derived image
## Note: It seems images are scanned in parallel, so preloading the base image result doesn't give us any real performance gain
- anchore/analyze_local_image:
# Force the older version, version 0.7.0 was just published, and is broken
anchore_version: v0.6.1
image_name: "docker.io/node:$NVMRC_VERSION-alpine ${DOCKER_ORG:-mojaloop}/$CIRCLE_PROJECT_REPONAME:local"
image_name: "docker.io/node:$NVMRC_VERSION-alpine3.19 ${DOCKER_ORG:-mojaloop}/$CIRCLE_PROJECT_REPONAME:local"
policy_failure: false
timeout: '500'
# Note: if the generated policy is invalid, this will fallback to the default policy, which we don't want!
Expand All @@ -514,7 +515,7 @@ jobs:
aws s3 cp anchore-reports ${AWS_S3_DIR_ANCHORE_REPORTS}/latest/ --recursive
- run:
name: Evaluate failures
command: /tmp/ci-config/container-scanning/anchore-result-diff.js anchore-reports/node_${NVMRC_VERSION}-alpine-policy.json anchore-reports/${CIRCLE_PROJECT_REPONAME}*-policy.json
command: /tmp/ci-config/container-scanning/anchore-result-diff.js anchore-reports/node_${NVMRC_VERSION}-alpine3.19-policy.json anchore-reports/${CIRCLE_PROJECT_REPONAME}*-policy.json
- store_artifacts:
path: anchore-reports
- slack/notify:
Expand Down Expand Up @@ -872,6 +873,8 @@ workflows:
filters:
tags:
only: /.*/
# test-integration only on main and release branches. revert to /.*/ after integration test fixes
# ignore: /v[0-9]+(\.[0-9]+)*\-snapshot+((\.[0-9]+)?)/
branches:
ignore:
- /feature*/
Expand Down Expand Up @@ -1002,7 +1005,8 @@ workflows:
# - test-dependencies
- test-lint
- test-unit
- test-coverage
## To be able to release a snapshot without code coverage
# - test-coverage
- test-integration
- test-functional
- vulnerability-check
Expand Down
4 changes: 3 additions & 1 deletion .ncurc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ reject: [
"get-port",
# sinon v17.0.1 causes 58 tests to fail. This will need to be resolved in a future story.
# Issue is tracked here: https://github.com/mojaloop/project/issues/3616
"sinon"
"sinon",
# glob >= 11 requires node >= 20
"glob"
]
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
18.20.3
17 changes: 16 additions & 1 deletion .nycrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,20 @@ exclude: [
"**/node_modules/**",
'**/migrations/**',
'**/ddl/**',
'**/bulk*/**'
'**/bulk*/**',
'src/shared/logger/**',
'src/shared/loggingPlugin.js',
'src/shared/constants.js',
'src/domain/position/index.js',
'src/domain/position/binProcessor.js',
'src/handlers/positions/handler.js',
'src/handlers/transfers/createRemittanceEntity.js',
'src/handlers/transfers/FxFulfilService.js',
'src/models/position/batch.js',
'src/models/fxTransfer/**',
'src/models/participant/externalParticipantCached.js', # todo: figure out why it shows only 50% coverage in Branch
'src/models/transfer/facade.js', ## add more test coverage
'src/shared/fspiopErrorFactory.js',
'src/lib/proxyCache.js' # todo: remove this line after adding test coverage
]
## todo: increase test coverage before merging feat/fx-impl to main branch
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@

# NOTE: Ensure you set NODE_VERSION Build Argument as follows...
#
# export NODE_VERSION="$(cat .nvmrc)-alpine" \
# docker build \
# --build-arg NODE_VERSION=$NODE_VERSION \
# -t mojaloop/central-ledger:local \
# . \
# export NODE_VERSION="$(cat .nvmrc)-alpine"
# docker build \
# --build-arg NODE_VERSION=$NODE_VERSION \
# -t mojaloop/central-ledger:local \
# .
#

# Build Image
FROM node:${NODE_VERSION} as builder
FROM node:${NODE_VERSION} AS builder

WORKDIR /opt/app

RUN apk --no-cache add git
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 libtool openssl-dev autoconf automake bash \
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 py3-setuptools libtool openssl-dev autoconf automake bash \

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarCloud
&& cd $(npm root -g)/npm \
&& npm install -g node-gyp

COPY package.json package-lock.json* /opt/app/

RUN npm ci
RUN npm prune --omit=dev

FROM node:${NODE_VERSION}
WORKDIR /opt/app
Expand All @@ -32,7 +33,7 @@
RUN ln -sf /dev/stdout ./logs/combined.log

# Create a non-root user: ml-user
RUN adduser -D ml-user
RUN adduser -D ml-user
USER ml-user

COPY --chown=ml-user --from=builder /opt/app .
Expand All @@ -43,7 +44,5 @@
COPY seeds /opt/app/seeds
COPY test /opt/app/test

RUN npm prune --production

EXPOSE 3001
CMD ["npm", "run", "start"]
48 changes: 39 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Or via docker build directly:

```bash
docker build \
--build-arg NODE_VERSION="$(cat .nvmrc)-alpine" \
--build-arg NODE_VERSION="$(cat .nvmrc)-alpine3.19" \
-t mojaloop/ml-api-adapter:local \
.
```
Expand Down Expand Up @@ -113,21 +113,27 @@ NOTE: Only POSITION.PREPARE and POSITION.COMMIT is supported at this time, with

Batch processing can be enabled in the transfer execution flow. Follow the steps below to enable batch processing for a more efficient transfer execution:

Note: The position messages with action 'FX_PREPARE', 'FX_COMMIT' and 'FX_TIMEOUT_RESERVED' are only supported in batch processing.

- **Step 1:** **Create a New Kafka Topic**

Create a new Kafka topic named `topic-transfer-position-batch` to handle batch processing events.
- **Step 2:** **Configure Action Type Mapping**

Point the prepare handler to the newly created topic for the action type `prepare` using the `KAFKA.EVENT_TYPE_ACTION_TOPIC_MAP` configuration as shown below:
Point the prepare handler to the newly created topic for the action types those are supported in batch processing using the `KAFKA.EVENT_TYPE_ACTION_TOPIC_MAP` configuration as shown below:
```
"KAFKA": {
"EVENT_TYPE_ACTION_TOPIC_MAP" : {
"POSITION":{
"PREPARE": "topic-transfer-position-batch",
"BULK_PREPARE": "topic-transfer-position",
"COMMIT": "topic-transfer-position-batch",
"FX_COMMIT": "topic-transfer-position-batch",
"BULK_COMMIT": "topic-transfer-position",
"RESERVE": "topic-transfer-position",
"FX_PREPARE": "topic-transfer-position-batch",
"TIMEOUT_RESERVED": "topic-transfer-position-batch",
"FX_TIMEOUT_RESERVED": "topic-transfer-position-batch"
}
}
}
Expand Down Expand Up @@ -185,7 +191,8 @@ If you want to run integration tests in a repetitive manner, you can startup the
Start containers required for Integration Tests

```bash
docker-compose -f docker-compose.yml up -d mysql kafka init-kafka kafka-debug-console
source ./docker/env.sh
docker compose up -d mysql kafka init-kafka redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
```

Run wait script which will report once all required containers are up and running
Expand Down Expand Up @@ -220,7 +227,8 @@ If you want to run integration tests in a repetitive manner, you can startup the
Start containers required for Integration Tests, including a `central-ledger` container which will be used as a proxy shell.

```bash
docker-compose -f docker-compose.yml -f docker-compose.integration.yml up -d kafka mysql central-ledger
source ./docker/env.sh
docker-compose -f docker-compose.yml -f docker-compose.integration.yml up -d kafka mysql central-ledger init-kafka redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
```

Run the Integration Tests from the `central-ledger` container
Expand All @@ -235,24 +243,42 @@ If you want to run override position topic tests you can repeat the above and us

#### For running integration tests for batch processing interactively
- Run dependecies
```
docker-compose up -d mysql kafka init-kafka kafka-debug-console
```bash
source ./docker/env.sh
docker compose up -d mysql kafka init-kafka redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
npm run wait-4-docker
```
- Run central-ledger services
```
nvm use
npm run migrate
env "CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch" npm start
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__COMMIT=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__RESERVE=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__TIMEOUT_RESERVED=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__FX_TIMEOUT_RESERVED=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__ABORT=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__FX_ABORT=topic-transfer-position-batch
npm start
```
- Additionally, run position batch handler in a new terminal
```
nvm use
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__FX_PREPARE=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__COMMIT=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__TIMEOUT_RESERVED=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__FX_TIMEOUT_RESERVED=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__ABORT=topic-transfer-position-batch
export CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__FX_ABORT=topic-transfer-position-batch
export CLEDG_HANDLERS__API__DISABLED=true
node src/handlers/index.js handler --positionbatch
```
- Run tests using `npx tape 'test/integration-override/**/handlerBatch.test.js'`
- Run tests using the following commands in a new terminal
```
nvm use
npm run test:int-override
```


If you want to just run all of the integration suite non-interactively then use npm run `test:integration`.
Expand All @@ -263,7 +289,11 @@ It will handle docker start up, migration, service starting and testing. Be sure
If you want to run functional tests locally utilizing the [ml-core-test-harness](https://github.com/mojaloop/ml-core-test-harness), you can run the following commands:

```bash
docker build -t mojaloop/central-ledger:local .
export NODE_VERSION="$(cat .nvmrc)-alpine"
docker build \
--build-arg NODE_VERSION=$NODE_VERSION \
-t mojaloop/central-ledger:local \
.
```

```bash
Expand Down
17 changes: 15 additions & 2 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
// Only use one of ["low": true, "moderate": true, "high": true, "critical": true]
"moderate": true,
"allowlist": [ // NOTE: Please add as much information as possible to any items added to the allowList
"GHSA-w5p7-h5w8-2hfq" // tap-spec>tap-out>trim; This has been analyzed and this is acceptable as it is used to run tests.
"GHSA-w5p7-h5w8-2hfq", // tap-spec>tap-out>trim; This has been analyzed and this is acceptable as it is used to run tests.
"GHSA-2mvq-xp48-4c77", // https://github.com/advisories/GHSA-2mvq-xp48-4c77
"GHSA-5854-jvxx-2cg9", // https://github.com/advisories/GHSA-5854-jvxx-2cg9
"GHSA-7hx8-2rxv-66xv", // https://github.com/advisories/GHSA-7hx8-2rxv-66xv
"GHSA-c429-5p7v-vgjp", // https://github.com/advisories/GHSA-c429-5p7v-vgjp
"GHSA-g64q-3vg8-8f93", // https://github.com/advisories/GHSA-g64q-3vg8-8f93
"GHSA-mg85-8mv5-ffjr", // https://github.com/advisories/GHSA-mg85-8mv5-ffjr
"GHSA-8hc4-vh64-cxmj", // https://github.com/advisories/GHSA-8hc4-vh64-cxmj
"GHSA-952p-6rrq-rcjv", // https://github.com/advisories/GHSA-952p-6rrq-rcjv
"GHSA-9wv6-86v2-598j", // https://github.com/advisories/GHSA-9wv6-86v2-598j
"GHSA-qwcr-r2fm-qrc7", // https://github.com/advisories/GHSA-qwcr-r2fm-qrc7
"GHSA-cm22-4g7w-348p", // https://github.com/advisories/GHSA-cm22-4g7w-348p
"GHSA-m6fv-jmcg-4jfg", // https://github.com/advisories/GHSA-m6fv-jmcg-4jfg
"GHSA-qw6h-vgh9-j6wx" // https://github.com/advisories/GHSA-qw6h-vgh9-j6wx
]
}
}
18 changes: 17 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,36 @@
},
"INTERNAL_TRANSFER_VALIDITY_SECONDS": "432000",
"ENABLE_ON_US_TRANSFERS": false,
"PAYEE_PARTICIPANT_CURRENCY_VALIDATION_ENABLED": false,
"CACHE": {
"CACHE_ENABLED": false,
"MAX_BYTE_SIZE": 10000000,
"EXPIRES_IN_MS": 1000
},
"PROXY_CACHE": {
"enabled": true,
"type": "redis-cluster",
"proxyConfig": {
"cluster": [
{ "host": "localhost", "port": 6379 }
]
}
},
"API_DOC_ENDPOINTS_ENABLED": true,
"KAFKA": {
"EVENT_TYPE_ACTION_TOPIC_MAP" : {
"POSITION":{
"PREPARE": null,
"FX_PREPARE": "topic-transfer-position-batch",
"BULK_PREPARE": null,
"COMMIT": null,
"BULK_COMMIT": null,
"RESERVE": null
"RESERVE": null,
"FX_RESERVE": "topic-transfer-position-batch",
"TIMEOUT_RESERVED": null,
"FX_TIMEOUT_RESERVED": "topic-transfer-position-batch",
"ABORT": null,
"FX_ABORT": "topic-transfer-position-batch"
}
},
"TOPIC_TEMPLATES": {
Expand Down
Loading