From b6b852e8bf5faaadfe3dde9896aa0e06140fc6c8 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Mon, 2 Oct 2023 00:49:20 +0200 Subject: lnd node communication setup --- config/doom/config.org | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/doom/config.org b/config/doom/config.org index 75ebc18..55f74cc 100644 --- a/config/doom/config.org +++ b/config/doom/config.org @@ -629,7 +629,6 @@ Emacs mode for managing ledger text files :load-path "~/dev/emacs-lisp/btc-explorer/" :commands (on/bitcoin-rpc-connect) :config - (require 'lnd) (defun on/bitcoin-rpc-connect () (interactive) (let* ((networks '(:mainnet 8332 @@ -650,6 +649,20 @@ Emacs mode for managing ledger text files (json-rpc-close btc-explorer-bitcoind)) (setq btc-explorer-bitcoind (json-rpc-connect host port user (funcall secret)))))) + +(use-package! lnd + :load-path "~/dev/emacs-lisp/btc-explorer/" + :commands (on/lnd-connection) + :config + (defun on/lnd-connection () + (interactive) + (let ((nodes '(("local" "https://localhost:8480/v1/" "/mnt/disk/personal/bitcoin/lnd/data/chain/bitcoin/testnet/admin.macaroon") + ("remote" "https://localhost:8481/v1/" "~/dev/emacs-lisp/btc-explorer/admin.macaroon")))) + (cl-destructuring-bind (api macaroon-file) + (thread-first (completing-read "Pick node: " nodes) + (alist-get nodes nil nil #'string=)) + (setq lnd-api-endpoint api) + (setq lnd-admin-macaroon (encode-hex-string (f-read-bytes macaroon-file))))))) #+end_src #+begin_src emacs-lisp -- cgit v1.2.3