2025-06-12 08:24:03 +00:00
|
|
|
import { fundValidators } from "scripts/fund-validators";
|
|
|
|
|
import { setupValidators } from "scripts/setup-validators";
|
|
|
|
|
import { updateValidatorSet } from "scripts/update-validator-set";
|
|
|
|
|
import { logger, printDivider } from "utils";
|
|
|
|
|
import type { DeployOptions } from "..";
|
|
|
|
|
|
|
|
|
|
export const performValidatorOperations = async (options: DeployOptions, networkRpcUrl: string) => {
|
|
|
|
|
if (options.skipValidatorOperations) {
|
|
|
|
|
logger.info("🏳️ Skipping validator operations");
|
|
|
|
|
printDivider();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If not specified, prompt for funding
|
2025-06-26 11:48:33 +00:00
|
|
|
const shouldFundValidators = options.isPrivateNetwork;
|
2025-06-12 08:24:03 +00:00
|
|
|
|
|
|
|
|
if (shouldFundValidators) {
|
|
|
|
|
await fundValidators({
|
|
|
|
|
rpcUrl: networkRpcUrl
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
logger.info("👍 Skipping validator funding");
|
|
|
|
|
printDivider();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await setupValidators({
|
|
|
|
|
rpcUrl: networkRpcUrl
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
await updateValidatorSet({
|
|
|
|
|
rpcUrl: networkRpcUrl
|
|
|
|
|
});
|
|
|
|
|
};
|