aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/doom/config.org15
1 files changed, 14 insertions, 1 deletions
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