From 94dc1300afc815303494bfbf75d583cd2cfb9ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Thu, 7 Jul 2022 00:48:46 +0200 Subject: cardano new namespace and services --- config/doom/config.org | 25 +++++++++++++++++++------ config/shepherd/init.d/cardano.scm | 15 +++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/config/doom/config.org b/config/doom/config.org index bca39c4..4708246 100644 --- a/config/doom/config.org +++ b/config/doom/config.org @@ -421,30 +421,43 @@ Emacs mode for managing ledger text files ** Crypto #+begin_src emacs-lisp (use-package! cardano-tx - :commands (cardano-tx-new cardano-cli-tip) + :commands (cardano-tx-new cardano-tx-cli-tip) :load-path "~/dev/cardano/emacs-wallet" :init (defun on/cardano-set-network () (interactive) (let* ((networks '((:mainnet "/tmp/alinamn.socket" "http://localhost:8090" "--mainnet") (:testnet "/tmp/alinatn.socket" "http://localhost:8091" "--testnet-magic" "1097911063") + (:vasil "/home/titan/test-cardano/dev-vasil/bp-vasil.socket" "http://localhost:8093" "--testnet-magic" "9") )) (pick (alist-get (completing-read "Pick network" networks) networks nil nil #'string=))) - (setq cardano-cli-node-socket (expand-file-name (car pick)) + (setq cardano-tx-cli-node-socket (expand-file-name (car pick)) cardano-wallet-url (cadr pick) - cardano-cli-network-args (cddr pick)))) + cardano-tx-cli-network-args (cddr pick)))) :config - (setq cardano-log-level 'debug) - (setq cardano-cli-command (expand-file-name "~/dev/cardano/cardano-node/cli")) - (setq cardano-db-keyring-dir "~/dev/cardano/emacs-wallet/keys/demo")) + (add-hook! 'doom-real-buffer-functions + (defun cardano-interesting-buffer (b) + "Whether the current buffer's major-mode is a cardano mode." + (with-current-buffer b + (memq major-mode '(cardano-db-addresses-mode + cardano-db-files-mode + cardano-tx-mode + cardano-wallet-tx-log-mode))))) + (setq cardano-tx-log-level 'debug) + ;; (setq cardano-cli-command (expand-file-name "~/dev/cardano/cardano-node/cli")) + (setq cardano-tx-cli-command "/home/titan/dev/cardano/cardano-node/dist-newstyle/build/x86_64-linux/ghc-8.10.7/cardano-cli-1.35.0/x/cardano-cli/build/cardano-cli/cardano-cli") + (setq cardano-tx-db-keyring-dir "~/dev/cardano/emacs-wallet/keys/demo")) (use-package! cardano-wallet :commands (cardano-wallet-balances) :load-path "~/dev/cardano/emacs-wallet") #+end_src + +#+RESULTS: + * Books #+begin_src emacs-lisp :tangle "packages.el" (package! nov) diff --git a/config/shepherd/init.d/cardano.scm b/config/shepherd/init.d/cardano.scm index 0cdbb06..3c891b8 100644 --- a/config/shepherd/init.d/cardano.scm +++ b/config/shepherd/init.d/cardano.scm @@ -134,6 +134,21 @@ #:requires '(vasil-bp) #:respawn? #t)) +(register-services + (make + #:docstring "Cardano Vasil cncli sync" + #:provides '(vasil-cncli-sync) + #:start (make-forkexec-constructor + (list "cncli" + "sync" "--host" "127.0.0.1" "--port" "3005" + "--network-magic" "9" + "--db" (string-append (getenv "HOME") "/test-cardano/dev-vasil/blocklog.db") + ) + #:log-file (string-append (getenv "HOME") "/test-cardano/dev-vasil/log/cncli.log")) + + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:requires '(vasil-bp))) + (register-services (make #:docstring "Cardano Vasil wallet" -- cgit v1.2.3