Giter Site home page Giter Site logo

gnostr-space's Introduction

hyperspace-rs

An exploration towards a Rust daemon for Hypercore storage and replication.

This repo contains a few different crates that together work towards an implementation of the hyperspace server (orignally written in Node.js). Hyperspace is a small server that stores and manages Hypercores, and can replicate Hypercores to peers found over the Hyperswarm distributed hash table.

Crates

All are still work in progress and in many parts unfinished.

  • hyperspace-server: Runs a Hypercore storage and networking daemon that can be talked with over an RPC socket through hrpc. Library and binary
  • hyperspace-client: A client that talks with a hyperspace server over hrpc and exposes a RemoteHypercore and RemoteCorestore. Libray and binary
  • corestore: Manage storage for hypercores. A port of corestore. Library
  • hypercore-replicator: Replicate Hypercores with hypercore-protocol. Manages channels for many feeds and peer connections. Library
  • hyperspace-common: Modules shared between server and client. RPC codegen, utilities. Library

Note: None of these crates are published on crates.io yet

Notes

Example

This example starts two hyperspace-server instances and runs a hyperswarm DHT node on localhost. It then uses hyperspace-client to create and append a hypercore on the first instance. Then, again with hyperspace-client, the same feed is requested from the second server instance, which should replicate it because the two servers find each other over the localhost DHT. All in Rust, no Node involved!

# The commands need to be run in seperate terminals each.

# 1. Start a DHT node
cargo run --bin hyperspace-server -- --dht -a 127.0.0.1:3401

# 2. Start server 1
cargo run --bin hyperspace-server -- -s /tmp/hs1 -h hs1 -b 127.0.0.1:3401

# 3. Start server 2
cargo run --bin hyperspace-server -- -s /tmp/hs2 -h hs2 -b 127.0.0.1:3401

# 4. Write to a feed on server 1
cargo run --bin hyperspace-client -- -h hs1 -n afeed write
# the feed's key will be printed
# (type something and press enter, it will be appended to the feed)

# 5. Read from the feed from server 2
cargo run --bin hyperspace-client -- -h hs2 -k KEY_FROM_ABOVE read

Contributing

This project, even though in early stages, is very open to contributions. If unsure, please find us in #datrs on IRC or open an issue first.

gnostr-space's People

Contributors

frando avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.