{"id":18733145,"url":"https://github.com/bioforestchain/dweb_cloud","last_synced_at":"2025-04-12T18:31:32.980Z","repository":{"id":224559491,"uuid":"763565623","full_name":"BioforestChain/dweb_cloud","owner":"BioforestChain","description":"js 容器，让 dweb-dapp 的实现多梯度部署。","archived":false,"fork":false,"pushed_at":"2025-01-17T09:45:19.000Z","size":229,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-26T12:51:12.677Z","etag":null,"topics":["dweb-cloud","dweb-dapp"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/BioforestChain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-26T14:33:36.000Z","updated_at":"2025-01-17T09:45:20.000Z","dependencies_parsed_at":"2024-12-18T04:20:06.397Z","dependency_job_id":"b8890583-358d-41e2-bef7-15fd9a184c78","html_url":"https://github.com/BioforestChain/dweb_cloud","commit_stats":null,"previous_names":["bioforestchain/dweb-cloud","bioforestchain/dweb_cloud"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fdweb_cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fdweb_cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fdweb_cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BioforestChain%2Fdweb_cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BioforestChain","download_url":"https://codeload.github.com/BioforestChain/dweb_cloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248613464,"owners_count":21133520,"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":["dweb-cloud","dweb-dapp"],"created_at":"2024-11-07T15:08:51.879Z","updated_at":"2025-04-12T18:31:32.965Z","avatar_url":"https://github.com/BioforestChain.png","language":"TypeScript","readme":"# Dweb-Cloud\n\n[提案](./proposals.md)\n\n## Example\n\n```bash\n# 启动网关\nnpx tsx ./src/gateway.demo.mts --host gaubee.local --port 8080\n# 启动服务，注册到网关中\nnpx tsx ./demo/service.demo.mts --gateway=http://gaubee.local:8080/ --secret=qaq\n\n# 然后就可以打开链接查看 http://7t3pkjces1xki1ppen9dzvdbpinayy8uk-gaubee.local:8080/test\n```\n\n```bash\n# mdns 网关\nnpx tsx ./demo/gateway.demo.mts\n# p2p 示例\nnpx tsx ./demo/p2p.demo.mts\n```\n\n注意 ⚠⚠⚠: 本地代理可能会对解析产生影响。如果您是 Windows 用户，可以在代理设置中，将`,*.local`添加到排除条目中\n\n## How to Use\n\n1. Install CLI\n   ```bash\n   npm install -g @dweb-cloud/cli\n   ```\n2. Start Gateway Service\n   - local\n   ```bash\n   dweb-cloud dev USER_NAME.local\n   # --port -p = 80 custom port\n   # --host -h = 0.0.0.0 custom host\n   ```\n   - deploy\n   ```bash\n   dweb-cloud start SERVER_HOST_NAME\n   # --port -p = 443 custom port\n   # --host -h = 0.0.0.0 custom host\n   ```\n3. Registry MicroService\n\n   ```ts\n   import { registry } from \"@dweb-cloud/client\";\n\n   const keypair = process.env.BIOFOREST_CHAIN_SECRET;\n\n   const packet = registry({\n     /** dweb-cloud 网关 */\n     gateway: \"http://gaubee.local:8080\",\n     /** 认证算法，目前仅仅支持 bioforestchain 的标准(也是比特币的标准)，未来会加入 web3 的标准 */\n     algorithm: \"bioforestchain\",\n     /** 密钥，私钥会用于签名，公钥会用于上传、以及生成要注册的域名 */\n     keypair: secret,\n     service: {\n       /**\n        * 网络模式\n        * 那么网关就是负责进行请求转发\n        */\n       mode: \"http\",\n       hostname: \"127.0.0.1\",\n       port: process.env.SERVICE_PORT,\n     } || {\n       /**\n        * TODO: VM模式\n        * dweb-cloud 会在一个 vm 中启动程序，并使用 dweb-ipc 建立连接，替代 http 协议\n        * 模块之间通讯性能会更好\n        * 支持 http[s] 的文件入口，与 web 的标准一致\n        */\n       mode: \"vm\",\n       type: \"script\" | \"module\",\n       href: process.env.SERVICE_SCRIPT,\n     },\n   });\n\n   /// 发送数据包\n   const res = await fetch(packet.url, {\n     method: packet.method,\n     headers: packet.headers,\n     body: packet.body,\n   }).then((r) =\u003e r.text());\n   ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbioforestchain%2Fdweb_cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbioforestchain%2Fdweb_cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbioforestchain%2Fdweb_cloud/lists"}