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

Swarm client

The Erebos SwarmClient class provides an unified way of interacting with the Swarm APIs based on a provided configuration, or simply a server endpoint.

import { SwarmClient } from '@erebos/swarm-browser' // browser
// or
import { SwarmClient } from '@erebos/swarm-node' // node
// or
import { SwarmClient } from '@erebos/swarm' // universal

RPC class

The Erebos client and individual APIs use RPC classes such as @erebos/rpc-browser and @erebos/rpc-node depending on the environment. The relevant factory is exported as createRPC() and can be used with standalone API classes also exported with the client.

SwarmClient class

Creates a SwarmClient instance based on the provided config. BzzConfig is an Object exported by the @erebos/bzz package.

interface SwarmConfig {
  bzz?: BzzConfig | Bzz
  http?: string
  ipc?: string
  pss?: string | Pss
  rpc?: RPC
  ws?: string
}

Arguments

  1. config: SwarmConfig

Examples

const client = new SwarmClient({
  bzz: { url: 'http://localhost:8500' },
  ipc: '/path/to/swarm.ipc', // will be used to interact with PSS
})

.bzz

Returns Bzz instance, or throws if not provided and could not be created.

.pss

Returns Pss instance, or throws if not provided and could not be created.

← Communications examplesIndividual APIs →
  • RPC class
  • SwarmClient class
    • .bzz
    • .pss
Docs
Getting StartedAPI ReferenceCLI
Community
Gitter chatGitHub repositoryStar
Swarm
Official documentationHTTP gatewayDevelopment chat