UNPKG

@ethersphere/bee-js

Version:
63 lines (62 loc) 3.22 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.RedundancyStrategy = exports.RedundancyLevel = exports.FEED_INDEX_HEX_LENGTH = exports.TAGS_LIMIT_MAX = exports.TAGS_LIMIT_MIN = exports.STAMPS_DEPTH_MAX = exports.STAMPS_DEPTH_MIN = exports.PSS_TARGET_HEX_LENGTH_MAX = exports.CHUNK_SIZE = exports.BRANCHES = exports.SECTION_SIZE = void 0; __exportStar(require("./debug"), exports); exports.SECTION_SIZE = 32; exports.BRANCHES = 128; exports.CHUNK_SIZE = exports.SECTION_SIZE * exports.BRANCHES; exports.PSS_TARGET_HEX_LENGTH_MAX = 4; /** * Minimal depth that can be used for creation of postage batch */ exports.STAMPS_DEPTH_MIN = 17; /** * Maximal depth that can be used for creation of postage batch */ exports.STAMPS_DEPTH_MAX = 255; exports.TAGS_LIMIT_MIN = 1; exports.TAGS_LIMIT_MAX = 1000; exports.FEED_INDEX_HEX_LENGTH = 16; /** * Add redundancy to the data being uploaded so that downloaders can download it with better UX. * 0 value is default and does not add any redundancy to the file. */ var RedundancyLevel; (function (RedundancyLevel) { RedundancyLevel[RedundancyLevel["OFF"] = 0] = "OFF"; RedundancyLevel[RedundancyLevel["MEDIUM"] = 1] = "MEDIUM"; RedundancyLevel[RedundancyLevel["STRONG"] = 2] = "STRONG"; RedundancyLevel[RedundancyLevel["INSANE"] = 3] = "INSANE"; RedundancyLevel[RedundancyLevel["PARANOID"] = 4] = "PARANOID"; })(RedundancyLevel = exports.RedundancyLevel || (exports.RedundancyLevel = {})); /** * Specify the retrieve strategy on redundant data. * The possible values are NONE, DATA, PROX and RACE. * Strategy NONE means no prefetching takes place. * Strategy DATA means only data chunks are prefetched. * Strategy PROX means only chunks that are close to the node are prefetched. * Strategy RACE means all chunks are prefetched: n data chunks and k parity chunks. The first n chunks to arrive are used to reconstruct the file. * Multiple strategies can be used in a fallback cascade if the swarm redundancy fallback mode is set to true. * The default strategy is NONE, DATA, falling back to PROX, falling back to RACE */ var RedundancyStrategy; (function (RedundancyStrategy) { RedundancyStrategy[RedundancyStrategy["NONE"] = 0] = "NONE"; RedundancyStrategy[RedundancyStrategy["DATA"] = 1] = "DATA"; RedundancyStrategy[RedundancyStrategy["PROX"] = 2] = "PROX"; RedundancyStrategy[RedundancyStrategy["RACE"] = 3] = "RACE"; })(RedundancyStrategy = exports.RedundancyStrategy || (exports.RedundancyStrategy = {}));