(define (make-dir-parents dir-path) (unless (access? dir-path F_OK) (make-dir-parents (dirname dir-path)) (mkdir dir-path))) (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"))) (register-services (make #:docstring "Alonzo Purple test network" #:provides '(alonzo-purple-node) #:start (make-forkexec-constructor (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 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" #:provides '(alonzo-wallet) #:start (make-forkexec-constructor (list (string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") "serve" "+RTS" "-T" "-RTS" "--port" "8092" "--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") #: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)))) (register-services (make #:docstring "Cardano Test network ssh tunnel" #:provides '(testnet-node-ssh) #:start (make-forkexec-constructor (list "ssh" "-NTv" "-o" "ServerAliveInterval=60" "-o" "ExitOnForwardFailure=yes" "-o" "StreamLocalBindUnlink=yes" "-L" "/tmp/alinatn.socket:/run/cardano-node-testnet/socket" "cardano@alina") #:log-file "/tmp/testnet-ssh.log") #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:respawn? #t)) (register-services (make #:docstring "Alina Postgresql ssh" #:provides '(alina-postgresql-ssh) #:start (make-forkexec-constructor (list "ssh" "-NTv" "-o" "ServerAliveInterval=60" "-o" "ExitOnForwardFailure=yes" "-L" "54320:localhost:5432" "cardano@alina") #:log-file "/tmp/postgresql-ssh.log") #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:respawn? #t)) (register-services (make #:docstring "Cardano Testnet wallet" #:provides '(testnet-wallet) #:start (make-forkexec-constructor (list (string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") "serve" "+RTS" "-T" "-RTS" "--port" "8091" "--node-socket" "/tmp/alinatn.socket" "--database" (string-append (getenv "HOME") "/test-cardano/testnet/wallet") "--testnet" (string-append (getenv "HOME") "/test-cardano/config/testnet-byron-genesis.json")) #:log-file (string-append (getenv "HOME") "/test-cardano/testnet/log/wallet.log")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:requires '(testnet-node-ssh))) (register-services (make #:docstring "Cardano Main network ssh tunnel" #:provides '(mainnet-node-ssh) #:start (make-forkexec-constructor (list "ssh" "-NTv" "-o" "ServerAliveInterval=60" "-o" "ExitOnForwardFailure=yes" "-o" "StreamLocalBindUnlink=yes" "-L" "/tmp/alinamn.socket:/run/cardano-node-mainnet/socket" "cardano@alina") #:log-file "/tmp/mainnet-ssh.log") #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:respawn? #t)) (register-services (make #:docstring "Mainnet wallet" #:provides '(mainnet-wallet) #:start (make-forkexec-constructor (list (string-append (getenv "HOME") "/.cabal/bin/cardano-wallet") "serve" "+RTS" "-T" "-RTS" "--node-socket" "/tmp/alinamn.socket" "--database" (string-append (getenv "HOME") "/test-cardano/main/wallet") "--mainnet") #:log-file (string-append (getenv "HOME") "/test-cardano/main/log/wallet.log")) #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C #:requires '(mainnet-node-ssh)))