aboutsummaryrefslogtreecommitdiffstats
path: root/config/shepherd/init.d/bitcoin.scm
blob: 8c3ff11c20f3d1514e45d13b2dac37b371ebf0f5 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
(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 "Bitcoin local testnet"
   #:provides '(bitcoin-testnet)
   #:start (make-forkexec-constructor
            (list "bitcoind")
            #:log-file "/tmp/bitcoind.log")
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:respawn? #t))

(register-services
 (make <service>
   #:docstring "Electrs testnet"
   #:provides '(electrs-testnet)
   #:start (make-forkexec-constructor
            (list "/home/titan/dev/bitcoin/electrs/target/release/electrs"
                  "--conf" "/home/titan/dev/bitcoin/electrs/testnet-conf.toml")
            #:log-file "/tmp/electrs.log")
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:requires '(bitcoin-testnet)
   #:respawn? #t))

(register-services
 (make <service>
   #:docstring "Sarah tunnel btc"
   #:provides '(sarah-ssh)
   #:start (make-forkexec-constructor
            (list "ssh" "-NTv"
                  "-o" "ServerAliveInterval=60"
                  "-o" "ExitOnForwardFailure=yes"
                  "-o" "StreamLocalBindUnlink=yes"
                  "-L" "8332:localhost:8332"
                  "-L" "8333:localhost:8333"
                  "sarah")
            #:log-file "/tmp/sarah-ssh.log")
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:respawn? #t))

(register-services
 (make <service>
   #:docstring "Electrs mainnet"
   #:provides '(electrs-mainnet)
   #:start (make-forkexec-constructor
            (list "/home/titan/dev/bitcoin/electrs/target/release/electrs"
                  "--conf" "/home/titan/dev/bitcoin/electrs/mainnet-conf.toml")
            #:log-file "/tmp/electrs-m.log")
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:requires '(sarah-ssh)
   #:respawn? #t))

(register-services
 (make <service>
   #:docstring "Bitcoin testnet index"
   #:provides '(index-testnet)
   #:start (make-forkexec-constructor
            (list "/home/titan/dev/bitcoin/rust-bitcoin-indexer/target/release/bitcoin-indexer")
            #:directory "/home/titan/dev/bitcoin/rust-bitcoin-indexer/"
            #:log-file "/tmp/btc-indexer.log")
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:requires '(bitcoin-testnet)
   #:respawn? #t))

(register-services
 (make <service>
   #:docstring "Bitcoin testnet lnd lightning"
   #:provides '(lnd-testnet)
   #:start (make-forkexec-constructor
            (list "lnd"
                  "--lnddir=/run/media/titan/ext_backup/personal/bitcoin/lnd/"
                  "--noseedbackup"))
   #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
   #:requires '(bitcoin-testnet)
   #:respawn? #t))