ipfs/kubo

GitHub: ipfs/kubo

Kubo 是目前最广泛使用的 IPFS 协议官方 Go 语言实现,用于部署和管理去中心化存储节点。

Stars: 16947 | Forks: 3144


Kubo logo
Kubo: IPFS Implementation in Go

IPFS 的第一个实现。

Official Part of IPFS Project Discourse Forum Matrix GitHub release


什么是 Kubo? | 快速体验 | 安装 | 文档 | 开发 | 获取帮助

## 什么是 Kubo? Kubo 是 [IPFS](https://docs.ipfs.tech/concepts/what-is-ipfs/) 的第一个实现,也是[目前使用最广泛](https://probelab.io/ipfs/topology/#chart-agent-types-avg)的实现。它采用了一种强制性的内容寻址方法([CIDs](https://docs.ipfs.tech/concepts/glossary/#cid),[DAGs](https://docs.ipfs.tech/concepts/glossary/#dag)),以最大化互操作性:用于文件和目录的 [UnixFS](https://docs.ipfs.tech/concepts/glossary/#unixfs),用于 Web 浏览器的 [HTTP Gateways](https://docs.ipfs.tech/concepts/glossary/#gateway),以及用于可验证数据传输的 [Bitswap](https://docs.ipfs.tech/concepts/glossary/#bitswap) 和 [HTTP](https://specs.ipfs.tech/http-gateways/trustless-gateway/)。 **功能特性:** - 作为网络服务运行 IPFS 节点(LAN [mDNS](https://github.com/libp2p/specs/blob/master/discovery/mdns.md) 和 WAN [Amino DHT](https://docs.ipfs.tech/concepts/glossary/#dht)) - [命令行界面](https://docs.ipfs.tech/reference/kubo/cli/) (`ipfs --help`) - 用于节点管理的 [WebUI](https://github.com/ipfs/ipfs-webui/#readme) - 用于可信和[无信任](https://docs.ipfs.tech/reference/http/gateway/#trustless-verifiable-retrieval)内容检索的 [HTTP Gateway](https://specs.ipfs.tech/http-gateways/) - 用于控制 daemon 的 [HTTP RPC API](https://docs.ipfs.tech/reference/kubo/rpc/) - 用于[委托路由](./docs/delegated-routing.md)的 [HTTP Routing V1](https://specs.ipfs.tech/routing/http-routing-v1/) 客户端和服务器 - 面向公共节点运营者的[内容屏蔽](./docs/content-blocking.md) **其他 IPFS 实现:** [Helia](https://github.com/ipfs/helia) (JavaScript),[更多...](https://docs.ipfs.tech/concepts/ipfs-implementations/) ## 快速体验 在[安装 Kubo](#install) 后,验证它是否工作: ``` $ ipfs init generating ED25519 keypair...done peer identity: 12D3KooWGcSLQdLDBi2BvoP8WnpdHvhWPbxpGcqkf93rL2XMZK7R $ ipfs daemon & Daemon is ready $ echo "hello IPFS" | ipfs add -q --cid-version 1 bafkreicouv3sksjuzxb3rbb6rziy6duakk2aikegsmtqtz5rsuppjorxsa $ ipfs cat bafkreicouv3sksjuzxb3rbb6rziy6duakk2aikegsmtqtz5rsuppjorxsa hello IPFS ``` 验证此 CID 是否由您的节点提供给 IPFS 网络: 有关所有导入选项,请参见 `ipfs add --help`。准备好了解更多了吗?请跟随[命令行快速入门](https://docs.ipfs.tech/how-to/command-line-quick-start/)。 ## 安装 请遵循[官方安装指南](https://docs.ipfs.tech/install/command-line/),或选择:[预编译二进制文件](#official-prebuilt-binaries) | [Docker](#docker) | [包管理器](#package-managers) | [从源码构建](#build-from-source)。 更喜欢 GUI?试试 [IPFS Desktop](https://docs.ipfs.tech/install/ipfs-desktop/) 和/或 [IPFS Companion](https://docs.ipfs.tech/install/ipfs-companion/)。 ### 最低系统要求 Kubo 可在大多数 Linux、macOS 和 Windows 系统上运行。为了获得最佳性能,我们建议至少 6 GB RAM 和 2 个 CPU 核心(越多越理想,因为 Kubo 具有高度并行性)。 ### 官方预编译二进制文件 从 https://dist.ipfs.tech#kubo 或 [GitHub Releases](https://github.com/ipfs/kubo/releases/latest) 下载。 ### Docker 官方镜像发布在 https://hub.docker.com/r/ipfs/kubo/:[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/ipfs/kubo?color=blue&label=kubo%20docker%20image&logo=docker&sort=semver&style=flat-square&cacheSeconds=3600)](https://hub.docker.com/r/ipfs/kubo/) #### 🟢 发布镜像 请使用这些镜像进行生产部署。 - `latest` 和 [`release`](https://hub.docker.com/r/ipfs/kubo/tags?name=release) 始终指向[最新的稳定版本](https://github.com/ipfs/kubo/releases/latest) - [`vN.N.N`](https://hub.docker.com/r/ipfs/kubo/tags?name=v) 指向特定的[发布标签](https://github.com/ipfs/kubo/releases) ``` $ docker pull ipfs/kubo:latest $ docker run --rm -it --net=host ipfs/kubo:latest ``` 若要[自定义您的节点](https://docs.ipfs.tech/install/run-ipfs-inside-docker/#customizing-your-node),请通过 `-e` 传递配置或在 `/container-init.d` 中挂载脚本。 #### 🟠 开发者预览镜像 用于内部测试,不适用于生产环境。 - [`master-latest`](https://hub.docker.com/r/ipfs/kubo/tags?name=master-latest) 指向 [`master`](https://github.com/ipfs/kubo/commits/master/) 的 `HEAD` - [`master-YYYY-DD-MM-GITSHA`](https://hub.docker.com/r/ipfs/kubo/tags?name=master-2) 指向特定的提交 #### 🔴 内部暂存镜像 用于测试任意提交和实验性补丁(强制推送到 `staging` 分支)。 - [`staging-latest`](https://hub.docker.com/r/ipfs/kubo/tags?name=staging-latest) 指向 [`staging`](https://github.com/ipfs/kubo/commits/staging/) 的 `HEAD` - [`staging-YYYY-DD-MM-GITSHA`](https://hub.docker.com/r/ipfs/kubo/tags?name=staging-2) 指向特定的提交 ### 从源码构建 ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/ipfs/kubo?label=Requires%20Go&logo=go&style=flat-square&cacheSeconds=3600) ``` git clone https://github.com/ipfs/kubo.git cd kubo make build # creates cmd/ipfs/ipfs make install # installs to $GOPATH/bin/ipfs ``` 有关详细信息、Windows 说明和故障排除,请参阅[开发者指南](docs/developer-guide.md)。 ### 包管理器 Kubo 在许多操作系统、Linux 发行版和包管理器中均有社区维护的软件包。完整列表请参见 [Repology](https://repology.org/project/kubo/versions):[![Packaging status](https://repology.org/badge/tiny-repos/kubo.svg)](https://repology.org/project/kubo/versions) #### Linux | 发行版 | 安装 | 版本 | |--------------|---------|---------| | Ubuntu | [PPA](https://launchpad.net/~twdragon/+archive/ubuntu/ipfs): `sudo apt install ipfs-kubo` | [![PPA: twdragon](https://img.shields.io/badge/PPA-twdragon-E95420?logo=ubuntu)](https://launchpad.net/~twdragon/+archive/ubuntu/ipfs) | | Arch | `pacman -S kubo` | [![Arch package](https://repology.org/badge/version-for-repo/arch/kubo.svg)](https://archlinux.org/packages/extra/x86_64/kubo/) | | Fedora | [COPR](https://copr.fedorainfracloud.org/coprs/taw/ipfs/): `dnf install kubo` | [![COPR: taw](https://img.shields.io/badge/COPR-taw-51A2DA?logo=fedora)](https://copr.fedorainfracloud.org/coprs/taw/ipfs/) | | Nix | `nix-env -i kubo` | [![nixpkgs unstable](https://repology.org/badge/version-for-repo/nix_unstable/kubo.svg)](https://search.nixos.org/packages?query=kubo) | | Gentoo | `emerge -a net-p2p/kubo` | [![Gentoo package](https://repology.org/badge/version-for-repo/gentoo/kubo.svg)](https://packages.gentoo.org/packages/net-p2p/kubo) | | openSUSE | `zypper install kubo` | [![openSUSE Tumbleweed](https://repology.org/badge/version-for-repo/opensuse_tumbleweed/kubo.svg)](https://software.opensuse.org/package/kubo) | | Solus | `sudo eopkg install kubo` | [![Solus package](https://repology.org/badge/version-for-repo/solus/kubo.svg)](https://packages.getsol.us/shannon/k/kubo/) | | Guix | `guix install kubo` | [![Guix package](https://repology.org/badge/version-for-repo/gnuguix/kubo.svg)](https://packages.guix.gnu.org/packages/kubo/) | | _其他_ | [查看 Repology 完整列表](https://repology.org/project/kubo/versions) | | ~~Snap~~ 不再受支持 ([#8688](https://github.com/ipfs/kubo/issues/8688)) #### macOS | 管理器 | 安装 | 版本 | |---------|---------|---------| | Homebrew | `brew install ipfs` | [![Homebrew](https://repology.org/badge/version-for-repo/homebrew/kubo.svg)](https://formulae.brew.sh/formula/ipfs) | | MacPorts | `sudo port install ipfs` | [![MacPorts](https://repology.org/badge/version-for-repo/macports/kubo.svg)](https://ports.macports.org/port/ipfs/) | | Nix | `nix-env -i kubo` | [![nixpkgs unstable](https://repology.org/badge/version-for-repo/nix_unstable/kubo.svg)](https://search.nixos.org/packages?query=kubo) | | _其他_ | [查看 Repology 完整列表](https://repology.org/project/kubo/versions) | | #### Windows | 管理器 | 安装 | 版本 | |---------|---------|---------| | Scoop | `scoop install kubo` | [![Scoop](https://repology.org/badge/version-for-repo/scoop/kubo.svg)](https://scoop.sh/#/apps?q=kubo) | | _其他_ | [查看 Repology 完整列表](https://repology.org/project/kubo/versions) | | ~~Chocolatey~~ 不再受支持 ([#9341](https://github.com/ipfs/kubo/issues/9341)) ## 文档 | 主题 | 描述 | |-------|-------------| | [Configuration](docs/config.md) | 所有配置选项参考 | | [Environment variables](docs/environment-variables.md) | 通过环境变量设置运行时 | | [Experimental features](docs/experimental-features.md) | 开发中的选择性启用功能 | | [HTTP Gateway](docs/gateway.md) | 路径、子域名和无信任网关设置 | | [HTTP RPC clients](docs/http-rpc-clients.md) | Go、JS 客户端库 | | [Delegated routing](docs/delegated-routing.md) | 多路由器和 HTTP 路由 | | [Metrics & monitoring](docs/metrics.md) | Prometheus 指标 | | [Content blocking](docs/content-blocking.md) | 公共节点黑名单 | | [Customizing](docs/customizing.md) | 不确定是使用插件、Boxo 还是分叉? | | [Debug guide](docs/debug-guide.md) | CPU 分析、内存分析、追踪 | | [Changelogs](docs/changelogs/) | 每个版本的发行说明 | | [All documentation](https://github.com/ipfs/kubo/tree/master/docs) | 文档完整列表 | ## 开发 有关构建说明、测试和贡献工作流,请参阅[开发者指南](docs/developer-guide.md)。AI 编码代理应遵循 [AGENTS.md](AGENTS.md)。 ## 获取帮助 - [IPFS Forum](https://discuss.ipfs.tech) - 社区支持、问题和讨论 - [Community](https://docs.ipfs.tech/community/) - 聊天、活动和工作组 - [GitHub Issues](https://github.com/ipfs/kubo/issues) - 专门针对 Kubo 的错误报告 - [IPFS Docs Issues](https://github.com/ipfs/ipfs-docs/issues) - 文档问题 ## 安全问题 请参阅 [`SECURITY.md`](SECURITY.md)。 ## 贡献 [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) 我们欢迎贡献。请参阅 [CONTRIBUTING.md](CONTRIBUTING.md) 和[开发者指南](docs/developer-guide.md)。 本仓库遵循 IPFS [行为准则](https://github.com/ipfs/community/blob/master/code-of-conduct.md)。 ## 维护者信息 ## 许可证 根据 Apache 2.0 和 MIT 双重许可: - [LICENSE-APACHE](LICENSE-APACHE) - [LICENSE-MIT](LICENSE-MIT)
标签:DAG, DHT, DNS解析, Go, Golang, IPFS, Kubo, libp2p, merkle-tree, P2P, Ruby工具, UnixFS, Web3, 内容寻址, 分布式哈希表, 分布式系统, 区块链基础设施, 去中心化, 去中心化存储, 响应大小分析, 存储解决方案, 安全编程, 开源项目, 文件系统, 日志审计, 星际文件系统, 点对点网络, 自定义请求头, 请求拦截