2021-01-23 09:20:17 -08:00
|
|
|
#!/usr/bin/env bash
|
2020-08-21 11:48:58 -07:00
|
|
|
# This script configures the devnet for test transfers with hardcoded addresses.
|
|
|
|
set -x
|
|
|
|
|
|
|
|
# Configure CLI (works the same as upstream Solana CLI)
|
|
|
|
mkdir -p ~/.config/solana/cli
|
|
|
|
cat <<EOF > ~/.config/solana/cli/config.yml
|
2020-11-29 10:19:37 -08:00
|
|
|
json_rpc_url: "http://127.0.0.1:8899"
|
2020-08-21 11:48:58 -07:00
|
|
|
websocket_url: ""
|
2023-01-04 05:46:42 -08:00
|
|
|
keypair_path: /solana-secrets/solana-devnet.json
|
2020-08-21 11:48:58 -07:00
|
|
|
EOF
|
|
|
|
|
|
|
|
# Constants
|
|
|
|
bridge_address=Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o
|
2020-08-21 16:10:45 -07:00
|
|
|
initial_guardian=befa429d57cd18b7f8a4d91a2da9ab4af05d0fbe
|
2020-08-21 11:48:58 -07:00
|
|
|
|
|
|
|
retry () {
|
|
|
|
while ! $@; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-08-05 05:32:47 -07:00
|
|
|
# Fund our account (as defined in solana/keys/solana-devnet.json).
|
|
|
|
retry solana airdrop 1000
|
2020-08-21 11:48:58 -07:00
|
|
|
|
2021-06-23 06:38:59 -07:00
|
|
|
# Create the bridge contract at a known address
|
|
|
|
# OK to fail on subsequent attempts (already created).
|
2022-08-29 07:18:41 -07:00
|
|
|
retry bridge_client create-bridge "$bridge_address" "$initial_guardian" 86400 100
|
2020-12-31 04:47:09 -08:00
|
|
|
|
2020-11-27 16:33:57 -08:00
|
|
|
# Let k8s startup probe succeed
|
2021-07-28 05:13:45 -07:00
|
|
|
nc -k -l -p 2000
|