"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = require("../../src/services/config");
const storage_1 = require("../../src/services/storage");
const VerificationPeer_1 = require("../../src/modules/bitcoin/VerificationPeer");
(async () => {
    const { CHAIN: chain, NETWORK: network, START, END } = process.env;
    if (!chain || !network || !START || !END) {
        console.log('CHAIN, NETWORK, START, and END are required env variables');
        process.exit(1);
    }
    else {
        await storage_1.Storage.start();
        const chainConfig = config_1.Config.chainConfig({ chain, network });
        const worker = new VerificationPeer_1.VerificationPeer({ chain, network, chainConfig });
        await worker.connect();
        await worker.resync(Number(START), Number(END));
        process.exit(0);
    }
})();
//# sourceMappingURL=resync.js.map