-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinitConfig.ts
34 lines (29 loc) · 948 Bytes
/
initConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Usage: npx ts-node app/deploy/devnet/initialize/initConfig.ts
import { Wallet, AnchorProvider, Program } from "@coral-xyz/anchor";
import { Connection } from "@solana/web3.js";
import {
CHECKPOINTS_ACCOUNT_LIMIT,
STAKING_ADDRESS,
DEPLOYER_AUTHORITY_KEYPAIR,
WORMHOLE_TOKEN,
RPC_NODE,
} from "../constants";
async function main() {
const connection = new Connection(RPC_NODE);
const provider = new AnchorProvider(
connection,
new Wallet(DEPLOYER_AUTHORITY_KEYPAIR),
{},
);
const idl = (await Program.fetchIdl(STAKING_ADDRESS, provider))!;
const program = new Program(idl, provider);
const globalConfig = {
bump: 255,
governanceAuthority: DEPLOYER_AUTHORITY_KEYPAIR.publicKey,
votingTokenMint: WORMHOLE_TOKEN,
vestingAdmin: DEPLOYER_AUTHORITY_KEYPAIR.publicKey,
maxCheckpointsAccountLimit: CHECKPOINTS_ACCOUNT_LIMIT,
};
await program.methods.initConfig(globalConfig).rpc();
}
main();