-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/cleanCodeInprove' into develop
- Loading branch information
Showing
31 changed files
with
14,970 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,3 +68,5 @@ typings/ | |
data/* | ||
# sessionDB local | ||
SessionDB/data/redis-data | ||
sonar-project.properties | ||
.scannerwork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
# 2wp-api | ||
|
||
This application is generated using [LoopBack 4 CLI](https://loopback.io/doc/en/lb4/Command-line-interface.html) with the | ||
[initial project layout](https://loopback.io/doc/en/lb4/Loopback-application-layout.html). | ||
|
||
## Install dependencies | ||
|
||
By default, dependencies were installed when this application was generated. | ||
Whenever dependencies in `package.json` are changed, run the following command: | ||
This is the API component for 2-Way-Peg solution. | ||
## Development Mode | ||
Include a .env file with the required environment variables: | ||
```js | ||
NETWORK='testnet' // or mainnet | ||
FEDERATION_ADDRESS=<Address> | ||
BTC_CONFIRMATIONS=100 // default | ||
INPUT_SIZE=180 // default | ||
FAST_MINING_BLOCK=1 | ||
AVERAGE_MINING_BLOCK=6 | ||
LOW_MINING_BLOCK=12 | ||
LEGACY_REGEX='^[mn][1-9A-HJ-NP-Za-km-z]{26,35}' // testnet | ||
SEGWIT_REGEX='^[2][1-9A-HJ-NP-Za-km-z]{26,35}' // testnet | ||
NATIVE_SEGWIT_REGEX='^[tb][0-9A-HJ-NP-Za-z]{26,41}' // testnet | ||
SESSIONDB_HOST=<HOST> | ||
SESSIONDB_PORT=<PORT> | ||
SESSIONDB_PASSWORD=<PASSWORD> | ||
SESSIONDB_INDEX=<INDEX> // default 1 | ||
BRIDGE_ADDRESS='0x0000000000000000000000000000000001000006' // default | ||
RSK_NODE_HOST=<RSK_NODE_HOST:PORT> | ||
``` | ||
### Install dependencies | ||
|
||
```sh | ||
npm install | ||
|
@@ -17,30 +32,21 @@ To only install resolved dependencies in `package-lock.json`: | |
```sh | ||
npm ci | ||
``` | ||
### Session DB | ||
Move to the `SessionDB` folder and run: | ||
|
||
## Run the application | ||
```sh | ||
docker-compose up | ||
``` | ||
|
||
## Run the application | ||
```sh | ||
npm start | ||
``` | ||
|
||
You can also run `node .` to skip the build step. | ||
|
||
Open http://127.0.0.1:3000 in your browser. | ||
|
||
## Rebuild the project | ||
|
||
To incrementally build the project: | ||
|
||
```sh | ||
npm run build | ||
``` | ||
|
||
To force a full build by cleaning up cached artifacts: | ||
|
||
```sh | ||
npm run rebuild | ||
``` | ||
|
||
## Fix code style and formatting issues | ||
|
||
|
@@ -56,7 +62,6 @@ npm run lint:fix | |
|
||
## Other useful commands | ||
|
||
- `npm run migrate`: Migrate database schemas for models | ||
- `npm run openapi-spec`: Generate OpenAPI spec into a file | ||
- `npm run docker:build`: Build a Docker image for this application | ||
- `npm run docker:run`: Run this application inside a Docker container | ||
|
@@ -67,9 +72,4 @@ npm run lint:fix | |
npm test | ||
``` | ||
|
||
## What's next | ||
|
||
Please check out [LoopBack 4 documentation](https://loopback.io/doc/en/lb4/) to | ||
understand how you can continue to add features to this application. | ||
|
||
[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)[email protected])](http://loopback.io/) |
Oops, something went wrong.