{"id":14384502,"url":"https://github.com/libp2p/js-libp2p-stardust","last_synced_at":"2025-08-23T17:32:25.979Z","repository":{"id":66118939,"uuid":"164317625","full_name":"libp2p/js-libp2p-stardust","owner":"libp2p","description":"A better ws-star implementation","archived":true,"fork":false,"pushed_at":"2020-04-11T22:34:34.000Z","size":1376,"stargazers_count":8,"open_issues_count":15,"forks_count":4,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-12-19T15:09:04.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libp2p.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-06T15:00:03.000Z","updated_at":"2023-01-28T10:22:14.000Z","dependencies_parsed_at":"2024-01-14T20:16:34.330Z","dependency_job_id":null,"html_url":"https://github.com/libp2p/js-libp2p-stardust","commit_stats":{"total_commits":98,"total_committers":3,"mean_commits":"32.666666666666664","dds":0.3877551020408163,"last_synced_commit":"6215daf4aae866642c46325fd1dfa9ff95fc6ae5"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-stardust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-stardust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-stardust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-stardust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libp2p","download_url":"https://codeload.github.com/libp2p/js-libp2p-stardust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230716533,"owners_count":18269783,"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":[],"created_at":"2024-08-28T18:01:26.088Z","updated_at":"2024-12-21T12:30:38.527Z","avatar_url":"https://github.com/libp2p.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# js-libp2p-stardust\n\n[![](https://img.shields.io/badge/made%20by-mkg20001-blue.svg?style=flat-square)](https://mkg20001.io)\n[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)\n[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-stardust/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-stardust?branch=master)\n[![Travis CI](https://travis-ci.com/libp2p/js-libp2p-stardust.svg?branch=master)](https://travis-ci.com/libp2p/js-libp2p-stardust)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-stardust.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-stardust)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\n\u003e `libp2p-stardust` is one of the multiple transports available for libp2p. `libp2p-stardust` incorporates both a transport and a discovery service that is facilitated by the stardust server, also available in this repo.\n\n## Lead Maintainer\n\n[Maciej Krüger](https://github.com/mkg20001)\n\n## Protocol\n\nYou can read the protocol specification on [PROTOCOL.md](./PROTOCOL.md).\n\n## Usage\n\n### Install\n\n```bash\n\u003e npm install libp2p-stardust\n```\n\n### Example\n\n```js\nconst Stardust = require('libp2p-stardust')\nconst multiaddr = require('multiaddr')\nconst pipe = require('it-pipe')\nconst { collect } = require('streaming-iterables')\n\nconst addr = multiaddr('/ip4/188.166.203.82/tcp/5892/ws/p2p-stardust')\n\nconst stardust = new Stardust({ upgrader, libp2p })\n\nconst listener = stardust.createListener((socket) =\u003e {\n  console.log('new connection opened')\n  pipe(\n    ['hello'],\n    socket\n  )\n})\n\nawait listener.listen(addr)\nconsole.log('listening')\n\nconst socket = await stardust.dial(addr)\nconst values = await pipe(\n  socket,\n  collect\n)\n\nconsole.log(`Value: ${values[0].toString()}`)\n// \u003e hello\n\n// Close connection after reading\nawait listener.close()\n```\n\n## API\n\n### Transport\n\n[![](https://raw.githubusercontent.com/libp2p/interface-transport/master/img/badge.png)](https://github.com/libp2p/interface-transport)\n\n### Connection\n\n[![](https://raw.githubusercontent.com/libp2p/interface-connection/master/img/badge.png)](https://github.com/libp2p/interface-connection)\n\n### Peer Discovery - `ws.discovery`\n\n[![](https://github.com/libp2p/interface-peer-discovery/raw/master/img/badge.png)](https://github.com/libp2p/interface-peer-discovery)\n\n## Stardust Server\n\nSetting up your own stardust server is really easy\n\nFirst install stardust globally.\n\n```bash\n\u003e npm install --global libp2p-stardust\n```\n\nNow you can use the cli command `stardust-server` to spawn a stardust server.\n\nIt only accepts one argument: The address to listen on.\n\nThere isn't much to configure via the CLI currently.\n\nBy default it listens on `/ip6/::/tcp/5892/ws`\n\nFor further customization (e.g. swapping the muxer, using other transports) it is recommended to create a server via the API.\n\n## Hosted Stardust server\n\nWe host a stardust server at `/dns4/stardust.mkg20001.io` that can be used for practical demos and experimentation, it **should not be used for apps in production**.\n\nA libp2p-stardust address, using the server we provide, looks like:\n\n`/dns4/stardust.mkg20001.io/tcp/443/wss/p2p-stardust/ipfs/\u003cyour-peer-id\u003e`\n\nNote: The address above indicates WebSockets Secure, which can be accessed from both http and https.\n\nLICENSE MPL-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fjs-libp2p-stardust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibp2p%2Fjs-libp2p-stardust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fjs-libp2p-stardust/lists"}