2022-02-23 02:09:17 -08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-08-10 00:16:07 -07:00
|
|
|
set -ex pipefail
|
2022-02-23 02:09:17 -08:00
|
|
|
|
2022-12-19 06:38:06 -08:00
|
|
|
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet-1.json
|
2022-12-08 01:23:12 -08:00
|
|
|
PROGRAM_ID=4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg
|
2022-03-31 12:03:45 -07:00
|
|
|
|
|
|
|
# build program,
|
2023-05-12 04:54:53 -07:00
|
|
|
anchor build -- --features enable-gpl
|
2022-03-31 12:03:45 -07:00
|
|
|
|
|
|
|
# patch types, which we want in rust, but anchor client doesn't support
|
2022-03-31 04:30:05 -07:00
|
|
|
./idl-fixup.sh
|
2022-03-23 07:39:11 -07:00
|
|
|
|
|
|
|
# update types in ts client package
|
2022-04-12 23:48:35 -07:00
|
|
|
cp -v ./target/types/mango_v4.ts ./ts/client/src/mango_v4.ts
|
2022-03-23 07:39:11 -07:00
|
|
|
|
2022-07-06 00:56:14 -07:00
|
|
|
(cd ./ts/client && yarn tsc)
|
2022-05-18 08:16:14 -07:00
|
|
|
|
2022-12-08 01:24:18 -08:00
|
|
|
# publish program
|
2024-07-23 23:39:40 -07:00
|
|
|
solana --url $CLUSTER_URL program deploy --program-id $PROGRAM_ID \
|
2022-12-08 01:24:18 -08:00
|
|
|
-k $WALLET_WITH_FUNDS target/deploy/mango_v4.so --skip-fee-check
|
|
|
|
|
2022-12-19 06:38:06 -08:00
|
|
|
# publish idl
|
2024-07-23 23:39:40 -07:00
|
|
|
anchor idl upgrade --provider.cluster $CLUSTER_URL --provider.wallet $WALLET_WITH_FUNDS \
|
2022-12-14 00:55:25 -08:00
|
|
|
--filepath target/idl/mango_v4_no_docs.json $PROGRAM_ID
|