{"id":13756894,"url":"https://github.com/nervosnetwork/tentacle","last_synced_at":"2025-12-30T03:48:21.897Z","repository":{"id":36964599,"uuid":"162992291","full_name":"nervosnetwork/tentacle","owner":"nervosnetwork","description":"A multiplexed p2p network framework that supports custom protocols","archived":false,"fork":true,"pushed_at":"2025-04-03T08:20:08.000Z","size":2123,"stargazers_count":55,"open_issues_count":3,"forks_count":24,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-30T20:04:35.371Z","etag":null,"topics":["framework","p2p","rust-library"],"latest_commit_sha":null,"homepage":"https://docs.rs/tentacle","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"driftluo/tentacle","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nervosnetwork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2018-12-24T13:15:16.000Z","updated_at":"2025-04-03T08:19:25.000Z","dependencies_parsed_at":"2023-07-14T01:50:39.584Z","dependency_job_id":null,"html_url":"https://github.com/nervosnetwork/tentacle","commit_stats":{"total_commits":647,"total_committers":21,"mean_commits":30.80952380952381,"dds":0.5641421947449768,"last_synced_commit":"6a7ca1d1c621b5793b8a26beb9e378ab36c48f29"},"previous_names":["nervosnetwork/p2p"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ftentacle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ftentacle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ftentacle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Ftentacle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nervosnetwork","download_url":"https://codeload.github.com/nervosnetwork/tentacle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253365255,"owners_count":21897181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","p2p","rust-library"],"created_at":"2024-08-03T11:00:56.767Z","updated_at":"2025-12-12T14:37:10.793Z","avatar_url":"https://github.com/nervosnetwork.png","language":"Rust","readme":"# Tentacle\n\n[![Build Status](https://github.com/nervosnetwork/tentacle/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/nervosnetwork/tentacle/actions/workflows/ci.yaml/badge.svg?branch=master)\n![image](https://img.shields.io/badge/rustc-1.81.0-blue.svg)\n\n## Overview\n\nThis is a minimal implementation for a multiplexed p2p network based on `yamux` that supports mounting custom protocols.\n\n## Architecture\n\n1. Data stream transmission\n\n```rust\n+----+      +----------------+      +-----------+      +-------------+      +----------+      +------+\n|user| \u003c--\u003e | custom streams | \u003c--\u003e |Yamux frame| \u003c--\u003e |Secure stream| \u003c--\u003e |TCP stream| \u003c--\u003e |remote|\n+----+      +----------------+      +-----------+      +-------------+      +----------+      +------+\n```\n\n2. Code implementation\n\nAll data is passed through the futures channel, `yamux` splits the actual tcp/websocket stream into multiple substreams,\nand the service layer wraps the yamux substream into a protocol stream.\n\nDetailed introduction: [中文](./docs/introduction_zh.md)/[English](./docs/introduction_en.md)\n\n\u003e Note: It is not compatible with `libp2p`.\n\n## Status\n\nThe API of this project is basically usable. However we still need more tests. PR is welcome.\n\nThe codes in the `protocols/` directory are no longer maintained and only used as reference\n\n## Usage\n\n### From cargo\n\n```toml\n[dependencies]\ntentacle = { version = \"0.6.0\" }\n```\n\n### Example\n\n1. Clone\n\n```bash\n$ git clone https://github.com/nervosnetwork/tentacle.git\n```\n\n2. On one terminal:\n\nListen on 127.0.0.1:1337\n```bash\n$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple --features ws -- server\n```\n\n3. On another terminal:\n\n```bash\n$ RUST_LOG=simple=info,tentacle=debug cargo run --example simple\n```\n\n4. Now you can see some data interaction information on the terminal.\n\nYou can see more detailed example in these three repos:\n\n- [ckb](https://github.com/nervosnetwork/ckb)\n- [cita](https://github.com/cryptape/cita)\n- [muta](https://github.com/nervosnetwork/muta)\n- [axon](https://github.com/nervosnetwork/axon)\n- [godwoken](https://github.com/nervosnetwork/godwoken)\n\n### Run on browser and test\n\n1. setup a ws server:\n```\n$ cd tentacle \u0026\u0026 RUST_LOG=info cargo run --example simple --features ws -- server\n```\n\n2. setup a browser client\n```\n$ cd simple_wasm \u0026\u0026 wasm-pack build\n$ npm install \u0026\u0026 npm run serve\n```\n\nall wasm code generate from [book](https://rustwasm.github.io/docs/book/game-of-life/hello-world.html)\n\n3. Use a browser to visit http://localhost:8080/\n\n4. Now you can see the connection on the server workbench or on browser's console\n\n## Other Languages\n\nImplementations in other languages\n\n- [Go](https://github.com/driftluo/tentacle-go)\n\n## Why?\n\nBecause when I use `rust-libp2p`, I have encountered some difficult problems,\nand it is difficult to locate whether it is my problem or the library itself,\nit is better to implement one myself.\n","funding_links":[],"categories":["Network"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Ftentacle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervosnetwork%2Ftentacle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Ftentacle/lists"}