Skip to content

Commit

Permalink
organize upgrade notes
Browse files Browse the repository at this point in the history
  • Loading branch information
liorbond committed Sep 3, 2023
1 parent 7f0c124 commit f674bb2
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 3 deletions.
Binary file added docs/upgrades/1.11/contract.wasm
Binary file not shown.
File renamed without changes.
68 changes: 68 additions & 0 deletions docs/upgrades/1.11/node_init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash

set -euvo pipefail

# init the node
# rm -rf ~/.secret*
#secretd config chain-id enigma-testnet
secretd config output json
#secretd config indent true
#secretd config trust-node true
#secretd config keyring-backend test
# rm -rf ~/.secretd

mkdir -p /root/.secretd/.node
secretd config keyring-backend test
secretd config node http://bootstrap:26657
secretd config chain-id secretdev-1

mkdir -p /root/.secretd/.node

secretd init "$(hostname)" --chain-id secretdev-1 || true

PERSISTENT_PEERS=115aa0a629f5d70dd1d464bc7e42799e00f4edae@bootstrap:26656

sed -i 's/persistent_peers = ""/persistent_peers = "'$PERSISTENT_PEERS'"/g' ~/.secretd/config/config.toml
sed -i 's/trust_period = "168h0m0s"/trust_period = "168h"/g' ~/.secretd/config/config.toml
echo "Set persistent_peers: $PERSISTENT_PEERS"

echo "Waiting for bootstrap to start..."
sleep 20

secretd q block 1

cp /tmp/.secretd/keyring-test /root/.secretd/ -r

# MASTER_KEY="$(secretd q register secret-network-params 2> /dev/null | cut -c 3- )"

#echo "Master key: $MASTER_KEY"

SGX_MODE=SW secretd init-enclave --reset

PUBLIC_KEY=$(SGX_MODE=SW secretd parse /root/attestation_cert.der | cut -c 3- )

echo "Public key: $PUBLIC_KEY"

SGX_MODE=SW secretd parse /root/attestation_cert.der
cat /root/attestation_cert.der
tx_hash="$(SGX_MODE=SW secretd tx register auth /root/attestation_cert.der -y --from a --gas-prices 0.25uscrt | jq -r '.txhash')"

#secretd q tx "$tx_hash"
sleep 15
SGX_MODE=SW secretd q tx "$tx_hash"

SEED="$(SGX_MODE=SW secretd q register seed "$PUBLIC_KEY" | cut -c 3-)"
echo "SEED: $SEED"
#exit

SGX_MODE=SW secretd q register secret-network-params

SGX_MODE=SW secretd configure-secret node-master-key.txt "$SEED"

cp /tmp/.secretd/config/genesis.json /root/.secretd/config/genesis.json

SGX_MODE=SW secretd validate-genesis

RUST_BACKTRACE=1 SGX_MODE=SW secretd start --rpc.laddr tcp://0.0.0.0:26657

# ./wasmi-sgx-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ sleep 5
INIT='{"counter":{"counter":10, "expires":100000}}'
secretd tx compute instantiate 1 "$INIT" --from a --label "c" -y
sleep 5
ADDR=`secretd q compute list-contract-by-code 1 | jq -r '.[0].contract_address'`

secretd tx compute execute secret18vd8fpwxzck93qlwghaj6arh4p7c5n8978vsyg '{"increment":{"addition": 13}}' --from a -y
secretd tx compute execute $ADDR '{"increment":{"addition": 13}}' --from a -y
sleep 5
secretd query compute query secret18vd8fpwxzck93qlwghaj6arh4p7c5n8978vsyg '{"get": {}}'
secretd query compute query $ADDR '{"get": {}}'
```

Expected result should be:
Expand Down Expand Up @@ -181,7 +182,7 @@ You should see `INF applying upgrade "v1.11" at height` in the logs, following b
### Query the value of the counter

```bash
secretd query compute query secret18vd8fpwxzck93qlwghaj6arh4p7c5n8978vsyg '{"get": {}}'
secretd query compute query $ADDR '{"get": {}}'
```

Expected result should be:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f674bb2

Please sign in to comment.