Skip to content

Commit

Permalink
node_init script updated
Browse files Browse the repository at this point in the history
  • Loading branch information
valdok committed Mar 7, 2024
1 parent 2ff6e73 commit 6392792
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions deployment/ci/node_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ cp /tmp/.secretd/keyring-test /root/.secretd/ -r

secretd init-enclave

PUBLIC_KEY=$(secretd parse /opt/secret/.sgx_secrets/attestation_cert.der 2> /dev/null | cut -c 3- )
PUBLIC_KEY=$(secretd dump /opt/secret/.sgx_secrets/pubkey.bin 2> /dev/null)

echo "Public key: $(secretd parse /opt/secret/.sgx_secrets/attestation_cert.der 2> /dev/null | cut -c 3- )"
echo "Public key: $(secretd dump /opt/secret/.sgx_secrets/pubkey.bin 2> /dev/null)"

secretd tx register auth /opt/secret/.sgx_secrets/attestation_combined.bin -y --from a --gas-prices 0.25uscrt --gas 5000000

Expand Down
10 changes: 5 additions & 5 deletions deployment/docker/testnet/node_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ then

secretd init-enclave

PUBLIC_KEY=$(secretd parse /opt/secret/.sgx_secrets/attestation_cert.der 2> /dev/null | cut -c 3- )
PUBLIC_KEY=$(secretd dump /opt/secret/.sgx_secrets/pubkey.bin 2> /dev/null)

echo "Public key: $(secretd parse /opt/secret/.sgx_secrets/attestation_cert.der 2> /dev/null | cut -c 3- )"
echo "Public key: $(secretd parse /opt/secret/.sgx_secrets/pubkey.bin 2> /dev/null)"

curl http://"$FAUCET_URL"/faucet?address=$(secretd keys show -a a)
# cp /opt/secret/.sgx_secrets/attestation_cert.der ./
sleep 10
# openssl base64 -A -in attestation_cert.der -out b64_cert
# secretd tx register auth attestation_cert.der --from a --gas-prices 0.25uscrt -y
# secretd tx register auth attestation_combined.bin --from a --gas-prices 0.25uscrt --gas 5000000 -y

secretd tx register auth /opt/secret/.sgx_secrets/attestation_cert.der -y --from a --gas-prices 0.25uscrt
secretd tx register auth /opt/secret/.sgx_secrets/attestation_combined.bin -y --from a --gas-prices 0.25uscrt --gas 5000000

sleep 10

Expand All @@ -77,7 +77,7 @@ then
secretd validate-genesis

# this is here to make sure that the node doesn't resync
cp /opt/secret/.sgx_secrets/attestation_cert.der /root/.secretd/config/
cp /opt/secret/.sgx_secrets/* /root/.secretd/config/

if [ "$VALIDATOR" == "true" ]
then
Expand Down
6 changes: 3 additions & 3 deletions docs/node_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ cp /tmp/.secretd/keyring-test /root/.secretd/ -r

SGX_MODE=SW secretd init-enclave --reset

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

echo "Public key: $PUBLIC_KEY"

SGX_MODE=SW secretd parse /root/attestation_cert.der
SGX_MODE=SW secretd dump /root/pubkey.bin
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')"
tx_hash="$(SGX_MODE=SW secretd tx register auth /root/attestation_combined.bin -y --from a --gas-prices 0.25uscrt --gas 5000000 | jq -r '.txhash')"

#secretd q tx "$tx_hash"
sleep 15
Expand Down

0 comments on commit 6392792

Please sign in to comment.