deploy.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env bash
  2. # This is an example payload for deploying the NEAR receiver contract. Note that the codehash can be obtained
  3. # by `sha256sum` on the compiled contract. The initial and governance sources are the PythNet emitters for
  4. # governance payloads.
  5. INIT_ARGS=$(
  6. cat <<-EOF
  7. {
  8. "wormhole": "wormhole.wormhole.testnet",
  9. "codehash": [113, 49, 20, 252, 226, 220, 48, 15, 139, 92, 255, 117, 94, 178, 130, 162, 252, 5, 252, 188, 87, 122, 50, 175, 109, 12, 26, 189, 9, 107, 214, 116],
  10. "initial_source": {
  11. "emitter": [225, 1, 250, 237, 172, 88, 81, 227, 43, 155, 35, 181, 249, 65, 26, 140, 43, 172, 74, 174, 62, 212, 221, 123, 129, 29, 209, 167, 46, 164, 170, 113],
  12. "chain": 26
  13. },
  14. "gov_source": {
  15. "emitter": [86, 53, 151, 154, 34, 28, 52, 147, 30, 50, 98, 11, 146, 147, 164, 99, 6, 85, 85, 234, 113, 254, 151, 205, 98, 55, 173, 232, 117, 177, 46, 158],
  16. "chain": 1
  17. },
  18. "update_fee": "1",
  19. "stale_threshold": 60
  20. }
  21. EOF
  22. )
  23. # Feed through jq to get compressed JSON to avoid CLI weirdness.
  24. INIT_JSON=$(echo "$INIT_ARGS" | jq -c '.' -M)
  25. # Deploy..
  26. near deploy \
  27. --accountId "pyth.testnet" \
  28. --wasmFile pyth.wasm \
  29. --initFunction new \
  30. --initArgs "$INIT_JSON"