From 7d09c44809835c8253c96d39263b076f838c0d29 Mon Sep 17 00:00:00 2001 From: emad-salah Date: Sat, 3 Jul 2021 16:53:15 +0100 Subject: [PATCH 01/32] Added presence middleware to sockets --- services/gunDB/sockets/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/gunDB/sockets/index.js b/services/gunDB/sockets/index.js index bdab8b56..a1427703 100644 --- a/services/gunDB/sockets/index.js +++ b/services/gunDB/sockets/index.js @@ -10,6 +10,7 @@ const { getGun, getUser, isAuthenticated } = require('../Mediator') const { deepDecryptIfNeeded } = require('../rpc') const Subscriptions = require('./subscriptions') const GunEvents = require('../contact-api/events') +const GunActions = require('../../gunDB/contact-api/actions') const { encryptedEmit, encryptedOn, @@ -243,6 +244,12 @@ const startSocket = socket => { socket.emit(Common.Constants.ErrorCode.NOT_AUTH) } + if (isAuthenticated()) { + socket.onAny(() => { + GunActions.setLastSeenApp() + }) + } + on('subscribe:query', ({ $shock, publicKey }, response) => { const subscriptionId = uuidv4() try { From f4db94b2546e57cc365bfe8c0560f28dcb6d5456 Mon Sep 17 00:00:00 2001 From: Erfan Besharat Date: Mon, 12 Jul 2021 19:33:29 +0430 Subject: [PATCH 02/32] Add volumes to Docker README --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4206e57..0df88fbc 100644 --- a/README.md +++ b/README.md @@ -57,14 +57,19 @@ yarn install To run ShockAPI in a fully isolated environment you can use the Docker image provided on the Docker Hub and easily interact with API's CLI interface and flags. +#### Prerequisites +To interact with ShockAPI's Docker image you need an instance of LND running and +also if your configs, LND related files and certificates are located on a local file system you'll need to mount **Docker Volumes** pointed to them while starting the container. + Example of listing available configuration flags: ``` docker run --rm shockwallet/api:latest --help ``` -Example of running an local instance: +Example of running an local instance with mounted volumes: ``` -docker run shockwallet/api:latest -h 0.0.0.0 -c +docker run -v /home/$USER/.lnd:/root/.lnd --network host shockwallet/api:latest ``` +