forked from ArmanTheParman/Parmanode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README_for_devs
101 lines (76 loc) · 5.51 KB
/
README_for_devs
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Notes to developers
Thank you, you lovely open source developers for contriubiting and reviewing the
Parmanode code.
This document is to help quickly understand how the code works in a convenient place
rather than littered in hard-to-find places which you may end up reading but in an
inefficient order.
ARGUMENTS
If you add "debug" as an argument to ./run_parmanode.sh, useful
things like skipping over some code, or activating debug stopping
points with messages happens.
FREQUENTLY USED CUSTOM FUNCTIONS
set_terminal This is used a lot tstop lnd.sern Mac, but it was at one stage. It's probably
a good thing as many mac terminals have a white background and
I failed at finding how to change it to black without mouse input.
If someone wants to take that on, that'd be awesome.
debug This is a useful function to help me debug and rarely present an
error to the user before aborting. It takes a string argument which
gets printed, before a read command so the screen doesn't clear,
and devs or users can see the error message before continuing.
choose I have several functions that are echo statements to be printed
menu options, found in the echo_choices.sh file. "choose" takes
various string arguments. The letters mean: "x" - choose from
options above, "p" - text to offer option to go to the previous
menu, and "q" text to offer user to quit.
error.sh This is a file with various error messages. I may expand on it or
I might get rid of it all together. It's yet to be determined what
is best.
delete_line A useful sed function that takes two arguments, the filename and
the string to find. It then removes every line where that string
ocurrs. Useful for modifiying config files.
log A function that takes two variables (desired filename prefix) and
a message for the custom log file. The log function also populates
parmanode_all.log, so all messages from various files can be
viewed at once.
EXPLANATION OF CONFIGURATION FILES
parmanode.conf Some user choices, like drive=external / internal, is kep in a config
file for easy access of variables selected during previous times the
software was run.
installed.conf Useful to know if an installation process has begun, eg bitcoin-start,
in order to know if the user's system has been modified, and can
direct the need for uninstallation or clean install. When something
has finised installing, the "end" line is added to the configuration
file, eg bitcoin-end, for similar reasons.
BITCOIN MAC COMMPILED BINARIES
I have chosen to compile Bitcoin Core for Mac myself, as it is mostly a GUI based
installation. It's not clear to me how to acces the daemon either, so I made a
version, from source, which has no GUI, no wallet. The "no wallet" decision might be
a mistake (to connect Sparrow), I'm not sure, I'm waiting to find out, and if is,
it's a simple matter of re-compiling and changing the binary offerred when Parmanode
downloads it from parman.org.
Later, when that is cleared up, I will sign the binary with my gpg key, and
document the steps to reproduce it.
DOCKER FULCRUM SHENANIGANARY
It's a shame Mac Fulcrum binaries are not available for download. I had a horrible
time trying to compile them myself, and gave up. The alternative is to run Fulcrum
in a Linux Docker container on the Mac, which works fine.
Making edits to the fulcrum.conf file is a little tricky, if making it available
from a menu. The solution was to copy the parmanode repository into the container
when building the docker file. Then at the docker exec command, sourcing the file
containing the function to edit the conf file, followed by the function and
parameters. It's a roundabout way, but it works.
DOCKER INSTALL FROM BTCPAY INSTALL SHENANIGANARY
Docker has been a pain in the arse. After install, using usermod -aG docker $USER
to add the user to the docker group is useful to avoid needing sudo to run
docker with every command. However, the memory needs to be refreshed,and every
way possible, that I could find, to refresh the memory, causes a new shell
environment which causes the parmanode script to exit. So, I am getting the user
to exit parmandoe and re-run it once docker installs. The problem is that the
docker installation function is called by the btcpay install function. So to
get the function to continue exactly where it left off when the user comes back
has not been difficult, but it makes the code lood ugly and hard to follow. At
the point of exiting, I've added a flag to the install config file "btcpay-half"
and then at the run_parmanode script, I've checked for that existing, and if so,
it runs the btcpay install function, but with an argument, "resume". An if
statement splits the code so the start section is skipped if "resume" exists.
Upon exiting the function (return 1 or 2), menu main is called again.