UNPKG

@ethersphere/swarm-cli

Version:
44 lines (43 loc) 1.44 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.List = void 0; const chalk_1 = __importDefault(require("chalk")); const pinning_command_1 = require("./pinning-command"); class List extends pinning_command_1.PinningCommand { constructor() { super(...arguments); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: 'list' }); Object.defineProperty(this, "alias", { enumerable: true, configurable: true, writable: true, value: 'ls' }); Object.defineProperty(this, "description", { enumerable: true, configurable: true, writable: true, value: 'List pinned root hashes' }); } async run() { await super.init(); this.console.info('Getting pinned root hashes...'); const pins = await this.bee.getAllPins(); this.console.log(chalk_1.default.bold(`Found ${pins.length} pinned root hashes`)); this.console.log(''); for (const pin of pins) { this.console.log(pin.toHex()); this.console.quiet(pin.toHex()); } } } exports.List = List;