-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathstart-tezos.sh
executable file
·44 lines (39 loc) · 1 KB
/
start-tezos.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
#!/bin/sh
# Starts the Tezos node client
# Written by Luke Youngblood, [email protected]
init_node() {
tezos-node identity generate 26
tezos-node config init "$@" \
--rpc-addr="[::]:$rpcport" \
--net-addr="[::]:$netport" \
--connections=$connections \
--network=$network \
--history-mode=archive \
--cors-origin='*' \
--cors-header 'Origin, X-Requested-With, Content-Type, Accept, Range'
cat /home/tezos/.tezos-node/config.json
}
start_node() {
tezos-node run
if [ $? -ne 0 ]
then
echo "Node failed to start; exiting."
exit 1
fi
}
s3_sync() {
# If the current1 key exists, node1 is the most current set of blockchain data
echo "A 404 error below is expected and nothing to be concerned with."
aws s3api head-object --request-payer requester --bucket $chainbucket --key current1
if [ $? -eq 0 ]
then
s3key=node1
else
s3key=node2
fi
aws s3 sync --request-payer requester --region $region s3://$chainbucket/$s3key /home/tezos/.tezos-node
}
# main
init_node
s3_sync
start_node