Update release script for DAO program upgrades (#495)

This commit is contained in:
Christian Kamm 2023-03-07 09:42:18 +01:00 committed by GitHub
parent 09c8be1c61
commit 15d1ab02d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 29 deletions

17
release-to-dao-buffer.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -ex pipefail
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet-1.json
PROGRAM_ID=4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg
# build program
cargo run -p anchor-cli -- \
build --verifiable --solana-version 1.14.13 -- \
--features enable-gpl
# publish the buffer
solana --url $MB_CLUSTER_URL -k $WALLET_WITH_FUNDS \
program write-buffer \
--buffer-authority FP4PxqHTVzeG2c6eZd7974F9WvKUSdBeduUK3rjYyvBw \
target/verifiable/mango_v4.so

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
set -ex pipefail
WALLET_WITH_FUNDS=~/.config/solana/mango-mainnet-1.json
PROGRAM_ID=4MangoMjqJ2firMokCjjGgoK8d4MXcrgL7XJaL3w6fVg
# build program,
cargo run -p anchor-cli -- build -- --features enable-gpl
# patch types, which we want in rust, but anchor client doesn't support
./idl-fixup.sh
# update types in ts client package
cp -v ./target/types/mango_v4.ts ./ts/client/src/mango_v4.ts
(cd ./ts/client && yarn tsc)
# publish program
solana --url $MB_CLUSTER_URL program deploy --program-id $PROGRAM_ID \
-k $WALLET_WITH_FUNDS target/deploy/mango_v4.so
# publish idl
cargo run -p anchor-cli -- idl upgrade --provider.cluster $MB_CLUSTER_URL --provider.wallet $WALLET_WITH_FUNDS \
--filepath target/idl/mango_v4_no_docs.json $PROGRAM_ID
# build npm package
(cd ./ts/client && yarn tsc)