fixed mainnet url check
This commit is contained in:
parent
34bfc030c8
commit
ca973c15b1
2883
cli/README.md
2883
cli/README.md
File diff suppressed because it is too large
Load Diff
|
@ -10,6 +10,7 @@ import {
|
||||||
} from "@solana/web3.js";
|
} from "@solana/web3.js";
|
||||||
import { BigUtils } from "@switchboard-xyz/sbv2-utils";
|
import { BigUtils } from "@switchboard-xyz/sbv2-utils";
|
||||||
import {
|
import {
|
||||||
|
AnchorWallet,
|
||||||
getSwitchboardPid,
|
getSwitchboardPid,
|
||||||
programWallet,
|
programWallet,
|
||||||
} from "@switchboard-xyz/switchboard-v2";
|
} from "@switchboard-xyz/switchboard-v2";
|
||||||
|
@ -107,6 +108,7 @@ abstract class BaseCommand extends Command {
|
||||||
(flags as any).rpcUrl ??
|
(flags as any).rpcUrl ??
|
||||||
this.getRpcUrl(this.cluster) ??
|
this.getRpcUrl(this.cluster) ??
|
||||||
clusterApiUrl(this.cluster);
|
clusterApiUrl(this.cluster);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.connection = new Connection(url, {
|
this.connection = new Connection(url, {
|
||||||
commitment: "finalized",
|
commitment: "finalized",
|
||||||
|
@ -132,7 +134,7 @@ abstract class BaseCommand extends Command {
|
||||||
? new anchor.web3.PublicKey((flags as any).programId)
|
? new anchor.web3.PublicKey((flags as any).programId)
|
||||||
: getSwitchboardPid(this.cluster as "mainnet-beta" | "devnet");
|
: getSwitchboardPid(this.cluster as "mainnet-beta" | "devnet");
|
||||||
|
|
||||||
const wallet = new anchor.Wallet(this.payerKeypair);
|
const wallet = new AnchorWallet(this.payerKeypair);
|
||||||
const provider = new anchor.AnchorProvider(this.connection, wallet, {
|
const provider = new anchor.AnchorProvider(this.connection, wallet, {
|
||||||
commitment: "finalized",
|
commitment: "finalized",
|
||||||
// preflightCommitment: "finalized",
|
// preflightCommitment: "finalized",
|
||||||
|
@ -268,11 +270,11 @@ abstract class BaseCommand extends Command {
|
||||||
switch (cluster) {
|
switch (cluster) {
|
||||||
case "devnet":
|
case "devnet":
|
||||||
return (
|
return (
|
||||||
this.cliConfig.devnet.rpcUrl || clusterApiUrl(toCluster("devnet"))
|
this.cliConfig.devnet.rpcUrl ?? clusterApiUrl(toCluster("devnet"))
|
||||||
);
|
);
|
||||||
case "mainnet-beta":
|
case "mainnet-beta":
|
||||||
return (
|
return (
|
||||||
this.cliConfig.devnet.rpcUrl ||
|
this.cliConfig.mainnet.rpcUrl ??
|
||||||
clusterApiUrl(toCluster("mainnet-beta"))
|
clusterApiUrl(toCluster("mainnet-beta"))
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -5,6 +5,8 @@ import BaseCommand from "../../BaseCommand";
|
||||||
export default class ConfigPrint extends BaseCommand {
|
export default class ConfigPrint extends BaseCommand {
|
||||||
static description = "print cli config";
|
static description = "print cli config";
|
||||||
|
|
||||||
|
static alias = ["config get"];
|
||||||
|
|
||||||
static flags = {
|
static flags = {
|
||||||
...BaseCommand.flags,
|
...BaseCommand.flags,
|
||||||
};
|
};
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
"registry": "https://npm.pkg.github.com"
|
"registry": "https://npm.pkg.github.com"
|
||||||
},
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"message": "chore(release): publish %s",
|
"message": "chore(release): publish",
|
||||||
"allowBranch": "main"
|
"allowBranch": "main"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue