-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
51 lines (41 loc) · 2.42 KB
/
setup.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
#!/bin/bash
# Clone chain repo
git clone https://github.com/scrtlabs/SecretNetwork /tmp/SecrtNetwork
# Compile v1.2
(
cd /tmp/SecrtNetwork
git checkout v1.2.2
echo not_a_key | tee ./spid.txt ./api_key.txt > /dev/null
SGX_MODE=SW make build-linux
)
cp /tmp/SecrtNetwork/{secretd,go-cosmwasm/librust_cosmwasm_enclave.signed.so,go-cosmwasm/api/libgo_cosmwasm.so} ./v1.2
# Compile v1.3
(
cd /tmp/SecrtNetwork
git checkout backport-cw-crypto-apis-to-v0.10
echo not_a_key | tee ./spid.txt ./api_key.txt > /dev/null
SGX_MODE=SW make build-linux
)
cp /tmp/SecrtNetwork/{secretd,go-cosmwasm/librust_cosmwasm_enclave.signed.so,go-cosmwasm/api/libgo_cosmwasm.so} ./v1.3
# Setup a new testnet with v1.2
rm -f ./libgo_cosmwasm.so ./librust_cosmwasm_enclave.signed.so ./secretd
ln -s ./v1.2/libgo_cosmwasm.so ./libgo_cosmwasm.so
ln -s ./v1.2/librust_cosmwasm_enclave.signed.so ./librust_cosmwasm_enclave.signed.so
ln -s ./v1.2/secretd ./secretd
./secretd --home "$(pwd)/.secretd" config keyring-backend test
./secretd --home "$(pwd)/.secretd" config chain-id shockwavealpha-1
./secretd --home "$(pwd)/.secretd" config output json
./secretd --home "$(pwd)/.secretd" init my-node-moniker --chain-id shockwavealpha-1
perl -i -pe 's/"stake"/"uscrt"/g' ./.secretd/config/genesis.json
cat /tmp/.secretd/config/genesis.json | jq '.app_state.gov.voting_params.voting_period = "90s"' > /tmp/genesis.json
mv /tmp/genesis.json ./.secretd/config/genesis.json
echo "cost member exercise evoke isolate gift cattle move bundle assume spell face balance lesson resemble orange bench surge now unhappy potato dress number acid" |
(sleep 3 ; ./secretd --home "$(pwd)/.secretd" keys add a --recover --keyring-backend test)
./secretd --home "$(pwd)/.secretd" add-genesis-account "$(./secretd --home "$(pwd)/.secretd" keys show -a --keyring-backend test a)" 1000000000000uscrt
./secretd --home "$(pwd)/.secretd" gentx a 1000000uscrt --chain-id shockwavealpha-1 --keyring-backend test
./secretd --home "$(pwd)/.secretd" collect-gentxs
./secretd --home "$(pwd)/.secretd" validate-genesis
mkdir -p ./.sgx_secrets
SGX_MODE=SW SCRT_SGX_STORAGE="$(pwd)/.sgx_secrets" ./secretd --home "$(pwd)/.secretd" init-bootstrap node-master-cert.der io-master-cert.der
./secretd --home "$(pwd)/.secretd" validate-genesis
# SGX_MODE=SW SCRT_SGX_STORAGE="$(pwd)/.sgx_secrets" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)" RUST_BACKTRACE=1 ./secretd --home "$(pwd)/.secretd" start --bootstrap