aboutsummaryrefslogtreecommitdiffstats
path: root/config/doom
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-02-07 20:07:05 +0100
committerOscar Najera <hi@oscarnajera.com>2023-03-03 11:54:38 +0100
commita09670691310155c9b5aac9515de44c8b0abb9c2 (patch)
treea301d5005e36a2999188e059cdaff0e6ab4b90e2 /config/doom
parent0737df7e83efb66410e1a40d64bfa7c664a1d35b (diff)
downloaddotfiles-a09670691310155c9b5aac9515de44c8b0abb9c2.tar.gz
dotfiles-a09670691310155c9b5aac9515de44c8b0abb9c2.tar.bz2
dotfiles-a09670691310155c9b5aac9515de44c8b0abb9c2.zip
Bitcoin rpc connect and explorer
Diffstat (limited to 'config/doom')
-rw-r--r--config/doom/config.org24
1 files changed, 24 insertions, 0 deletions
diff --git a/config/doom/config.org b/config/doom/config.org
index b867722..6caedcb 100644
--- a/config/doom/config.org
+++ b/config/doom/config.org
@@ -563,7 +563,31 @@ Emacs mode for managing ledger text files
#+end_src
#+begin_src emacs-lisp
(use-package! json-rpc)
+
+(use-package! btc-explorer
+ :load-path "~/dev/emacs-lisp/btc-explorer/"
+ :commands (on/bitcoin-rpc-connect)
+ :config
+ (defun on/bitcoin-rpc-connect ()
+ (interactive)
+ (let* ((networks '(:mainnet 8332
+ :testnet 18332
+ :regtest 18443))
+ (host "localhost")
+ (user "crazy")
+ (port (plist-get networks
+ (intern (completing-read "Pick network: " networks))))
+ (secret (-some->
+ (auth-source-search :host host)
+ (car)
+ (plist-get :secret))))
+ (when (and btc-explorer-bitcoind
+ (json-rpc-live-p btc-explorer-bitcoind))
+ (json-rpc-close btc-explorer-bitcoind))
+ (setq btc-explorer-bitcoind
+ (json-rpc-connect host port user (funcall secret))))))
#+end_src
+
#+begin_src emacs-lisp
(use-package! shepherd
:load-path "~/dev/dotfiles/elisp/"