All Projects → nervosnetwork → tentacle

nervosnetwork / tentacle

Licence: MIT license
A multiplexed p2p network framework that supports custom protocols

Projects that are alternatives of or similar to tentacle

Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+11721.95%)
Mutual labels:  rust-library
Horrorshow Rs
A macro-based html builder for rust
Stars: ✭ 228 (+456.1%)
Mutual labels:  rust-library
crc32c
Fast CRC-32-Castagnoli implementation in Rust
Stars: ✭ 26 (-36.59%)
Mutual labels:  rust-library
Wither
An ODM for MongoDB built on the official MongoDB Rust driver.
Stars: ✭ 174 (+324.39%)
Mutual labels:  rust-library
Spartan
Spartan: High-speed zkSNARKs without trusted setup
Stars: ✭ 211 (+414.63%)
Mutual labels:  rust-library
hidapi-rs
Rust bindings for the hidapi C library
Stars: ✭ 103 (+151.22%)
Mutual labels:  rust-library
Atty
are you or are you not a tty?
Stars: ✭ 153 (+273.17%)
Mutual labels:  rust-library
contour-rs
Contour polygon creation in Rust (using marching squares algorithm)
Stars: ✭ 33 (-19.51%)
Mutual labels:  rust-library
Sprs
sparse linear algebra library for rust
Stars: ✭ 224 (+446.34%)
Mutual labels:  rust-library
arangors
Easy to use rust driver for arangoDB
Stars: ✭ 120 (+192.68%)
Mutual labels:  rust-library
Rust S3
Rust library for interfacing with AWS S3 and other API compatible services
Stars: ✭ 177 (+331.71%)
Mutual labels:  rust-library
Mocktopus
Mocking framework for Rust
Stars: ✭ 179 (+336.59%)
Mutual labels:  rust-library
i2p-rs
Rust client library for interacting with I2P
Stars: ✭ 62 (+51.22%)
Mutual labels:  rust-library
Duckscript
Simple, extendable and embeddable scripting language.
Stars: ✭ 169 (+312.2%)
Mutual labels:  rust-library
Nebuchadnezzar
High Performance Key-Value Store
Stars: ✭ 49 (+19.51%)
Mutual labels:  rust-library
Pdb
A parser for Microsoft PDB (Program Database) debugging information
Stars: ✭ 156 (+280.49%)
Mutual labels:  rust-library
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+504.88%)
Mutual labels:  rust-library
twitter-stream-rs
A Rust library for listening on Twitter Streaming API.
Stars: ✭ 66 (+60.98%)
Mutual labels:  rust-library
vfin
🦈 GUI framework agnostic virtual DOM library
Stars: ✭ 17 (-58.54%)
Mutual labels:  rust-library
Awesome-Rust-MachineLearning
This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀
Stars: ✭ 1,110 (+2607.32%)
Mutual labels:  rust-library

Tentacle

Build Status image

Overview

This is a minimal implementation for a multiplexed p2p network based on yamux that supports mounting custom protocols.

Architecture

  1. Data stream transmission
+----+      +----------------+      +-----------+      +-------------+      +----------+      +------+
|user| <--> | custom streams | <--> |Yamux frame| <--> |Secure stream| <--> |TCP stream| <--> |remote|
+----+      +----------------+      +-----------+      +-------------+      +----------+      +------+
  1. Code implementation

All data is passed through the futures channel, yamux splits the actual tcp/websocket stream into multiple substreams, and the service layer wraps the yamux substream into a protocol stream.

Detailed introduction: 中文/English

Note: It is not compatible with libp2p.

Status

The API of this project is basically usable. However we still need more tests. PR is welcome.

The codes in the protocols/ directory are no longer maintained and only used as reference

Usage

From cargo

[dependencies]
tentacle = { version = "0.4.0" }

Example

  1. Clone
$ git clone https://github.com/nervosnetwork/tentacle.git
  1. On one terminal:

Listen on 127.0.0.1:1337

$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple --features ws -- server
  1. On another terminal:
$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple
  1. Now you can see some data interaction information on the terminal.

You can see more detailed example in these three repos:

Run on browser and test

  1. setup a ws server:
$ cd tentacle && RUST_LOG=info cargo run --example simple --features ws -- server
  1. setup a browser client
$ cd simple_wasm/www && wasm-pack build
$ npm install && npm run start

all wasm code generate from book

  1. Use a browser to visit http://localhost:8080/

  2. Now you can see the connection on the server workbench or on browser's console

Other Languages

Implementations in other languages

Why?

Because when I use rust-libp2p, I have encountered some difficult problems, and it is difficult to locate whether it is my problem or the library itself, it is better to implement one myself.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].