pyth-crosschain/tilt_devnet/scripts/solana-devnet-setup.sh

32 lines
858 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# 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
json_rpc_url: "http://127.0.0.1:8899"
websocket_url: ""
Repo structure refactor (#449) * Repo structure refactor This change introduces major codebase layout changes in three areas: * Tilt devnet lives in tilt-devnet/ - all k8s and docker files, scripts, local testing private keys are moved to this directory. * pyth2wormhole becomes pyth-wormhole-attester and is relocated to wormhole-attester/ - This long-needed rename will hopefully eradicate most of the confusing naming around the attester. The Rust client binary becomes pyth-wormhole-attester-client. * Target-chain code lives in target-chain/ - This leaves just the attester, third_party and pythnet-specific things at top-level. Other opportunistic changes: * Fixed rebuild trigger for Dockerfile.wasm These items are a fraction of the necessary structure changes in the repo. * cosmwasm: fix contract after faulty merge * .github: remove unused dependabot config * Fix path references in .github and .pre-commit-config.yml * .github: Rename attester references to pyth-wormhole-attester * .pre-commit-config.yaml: fix paths and run all commit hooks * p2w-relay: Fix faulty merge resolution in favor of origin/main * Dockerfile.pyth_relay: Fix Ethereum path reference * Dockerfile.solana: Trip early cache with arbitrary change * Dockerfile.pyth_relay: typo * p2w-relay: fix evm build in npm script * Dockerfile.solana: Retry invalidating cache again * near -> target-chains/near * wormhole-attester: bump on/off-chain major versions due to rename Attester packages were renamed. This possibly breaks most dependees. * Dockerfile.solana: Improve decoy-crate to have a real lib target * .github/[...]/pyth-cosmwasm-contract.yml: typo * rust-toolchain: Bump rust to stable 1.63 * rust-toolchain: use christmas nightly * empty commit to trigger build * attester-image-push.yaml: keep xc-attest image name intact * multisig-wh-message-builder: remove accidental revert
2023-01-04 05:46:42 -08:00
keypair_path: /solana-secrets/solana-devnet.json
EOF
# Constants
bridge_address=Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o
2020-08-21 16:10:45 -07:00
initial_guardian=befa429d57cd18b7f8a4d91a2da9ab4af05d0fbe
retry () {
while ! $@; do
sleep 1
done
}
# Fund our account (as defined in solana/keys/solana-devnet.json).
retry solana airdrop 1000
# Create the bridge contract at a known address
# OK to fail on subsequent attempts (already created).
retry bridge_client create-bridge "$bridge_address" "$initial_guardian" 86400 100
2020-12-31 04:47:09 -08:00
# Let k8s startup probe succeed
nc -k -l -p 2000