aboutsummaryrefslogtreecommitdiffstats
path: root/config/shepherd/init.d/cardano.scm
blob: 1c5b731c13aa2bab813ace98ae542465373e226a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(define (make-dir-parents dir-path)
  (unless (access? dir-path F_OK)
    (make-dir-parents (dirname dir-path))
    (mkdir dir-path)))

(register-services
 (make <service>
   #:docstring "Nina ssh tunnel, Cardano nodes"
   #:provides '(nina-ssh)
   #:start (make-forkexec-constructor
            (list "ssh" "-NTv"
                  "-o" "ServerAliveInterval=60"
                  "-o" "ExitOnForwardFailure=yes"
                  "-o" "StreamLocalBindUnlink=yes"
                  "-L" "/tmp/nina-mn.socket:/run/cardano-node-mainnet/socket"
                  "-L" "/tmp/nina-pr.socket:/run/cardano-node-preview/socket"
                  "-L" "54320:localhost:5432"
                  "-L" "50001:localhost:50001" ;; electrs
                  "-L" "24224:localhost:24224" ;; electrs monitoring
                  "cardano@nina")
            #:log-file "/tmp/nina-ssh.log"
            #:environment-variables '("SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh"))
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:respawn? #t))

(register-services
 (make <service>
   #:docstring "Cardano preview wallet"
   #:provides '(preview-wallet)
   #:start (make-forkexec-constructor
            (list "cardano-wallet"
                  ;;(string-append (getenv "HOME") "/.cabal/bin/cardano-wallet")
                  "serve"
                  "--port" "8091"
                  "--node-socket" "/tmp/nina-pr.socket"
                  "--database" (string-append (getenv "HOME") "/test-cardano/preview/wallet")
                  "--testnet"  (string-append (getenv "HOME") "/dev/archlinux-ansible/roles/cardano/files/preview/byron-genesis.json"))
            #:log-file (string-append (getenv "HOME") "/test-cardano/preview/log/wallet.log"))

   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:requires '(nina-ssh)))

(register-services
 (make <service>
   #:docstring "Mainnet wallet"
   #:provides '(mainnet-wallet)
   #:start (make-forkexec-constructor
            (list ;;(string-append (getenv "HOME") "/.cabal/bin/cardano-wallet")
             "cardano-wallet"
             "serve"
             "--node-socket" "/run/cardano-node-mainnet/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 '()))