{"id":13511336,"url":"https://github.com/driftluo/tentacle","last_synced_at":"2025-04-12T14:57:29.216Z","repository":{"id":53195004,"uuid":"162402056","full_name":"driftluo/tentacle","owner":"driftluo","description":"A multiplexed p2p network framework that supports custom protocols","archived":false,"fork":false,"pushed_at":"2025-04-03T08:22:51.000Z","size":2116,"stargazers_count":212,"open_issues_count":1,"forks_count":51,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-03T14:11:23.056Z","etag":null,"topics":["framework","p2p","rust","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":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/driftluo.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-19T07:52:13.000Z","updated_at":"2025-04-03T08:22:55.000Z","dependencies_parsed_at":"2024-01-13T19:22:19.273Z","dependency_job_id":"6325020d-3cbd-4489-b267-305195792cec","html_url":"https://github.com/driftluo/tentacle","commit_stats":{"total_commits":659,"total_committers":21,"mean_commits":31.38095238095238,"dds":0.5553869499241275,"last_synced_commit":"2aa6dd4c3e5bb4db9199c0198acc6be1f1b91ddf"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftluo%2Ftentacle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftluo%2Ftentacle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftluo%2Ftentacle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/driftluo%2Ftentacle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/driftluo","download_url":"https://codeload.github.com/driftluo/tentacle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586250,"owners_count":21128997,"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","rust-library"],"created_at":"2024-08-01T03:00:47.664Z","updated_at":"2025-04-12T14:57:29.184Z","avatar_url":"https://github.com/driftluo.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":["P2P Network Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdriftluo%2Ftentacle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdriftluo%2Ftentacle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdriftluo%2Ftentacle/lists"}