-
Notifications
You must be signed in to change notification settings - Fork 208
/
Copy pathbootstrap_init.sh
59 lines (44 loc) · 1.93 KB
/
bootstrap_init.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
file=~/.secretd/config/genesis.json
if [ ! -e "$file" ]; then
# init the node
rm -rf ~/.secretd/*
rm -rf /opt/secret/.sgx_secrets/*
if [ -z "${CHAINID}" ]; then
chain_id="$CHAINID"
else
chain_id="supernova-1"
fi
mkdir -p ./.sgx_secrets
secretd config chain-id "$chain_id"
secretd config keyring-backend test
# export SECRET_NETWORK_CHAIN_ID=secretdev-1
# export SECRET_NETWORK_KEYRING_BACKEND=test
secretd init banana --chain-id "$chain_id"
cp ~/node_key.json ~/.secretd/config/node_key.json
perl -i -pe 's/"stake"/"uscrt"/g' ~/.secretd/config/genesis.json
perl -i -pe 's/"172800000000000"/"90000000000"/g' ~/.secretd/config/genesis.json # voting period 2 days -> 90 seconds
secretd keys add a
secretd keys add b
secretd keys add c
secretd keys add d
secretd add-genesis-account "$(secretd keys show -a a)" 1000000000000000000uscrt
# secretd add-genesis-account "$(secretd keys show -a b)" 1000000000000000000uscrt
# secretd add-genesis-account "$(secretd keys show -a c)" 1000000000000000000uscrt
# secretd add-genesis-account "$(secretd keys show -a d)" 1000000000000000000uscrt
secretd gentx a 1000000uscrt --chain-id "$chain_id"
# secretd gentx b 1000000uscrt --keyring-backend test
# secretd gentx c 1000000uscrt --keyring-backend test
# secretd gentx d 1000000uscrt --keyring-backend test
secretd collect-gentxs
secretd validate-genesis
# secretd init-enclave
secretd init-bootstrap
# cp new_node_seed_exchange_keypair.sealed .sgx_secrets
secretd validate-genesis
perl -i -pe 's/max_subscription_clients.+/max_subscription_clients = 100/' ~/.secretd/config/config.toml
perl -i -pe 's/max_subscriptions_per_client.+/max_subscriptions_per_client = 50/' ~/.secretd/config/config.toml
fi
lcp --proxyUrl http://localhost:1317 --port 1337 --proxyPartial '' &
# sleep infinity
source /opt/sgxsdk/environment && RUST_BACKTRACE=1 secretd start --rpc.laddr tcp://0.0.0.0:26657 --bootstrap