UNPKG

@ethersphere/bee-factory

Version:

Local Ethereum Swarm development stack

51 lines 1.78 kB
#!/usr/bin/env node "use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const yargs_1 = __importDefault(require("yargs")); const helpers_1 = require("yargs/helpers"); const config_1 = require("./config"); const start_1 = require("./commands/start"); const stop_1 = require("./commands/stop"); const chalk_1 = __importDefault(require("chalk")); (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)) .command('start', 'Start the local Bee stack', (y) => y .option('tag', { type: 'string', default: 'master', description: 'Bee git ref to build from (branch, tag, or commit — e.g. v2.5.0)', }) .option('fresh', { type: 'boolean', default: false, description: 'Ignore bundled snapshot and redeploy contracts from scratch (also saves a new snapshot)', }) .option('block-time', { type: 'number', default: config_1.DEFAULT_BLOCK_TIME_IN_SECONDS, description: 'Block time in seconds for the local blockchain (Anvil).', }), async (argv) => { try { await (0, start_1.start)({ tag: argv.tag, fresh: argv.fresh, blockTime: argv.blockTime }); } catch (err) { console.error(chalk_1.default.red('\nFatal error:'), String(err)); process.exit(1); } }) .command('stop', 'Stop the local Bee stack', {}, async () => { try { await (0, stop_1.stop)(); } catch (err) { console.error(chalk_1.default.red('\nFatal error:'), String(err)); process.exit(1); } }) .demandCommand(1, 'Please specify a command: start or stop') .strict() .help() .parse(); //# sourceMappingURL=cli.js.map