aboutsummaryrefslogtreecommitdiffstats
path: root/config/doom
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-10-02 00:49:20 +0200
committerOscar Najera <hi@oscarnajera.com>2023-10-02 00:49:20 +0200
commitb6b852e8bf5faaadfe3dde9896aa0e06140fc6c8 (patch)
treef2dd9d589ae0e00e347ffec035fe087f823e0481 /config/doom
parent2a4b9687993b001f0614e3fb96cae24af73aede7 (diff)
downloaddotfiles-b6b852e8bf5faaadfe3dde9896aa0e06140fc6c8.tar.gz
dotfiles-b6b852e8bf5faaadfe3dde9896aa0e06140fc6c8.tar.bz2
dotfiles-b6b852e8bf5faaadfe3dde9896aa0e06140fc6c8.zip
lnd node communication setup
Diffstat (limited to 'config/doom')
-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