forked from Chia-Network/chia-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
44 lines (35 loc) · 1.13 KB
/
entrypoint.sh
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
cd /chia-blockchain
. ./activate
chia init
if [[ ${keys} == "generate" ]]; then
echo "to use your own keys pass them as a text file -v /path/to/keyfile:/path/in/container and -e keys=\"/path/in/container\""
chia keys generate
else
chia keys add -f ${keys}
fi
if [[ ! "$(ls -A /plots)" ]]; then
echo "Plots directory appears to be empty and you have not specified another, try mounting a plot directory with the docker -v command "
fi
chia plots add -d ${plots_dir}
sed -i 's/localhost/127.0.0.1/g' ~/.chia/mainnet/config/config.yaml
if [[ ${farmer} == 'true' ]]; then
chia start farmer-only
elif [[ ${harvester} == 'true' ]]; then
if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then
echo "A farmer peer address and port are required."
exit
else
chia configure --set-farmer-peer ${farmer_address}:${farmer_port}
chia start harvester
fi
else
chia start farmer
fi
if [[ ${testnet} == "true" ]]; then
if [[ -z $full_node_port || $full_node_port == "null" ]]; then
chia configure --set-fullnode-port 58444
else
chia configure --set-fullnode-port ${var.full_node_port}
fi
fi
while true; do sleep 30; done;