From 7a45fbc2ea7d409cb7ba8db01fab33db5daaf855 Mon Sep 17 00:00:00 2001 From: Botrel Kilian Date: Thu, 23 Sep 2021 22:59:54 +0200 Subject: [PATCH 1/3] feat: some dev script to ease up the local setup --- Dockerfile | 2 +- dev/package.json | 12 ++++++++++++ package.json | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 dev/package.json diff --git a/Dockerfile b/Dockerfile index 6cfd2c7..a990b27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN yarn config --silent set cache-folder .yarn && \ FROM node:14.17-alpine ENV NODE_ENV="production" -ENV APP_VERSION=0.0.1 +ENV APP_VERSION=0.0.3 ENV API_PORT=4242 ENV BITCOIN_NETWORK="mainnet" ENV LNMARKETS_API_URL="https://api.lnmarkets.com" diff --git a/dev/package.json b/dev/package.json new file mode 100644 index 0000000..c3b43be --- /dev/null +++ b/dev/package.json @@ -0,0 +1,12 @@ +{ + "name": "dev", + "version": "1.0.0", + "description": "Easy access to dev commands", + "main": "index.js", + "author": "BOTREL Kilian", + "license": "MIT", + "scripts": { + "start": "cd infra && docker-compose up -d ; cd .. ; docker-compose up -d", + "stop": "docker-compose down ; cd infra ; docker-compose down" + } +} diff --git a/package.json b/package.json index eef2336..d6e60b4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ }, "workspaces": [ "apps/api", - "apps/front" + "apps/front", + "dev" ], "dependencies": { "dotenv": "^10.0.0" From 1989089df279d7c09bc834d25ec2258ed6113e4e Mon Sep 17 00:00:00 2001 From: Botrel Kilian Date: Thu, 23 Sep 2021 23:00:41 +0200 Subject: [PATCH 2/3] fix: reduce bug with 0 initial value --- apps/front/src/store/futures/getters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/front/src/store/futures/getters.js b/apps/front/src/store/futures/getters.js index a085a5c..f26bda0 100644 --- a/apps/front/src/store/futures/getters.js +++ b/apps/front/src/store/futures/getters.js @@ -16,6 +16,6 @@ export default { }, computePL: (state) => { - return state.running.reduce((a, b) => ({ pl: a.pl + b.pl })).pl + return state.running.reduce((a, b) => ({ pl: a.pl + b.pl }), { pl: 0 }).pl }, } From 856a8e0f6e7269ebbe30f59143e7825420c5c2c1 Mon Sep 17 00:00:00 2001 From: Botrel Kilian Date: Thu, 23 Sep 2021 23:07:18 +0200 Subject: [PATCH 3/3] docs: updated how to launch dev environment --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 04692ba..49fcb78 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ This environment is linked to the **testnet** version of LN Markets. ### Setting up the app: ```shell - $> cd dev/infra ; docker-compose up -d - $> cd .. docker-compose up -d + $> yarn workspace dev start ``` After launching `infra` for the first time, `bitcoin-testnet` container might takes several minutes to sync to the current state of the bitcoin testnet blockchain. During this time you can start interacting with `lnmarkets_umbrel_lnd` to setup your wallet and channels with LN Markets.