From a9ef1ebd660488c0b455de4a7ccf87ee5bad7328 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 23 Aug 2021 15:30:13 -0700 Subject: [PATCH] using new code for responding to JSON RPC commands --- src/controllers/json-rpc/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/controllers/json-rpc/index.js b/src/controllers/json-rpc/index.js index e25a68d..6b009e5 100644 --- a/src/controllers/json-rpc/index.js +++ b/src/controllers/json-rpc/index.js @@ -43,7 +43,7 @@ class JSONRPC { // which controller to route the instruction to. async router (str, from) { try { - // console.log('router str: ', str) + console.log('router str: ', str) console.log('router from: ', from) // Exit quietly if 'from' is not specified. @@ -96,7 +96,14 @@ class JSONRPC { // Encrypt and publish the response to the originators private OrbitDB, // if ipfs-coord has been initialized and the peers ID is registered. if (_this.ipfsCoord.ipfs) { - await _this.ipfsCoord.ipfs.orbitdb.sendToDb(from, retStr) + // await _this.ipfsCoord.ipfs.orbitdb.sendToDb(from, retStr) + console.log('responding to JSON RPC command') + const thisNode = _this.ipfsCoord.thisNode + await _this.ipfsCoord.useCases.peer.sendPrivateMessage( + from, + retStr, + thisNode + ) } // Return the response and originator. Useful for testing.