DBDelve
Dive deep into your data. A fast, native, multi-engine database client written in Rust. Free and open source, no telemetry.
翻訳待ち
Hypercore is a secure, distributed append-only log.
翻訳待ち
開発ツールJavaScriptGitHub @holepunchto自分でインストール所有者未確認
Paste into Claude or ChatGPT for installation instructions suited to your environment.
Have you tried it? One tap is enough. No sign-in needed.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗Hypercore is a secure, distributed append-only log.
Built for sharing large datasets and streams of real time data
Note that the latest release is Hypercore 10, which adds support for truncate and many other things. Version 10 is not compatible with earlier versions (9 and earlier), but is considered LTS, meaning the storage format and wire protocol is forward compatible with future versions.
npm install hypercore
const core = new Hypercore(storage, [key], [options])Make a new Hypercore instance.
storage should be set to a directory where you want to store the data and core metadata.
const core = new Hypercore('./directory') // store data in ./directory
Alternatively you can pass a Hypercore Storage or use a Corestore if you want to make many Hypercores efficiently. Note that random-access-storage is no longer supported.
key can be set to a Hypercore key which is a hash of Hypercore's internal auth manifest, describing how to validate the Hypercore. If you do not set this, it will be loaded from storage. If nothing is previously stored, a new auth manifest will be generated giving you local write access to it.
options include:
{
createIfMissing: true, // create a new Hypercore key pair if none was present in storage
overwrite: false, // overwrite any old Hypercore that might already exist
force: false, // Advanced option. Will force overwrite even if the header's key & the passed key don't match
valueEncoding: 'json' | 'utf-8' | 'binary', // defaults to binary
encodeBatch: batch => { ... }, // optionally apply an encoding to complete batches
keyPair: kp, // optionally pass the public key and secret key as a key pair
encryption: { key: buffer }, // the block encryption key
onwait: () => {}, // hook that is called if gets are waiting for download
timeout: 0, // wait at max some milliseconds (0 means no timeout)
writable: true, // disable appends and truncates
inflightRange: null, // Advanced option. Set to [minInflight, maxInflight] to change the min and max inflight blocks per peer when downloading.
ongc: (session) => { ... }, // A callback called when the session is garbage collected
onseq: (index, core) => { ... }, // A callback called when core.get(index) is called.
notDownloadingLinger: 20000, // How many milliseconds to wait after downloading finishes keeping the connection open. Defaults to a random number between 20-40s
allowFork: true, // Enables updating core when it forks
allowLatestBlock: false, // Request latest block when requesting upgrade
userData: { foo: 'bar' }, // An object to assign to the local User Data storage
manifest: undefined, // Advanced option. Set the manifest when creating the hypercore. See Manifest section for more info
preload: undefined, // Advanced option. A promise that returns constructor options overrides before the core is opened
storage: undefined, // An alternative to passing storage as a dedicated argument
key: null, // An alternative to passing key as a dedicated argument
}
You can also set valueEncoding to any compact-encoding instance.
valueEncodings will be applied to individual blocks, even if you append batches. If you want to control encoding at the batch-level, you can use the encodeBatch option, which is a function that takes a batch and returns a binary-encoded batch. If you provide a custom valueEncoding, it will not be applied prior to encodeBatch.
The user may provide a custom encryption module as opts.encryption, which should satisfy the HypercoreEncryption interface.
User Data is a key-value store that is persisted locally and is not replicated with the Hypercore. This is useful as a quick store for data only used by the current peer. For example, autobase uses User Data to store information such as encryption keys and connections between a peer's local writer and the Autobase's bootstrap core.
Keys are always strings and values can be strings or buffers.
See core.setUserData(key, value) and core.getUserData(key) for updating User Data.
The manifest is metadata about authenticating a hypercore including things like the signers (only one by default) and the prologue. Manifest has the following structure:
{
version: 1, // Version of the manifest format
hash: 'blake2b', // Only Blake2b is supported currently
allowPatch: false, // Whether the hypercore can be "patched" to change the signers
quorum: (signers.length / 2) + 1, // How many signers needed to verify a block
signers, // Array of signers for the core
prologue: null, // The tree hash and length of the core
linked: null, // Array of associated core keys. Only supported in versions >= 2
userData: null // Arbitrary buffer for User Data integral to the core. Only supported in versions >= 2
}
This is the beginning of the README. Read the rest at the original. Read the full README ↗