Mainnet Execution Simulation
Last updated
Was this helpful?
Was this helpful?
[repl.remote_data]
# Enable mainnet execution simulation
enabled = true
# Specify the Stacks block height to fork from
initial_height = 522000
# API URL (optional, defaults to https://api.hiro.so)
api_url = 'https://api.hiro.so'[repl.remote_data]
enabled = true
initial_height = 522000
use_mainnet_wallets = true # !markexport HIRO_API_KEY="<your-api-key>"import { describe, it, expect } from "vitest";
import { Cl } from "@stacks/transactions";
const accounts = simnet.getAccounts();
const deployer = accounts.get("deployer")!;
describe("pox-4 mainnet interaction", () => {
it("reads current reward cycle from mainnet", () => {
// Call the mainnet pox-4 contract
const call = simnet.callReadOnlyFn(
"SP000000000000000000002Q6VF78.pox-4", // Mainnet contract
"current-pox-reward-cycle",
[],
deployer
);
// Assert the result (adjust based on your initial_height)
expect(call.result).toBeUint(109);
console.log("Current POX reward cycle:", Cl.prettyPrint(call.result));
});
});npm run testexport HIRO_API_KEY="<your-api-key>"> contract-call? 'SP000000000000000000002Q6VF78.pox-4 current-pox-reward-cycle