17.6.2 • Published 16 hours ago

@mojaloop/central-ledger v17.6.2

Weekly downloads
85
License
Apache-2.0
Repository
github
Last release
16 hours ago

central-ledger

Git Commit Git Releases Docker pulls CircleCI

The central ledger is a series of services that facilitate clearing and settlement of transfers between DFSPs, including the following functions:

  • Brokering real-time messaging for funds clearing
  • Maintaining net positions for a deferred net settlement
  • Propagating scheme-level and off-transfer fees

The following documentation represents the services, APIs and endpoints responsible for various ledger functions.

Contents:

Deployment

See the Onboarding guide for running the service locally.

Configuration

Environment variables

The Central Ledger has many options that can be configured through environment variables.

Environment variableDescriptionExample values
CLEDG_DATABASE_URIThe connection string for the database the central ledger will use. Postgres is currently the only supported database.postgres://\:\@localhost:5432/central_ledger
CLEDG_PORTThe port the API server will run on.3000
CLEDG_ADMIN_PORTThe port the Admin server will run on.3001
CLEDG_HOSTNAMEThe URI that will be used to create and validate links to resources on the central ledger.http://central-ledger
CLEDG_ENABLE_BASIC_AUTHFlag to enable basic auth protection on endpoints that require authorization. Username and password would be the account name and password.false
CLEDG_ENABLE_TOKEN_AUTHFlag to enable token protection on endpoints that require authorization. To create a token, reference the API documentation.false
CLEDG_LEDGER_ACCOUNT_NAMEName of the account setup to receive fees owed to the central ledger. If the account doesn't exist, it will be created on start up.LedgerName
CLEDG_LEDGER_ACCOUNT_PASSWORDPassword of the account setup to receive fees owed to the central ledger.LedgerPassword
CLEDG_ADMIN_KEYKey used for admin access to endpoints that require validation.AdminKey
CLEDG_ADMIN_SECRETSecret used for admin access to endpoints that require validation. Secret also used to sign JWTs used for Admin API.AdminSecret
CLEDG_TOKEN_EXPIRATIONTime in milliseconds for Admin API tokens to expire.3600000
CLEDG_EXPIRES_TIMEOUTTime in milliseconds to determine how often transfer expiration process runs.5000
CLEDG_AMOUNT__PRECISIONNumeric value used to determine precision recorded for transfer amounts on this ledger.10
CLEDG_AMOUNT__SCALENumeric value used to determine scale recorded for transfer amounts on this ledger.2

API

For endpoint documentation, see the API documentation.

For help preparing and executing transfers, see the Transfer Guide

Logging

Logs are sent to standard output by default.

Tests

Tests include unit, functional, and integration.

Running the tests:

    npm run test:all

Tests include code coverage via istanbul. See the test/ folder for testing scripts.

Running Integration Tests interactively-ish

If you want to run integration tests in a repetitive manner, you can startup the test containers using docker-compose, login to running central-ledger container like so:

docker-compose -f docker-compose.yml -f docker-compose.integration.yml up kafka mysql central-ledger

#in a new shell
docker exec -it cl_central-ledger sh
npm run migrate #first time only
npm run test:int

Auditing Dependencies

We use npm-audit-resolver along with npm audit to check dependencies for vulnerabilities, and keep track of resolved dependencies with an audit-resolv.json file.

To start a new resolution process, run:

npm run audit:resolve

You can then check to see if the CI will pass based on the current dependencies with:

npm run audit:check

And commit the changed audit-resolv.json to ensure that CircleCI will build correctly.

17.6.4-snapshot.0

16 hours ago

17.6.2

1 day ago

17.6.1

1 month ago

17.6.1-snapshot.0

2 months ago

17.6.1-snapshot.1

2 months ago

17.7.0-snapshot.0

2 months ago

17.4.0-snapshot.13

2 months ago

17.6.0

4 months ago

17.5.0

5 months ago

17.5.0-snapshot.0

5 months ago

17.4.1

5 months ago

17.4.0

5 months ago

17.4.0-snapshot.0

6 months ago

17.4.0-snapshot.2

6 months ago

17.4.0-snapshot.1

6 months ago

17.4.0-snapshot.4

6 months ago

17.4.0-snapshot.6

6 months ago

17.4.0-snapshot.7

6 months ago

17.2.1-snapshot.2

7 months ago

17.3.0

6 months ago

17.1.2

8 months ago

17.1.1

8 months ago

17.3.2

6 months ago

17.3.1

6 months ago

17.2.1-snapshot.1

7 months ago

17.1.0

8 months ago

17.3.0-snapshot.7

7 months ago

17.3.0-snapshot.6

7 months ago

17.3.0-snapshot.5

7 months ago

17.0.4-snapshot.1

8 months ago

17.3.0-snapshot.4

7 months ago

17.3.0-snapshot.3

7 months ago

17.3.0-snapshot.2

7 months ago

17.0.4-snapshot.0

9 months ago

17.3.0-snapshot.1

7 months ago

17.0.4-snapshot.5

8 months ago

17.3.0-snapshot.0

7 months ago

17.0.4-snapshot.6

8 months ago

17.0.4-snapshot.4

8 months ago

17.3.2-snapshot.0

6 months ago

17.2.1

7 months ago

17.2.0

8 months ago

17.0.5

8 months ago

17.0.4

8 months ago

17.2.0-snapshot.1

7 months ago

17.0.3

1 year ago

17.0.2

1 year ago

17.0.1

1 year ago

17.0.0

1 year ago

16.3.3

1 year ago

16.3.2

1 year ago

16.4.0

1 year ago

16.3.1

1 year ago

16.3.0

2 years ago

15.2.0

2 years ago

15.1.3

2 years ago

16.2.0

2 years ago

16.1.0

2 years ago

16.0.0

2 years ago

13.10.0

3 years ago

13.0.0

3 years ago

9.2.2

4 years ago

9.2.0

4 years ago

8.2.4

5 years ago

8.1.1

5 years ago

7.4.0

5 years ago

7.3.1

5 years ago

5.2.1

5 years ago

5.2.0

5 years ago

3.7.1-snapshot

6 years ago

3.7.0-snapshot

6 years ago