From 3905546bcb73e7dcf64ac30894ce4fffaf815393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Tue, 26 Oct 2021 03:34:23 +0200 Subject: register blockproducer and db-sync services --- config/shepherd/init.d/cardano.scm | 75 ++++++++++++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/shepherd/init.d/cardano.scm b/config/shepherd/init.d/cardano.scm index 86cff60..0adc3e8 100644 --- a/config/shepherd/init.d/cardano.scm +++ b/config/shepherd/init.d/cardano.scm @@ -4,8 +4,9 @@ (make-dir-parents (dirname dir-path)) (mkdir dir-path))) -(let ((config-dir (string-append (getenv "HOME") "/.guix-profile/etc/conf/cardano/")) - (db-dir (string-append (getenv "HOME") "/test-cardano/purple/"))) +(let ((config-dir (string-append (getenv "HOME") "/test-cardano/config/")) + (db-dir (string-append (getenv "HOME") "/test-cardano/purple/")) + (cardano-node "/home/titan/dev/cardano/cardano-node/node" )) (for-each make-dir-parents (list db-dir (string-append db-dir "log") (string-append db-dir "wallet"))) @@ -15,17 +16,55 @@ #:docstring "Alonzo Purple test network" #:provides '(alonzo-purple-node) #:start (make-forkexec-constructor - (list "cardano-node" "run" + (list cardano-node "run" + "+RTS" "-A16m" "-qg" "-qb" "-RTS" "--database-path" db-dir "--socket-path" (string-append db-dir "socket") + "--host-addr" "127.0.0.2" "--port" "3005" "--config" (string-append config-dir "alonzo-purple-config.json") "--topology" (string-append config-dir "alonzo-purple-topology.json")) #:log-file (string-append db-dir "log/alonzo.log") ) - #:stop (make-kill-destructor) + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:respawn? #t)) + (register-services + (make + #:docstring "Alonzo Purple test network - Block producer" + #:provides '(alonzo-purple-block-producer) + #:start (make-forkexec-constructor + (list cardano-node "run" + "+RTS" "-A16m" "-qg" "-qb" "-RTS" + "--database-path" (string-append db-dir "block-prod/") + "--socket-path" (string-append db-dir "producer.socket") + "--host-addr" "127.0.0.5" + "--port" "3010" + "--config" (string-append config-dir "alonzo-purple-config.json") + "--topology" (string-append config-dir "alonzo-purple-block-prod-topology.json")) + #:log-file (string-append db-dir "log/alonzo-producer.log")) + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:requires '(alonzo-purple-node) + #:respawn? #t)) + + (let ((db-sync-path (string-append (getenv "HOME") "/dev/cardano/cardano-db-sync/"))) + (register-services + (make + #:docstring "Alonzo Purple test network - DB SYNC" + #:provides '(alonzo-purple-db-sync) + #:start (make-forkexec-constructor + (list "cardano-db-sync-extended" + "--config" (string-append db-sync-path "config/alonzo-purple-config.yaml") + "--socket-path" (string-append db-dir "socket") + "--state-dir" (string-append db-sync-path "ledger-state/purple") + "--schema-dir" (string-append db-sync-path "schema")) + #:log-file (string-append db-dir "log/alonzo-db-sync.log") + #:environment-variables (list (string-append "PGPASSFILE=" db-sync-path "config/pgpass-purple") + (string-append "PATH=" (getenv "HOME") "/.local/bin:/usr/bin"))) + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:requires '(alonzo-purple-node) + #:respawn? #t))) + (register-services (make #:docstring "Alonzo Purple wallet" @@ -33,10 +72,30 @@ #:start (make-forkexec-constructor (list (string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") "serve" + "+RTS" "-T" "-RTS" "--node-socket" (string-append db-dir "socket") "--database" (string-append db-dir "wallet") "--token-metadata-server" "https://metadata.cardano-testnet.iohkdev.io" - "--testnet" (string-append config-dir "alonzo-purple-byron-genesis.json")) - #:log-file (string-append db-dir "log/alonzo-wallet.log")) - #:stop (make-kill-destructor) - #:requires '(alonzo-purple-node)))) + "--testnet" (string-append config-dir "alonzo-purple-byron-genesis.json")) + #:log-file (string-append db-dir "log/alonzo-wallet.log") + #:environment-variables '("CARDANO_WALLET_EKG_PORT=8070" )) + + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:requires '(alonzo-purple-node))) + + (let ((db-dir (string-append (getenv "HOME") "/test-cardano/testnet/"))) + (register-services + (make + #:docstring "Cardano Test network" + #:provides '(testnet-node) + #:start (make-forkexec-constructor + (list cardano-node "run" + "--database-path" db-dir + "--socket-path" (string-append db-dir "socket") + "--port" "3002" + "--config" (string-append config-dir "testnet-config.json") + "--topology" (string-append config-dir "testnet-topology.json") + "+RTS" "-N2" "-A16m" "-qg" "-qb" "--disable-delayed-os-memory-return" "-RTS") + #:log-file (string-append db-dir "log/testnet.log")) + #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C + #:respawn? #t)))) -- cgit v1.2.3