erebos

erebos

  • Docs
  • Examples
  • API
  • Help
  • GitHub

›Swarm APIs and CLI

Docs

  • Introduction
  • Getting started

Swarm examples

  • File storage examples
  • Feeds examples
  • Communications examples

Swarm APIs and CLI

  • Swarm client
  • Individual APIs
  • Bzz API
  • Bzz Feed API
  • Bzz FS API
  • Pss API
  • CLI

Data structures

  • Data structures
  • Feed lists
  • Document synchronization
  • Timeline

Timeline protocol

  • Timeline specification
  • Timeline example
  • Timeline API

Utility libraries

  • Hexadecimal encoding
  • Keccak256 hashing
  • SECP256k1 signing
  • Hierarchical Deterministic wallet

RPC tools

  • RPC clients, handler and transport
  • Base RPC class and types
  • RPC Errors
  • RequestRPC client (stateless)
  • StreamRPC client (stateful)
  • RPC handler
  • RPC client over HTTP
  • RPC client over WebSocket
  • RPC client over IPC
  • RPC client for browsers
  • RPC client for Node
  • RPC client for Electron
  • HTTP transport
  • WebSocket transport
  • IPC transport
  • Electron transport
Edit

Bzz FS API

Installation

npm install @erebos/bzz-fs

Usage

import { BzzFS } from '@erebos/bzz-fs'
import { BzzNode } from '@erebos/bzz-node'

const bzz = new BzzNode({ url: 'http://localhost:8500' })
const bzzFS = new BzzFS({ bzz })

BzzFSConfig

interface BzzFSConfig {
  basePath?: string
  bzz: BzzNode | string
}

BzzFS class

new BzzFS()

Arguments

  1. config: BzzFSConfig, see below

Configuration

  • basePath?: string: the base path to resolve relative paths to
  • bzz: BzzNode | string: the BzzNode instance or gateway URL

.downloadTarTo()

Arguments

  1. hashOrDomain: string: ENS name or Swarm hash
  2. path: string: tar file path
  3. options?: DownloadOptions = {}

Returns Promise<void>

.downloadFileTo()

Arguments

  1. hashOrDomain: string: ENS name or Swarm hash
  2. path: string
  3. options?: DownloadOptions = {}

Returns Promise<void>

.downloadDirectoryTo()

Arguments

  1. hashOrDomain: string: ENS name or Swarm hash
  2. path: string
  3. options?: DownloadOptions = {}

Returns Promise<number> the number of files written.

.downloadTo()

Call downloadFileTo() or downloadDirectoryTo() depending on the provided path.

Arguments

  1. hashOrDomain: string: ENS name or Swarm hash
  2. path: string
  3. options?: DownloadOptions = {}

Returns Promise<void>

.uploadTar()

Arguments

  1. path: string: path to an existing tar archive or a directory to pack
  2. options?: UploadOptions = {}

Returns Promise<string>

.uploadFileFrom()

Arguments

  1. path: string: file to upload
  2. options?: UploadOptions = {}

Returns Promise<string>

.uploadDirectoryFrom()

Arguments

  1. path: string: directory to upload
  2. options?: UploadOptions = {}

Returns Promise<string>

.uploadFrom()

Calls uploadFileFrom() or uploadDirectoryFrom() depending on the provided path.

Arguments

  1. path: string: file or directory to upload
  2. options?: UploadOptions = {}

Returns Promise<string>

← Bzz Feed APIPss API →
  • Installation
  • Usage
    • BzzFSConfig
  • BzzFS class
    • new BzzFS()
    • .downloadTarTo()
    • .downloadFileTo()
    • .downloadDirectoryTo()
    • .downloadTo()
    • .uploadTar()
    • .uploadFileFrom()
    • .uploadDirectoryFrom()
    • .uploadFrom()
Docs
Getting StartedAPI ReferenceCLI
Community
Gitter chatGitHub repositoryStar
Swarm
Official documentationHTTP gatewayDevelopment chat