An IPFS implementation in Go
Go to file
Marcin Rataj 1301710a91
fix(ci): parallelize gotest, cleanup output, flakiness (#11113)
* ci: parallelize gotest by separating test/cli into own job

split the Go Test workflow into two parallel jobs:
- `unit-tests`: runs unit tests (excluding test/cli)
- `cli-tests`: runs test/cli end-to-end tests

test/cli takes ~3 minutes (~50% of total gotest time), so running
it in parallel should reduce wall-clock CI time by ~1.5-2.5 minutes.

both jobs produce JUnit XML and HTML reports for consistent debugging.

* ci(gotest): reduce noise on test timeout panics

add GOTRACEBACK=single to show only one goroutine stack instead of all
when a test timeout panic occurs. this makes CI output much cleaner
when tests hang.

* fix(ci): prevent stderr from corrupting test JSON output

- remove 2>&1 which mixed "go: downloading" stderr messages into JSON
- add JSON validation before parsing
- print failed test names for easier debugging

* ci(gotest): use gotestsum for human-readable test output

- replace per-package coverage loop with single gotestsum invocation
- both unit-tests and cli-tests now show human-readable output
- simplified coverage collection (single -coverprofile, no gocovmerge)
- clarified step names to indicate they run tests

* ci: fix codecov uploads by adding token

- add CODECOV_TOKEN to gotest.yml and sharness.yml
- update codecov-action to v5.5.2
- add fail_ci_if_error: false for robustness

codecov stopped receiving coverage data ~1 year ago when they
started requiring tokens for public repos

* refactor(make): add test_unit and test_cli targets

- add `make test_unit` for unit tests with coverage (used by CI)
- add `make test_cli` for CLI integration tests (used by CI)
- only disable colors when CI env var is set (local dev gets colors)
- remove legacy targets: test_go_test, test_go_short, test_go_race, test_go_expensive
- update gotest.yml to use make targets instead of inline commands
- add test artifacts to .gitignore

* fix(ci): move client/rpc tests to cli-tests job

client/rpc tests use test/cli/harness which requires the ipfs binary.
Move them from test_unit to test_cli where the binary is built.

also:
- update gotestsum to v1.13.0
- simplify workflow step names

* fix(ci): use build tags when listing test packages

go list needs build tags to properly exclude packages like fuse/mfs
when running with TEST_FUSE=0 (nofuse tag).

* fix(ci): move test/integration to cli-tests job

test/integration tests need the ipfs binary, move them from test_unit
to test_cli.

* fix(test): fix flaky kubo-as-a-library and GetClosestPeers tests

kubo-as-a-library: use `Bootstrap()` instead of raw `Swarm().Connect()`
to fix race condition between swarm connection and bitswap peer
discovery. `Bootstrap()` properly integrates peers into the routing
system, ensuring bitswap learns about connected peers synchronously.

GetClosestPeers: simplify retry logic using `EventuallyWithT` with
10-minute timeout. tests all 4 routing types (`auto`, `autoclient`,
`dht`, `dhtclient`) against real bootstrap peers with patient polling.

* fix(example): use bidirectional Swarm().Connect() for reliable bitswap

- connect nodes bidirectionally (A→B and B→A) to simulate mutual peering
- mutual peering protects connection from resource manager culling
- use port 0 for random available ports (avoids CI conflicts)
- enable LoopbackAddressesOnLanDHT for local testing
- move retry logic to test file using require.Eventually

* fix(ci): add test_examples target and parallel example-tests job

- add `make test_examples` target to mk/golang.mk for consistency with test_unit/test_cli
- move example tests to separate parallel CI job (example-tests)
- example: use Bootstrap() with autoconf.FallbackBootstrapPeers for reliable bitswap
- example: increase context timeout to 10 minutes
- test: add 60s per-request timeout to GetClosestPeers (server has 30s routing timeout)
- test: reduce EventuallyWithT to 3 minutes (locally passes in under 1 minute)

* fix(ci): improve test targets, exclusion patterns, and artifact naming

- define COVERPKG_EXCLUDE and UNIT_EXCLUDE as documented variables
- use grep -vE with single regex instead of multiple grep -v calls
- add mkdir -p before rm to ensure directories exist
- add DEPS_GO dependency to test_cli target
- make CLI test timeout configurable via TEST_CLI_TIMEOUT (default 10m)
- fix test_examples cleanup on failure using subshell
- reduce GetClosestPeers test wait time from 3m to 2m
- rename artifacts to match job names: unit-tests-{junit,html}, cli-tests-{junit,html}
- update cli-tests upload-artifact from v5 to v6

* fix(ci): fix unit test exclusion and speed up example test

- fix UNIT_EXCLUDE regex to match client/rpc at end of path
- remove public bootstrap peers from example (only connect to nodeA)
- example test now runs in ~3s instead of timing out

* fix(test): fix flaky TestAddMultipleGCLive race condition

added time.Sleep after spawning GC goroutines to ensure they reach
GCLock() before the test proceeds. without this, the adder's
maybePauseForGC() might check GCRequested() before GC has even
requested the lock, causing the lock to not be released and GC to
block indefinitely.

this matches the existing pattern in TestAddGCLive which already
had this sleep.

also replaced context.Background() with t.Context() in both
TestAddMultipleGCLive and TestAddGCLive for proper test lifecycle
management.

* fix(example): use test harness settings for reliable CI

the kubo-as-a-library example was flaky on CI. applied test-harness-like
settings that match what transports_test.go uses:

- TCP-only on 127.0.0.1 with random port (no QUIC/UDP)
- explicitly disable non-TCP transports (QUIC, Relay, WebTransport, etc)
- use NilRouterOption (no routing) since we connect peers directly
- bitswap works with directly connected peers without DHT lookups
- 2-minute context timeout
- streaming output in test for debugging
2026-01-08 05:07:08 +01:00
.github fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
assets core/commands!: remove deprecated object APIs (#10375) 2024-03-22 09:32:30 +01:00
bin chore: remove deprecated go-ipfs Docker image publishing (#11081) 2025-11-27 17:05:26 +01:00
blocks/blockstoreutil chore: migrate go-libipfs to boxo 2023-03-28 22:05:25 -04:00
client/rpc fix: ipfs pin ls <cid> --names (#10970) 2025-09-19 03:17:45 +02:00
cmd fix(ipfswatch): loading datastore plugins (#11078) 2025-12-10 02:50:59 +01:00
commands feat(config): AutoConf with "auto" placeholders (#10883) 2025-08-20 05:59:11 +02:00
config feat: support GetClosesPeers (IPIP-476) and ExposeRoutingAPI by default (#10954) 2025-11-19 10:51:56 +00:00
core fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
coverage fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
docs fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
fuse Non-functional changes (#10996) 2025-09-29 11:43:15 -07:00
gc fix: enforce identity CID size limits (#10949) 2025-09-09 20:22:21 +02:00
misc chore: stop using go-homedir (#10568) 2024-11-05 07:45:11 -08:00
mk fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
p2p chore: use go-log/v2 (#10801) 2025-05-19 13:04:05 -07:00
plugin fix doc string (#11068) 2025-11-19 20:04:55 -08:00
profile chore: use go-log/v2 (#10801) 2025-05-19 13:04:05 -07:00
repo refactor: replace context.WithCancel with t.Context (#11083) 2025-11-28 16:39:55 +01:00
routing feat: trace delegated routing http client (#11017) 2025-10-24 01:21:42 -07:00
test fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
thirdparty remove unneeded thirdparty packages (#10871) 2025-07-16 01:53:42 -07:00
tracing chore: fix broken url in comment (#10606) 2024-11-29 20:23:13 +01:00
.codeclimate.yml disable codeclimate 'maintainability' checks 2017-12-31 15:21:16 -08:00
.cspell.yml feat: telemetry plugin (#10866) 2025-08-18 20:46:05 +02:00
.dockerignore feat: re-enable docker sharness tests (#8808) 2022-03-30 11:07:26 -04:00
.gitattributes feat(config): AutoConf with "auto" placeholders (#10883) 2025-08-20 05:59:11 +02:00
.gitignore fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
.golangci.yml client/rpc: migrate go-ipfs-http-client 2023-05-30 21:28:07 +02:00
.hadolint.yaml feat(ci): docker linting (#10927) 2025-08-26 17:01:06 +02:00
.mailmap chore(mailcap): document rational 2020-05-27 10:22:44 -07:00
CHANGELOG.md chore: start v0.40.0 release cycle 2025-11-17 20:35:11 +01:00
codecov.yml chore: clean up after circleci removal 2023-03-21 14:57:14 +01:00
CONTRIBUTING.md docs: add developer guide for local development workflow (#11128) 2026-01-07 17:09:13 +01:00
doc.go doc: remove out of date documentation 2019-05-16 16:25:01 -07:00
docker-compose.yaml fix: listen on loopback for API and gateway ports in docker-compose.yaml (#8773) 2022-03-09 10:31:07 -05:00
Dockerfile feat(ci): docker linting (#10927) 2025-08-26 17:01:06 +02:00
FUNDING.json Create FUNDING.json (#10734) 2025-02-25 16:47:01 -05:00
GNUmakefile fix: require gmake 2019-08-01 12:18:56 -07:00
go.mod test: replace go-clock with testing/synctest (#11131) 2026-01-07 13:30:15 -08:00
go.sum datastore: upgrade go-ds-pebble to v0.5.8 (#11129) 2026-01-06 01:38:03 -08:00
LICENSE chore(license): fix broken link to apache-2.0 2022-07-20 12:31:34 -07:00
LICENSE-APACHE Create LICENSE-APACHE 2019-05-06 11:01:16 -07:00
LICENSE-MIT License update to dual MIT and Apache 2 2019-05-06 10:56:15 -07:00
Makefile feat: add default makefile to call gnumake 2019-08-01 12:53:00 -07:00
README.md docs: improve README for first-time users (#11133) 2026-01-07 20:33:16 +01:00
Rules.mk fix(ci): parallelize gotest, cleanup output, flakiness (#11113) 2026-01-08 05:07:08 +01:00
SECURITY.md docs: add SECURITY.md (#9062) 2022-06-28 18:51:37 +02:00
version.go chore: version 0.39.0 2025-11-27 02:12:05 +01:00


Kubo logo
Kubo: IPFS Implementation in Go

The first implementation of IPFS.

Official Part of IPFS Project Discourse Forum Matrix GitHub release


What is Kubo? | Quick Taste | Install | Documentation | Development | Getting Help

What is Kubo?

Kubo was the first IPFS implementation and is the most widely used one today. It takes an opinionated approach to content-addressing (CIDs, DAGs) that maximizes interoperability: UnixFS for files and directories, HTTP Gateways for web browsers, Bitswap and HTTP for verifiable data transfer.

Features:

Other IPFS implementations: Helia (JavaScript), more...

Quick Taste

After installing Kubo, verify it works:

$ 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

Verify this CID is provided by your node to the IPFS network: https://check.ipfs.network/?cid=bafkreicouv3sksjuzxb3rbb6rziy6duakk2aikegsmtqtz5rsuppjorxsa

See ipfs add --help for all import options. Ready for more? Follow the command-line quick start.

Install

Follow the official installation guide, or choose: prebuilt binary | Docker | package manager | from source.

Prefer a GUI? Try IPFS Desktop and/or IPFS Companion.

Minimal System Requirements

Kubo runs on most Linux, macOS, and Windows systems. For optimal performance, we recommend at least 6 GB of RAM and 2 CPU cores (more is ideal, as Kubo is highly parallel).

Important

Larger pinsets require additional memory, with an estimated ~1 GiB of RAM per 20 million items for reproviding to the Amino DHT.

Caution

Systems with less than the recommended memory may experience instability, frequent OOM errors or restarts, and missing data announcement (reprovider window), which can make data fully or partially inaccessible to other peers. Running Kubo on underprovisioned hardware is at your own risk.

Official Prebuilt Binaries

Download from https://dist.ipfs.tech#kubo or GitHub Releases.

Docker

Official images are published at https://hub.docker.com/r/ipfs/kubo/: Docker Image Version (latest semver)

🟢 Release Images

Use these for production deployments.

$ docker pull ipfs/kubo:latest
$ docker run --rm -it --net=host ipfs/kubo:latest

To customize your node, pass config via -e or mount scripts in /container-init.d.

🟠 Developer Preview Images

For internal testing, not intended for production.

🔴 Internal Staging Images

For testing arbitrary commits and experimental patches (force push to staging branch).

Build from Source

GitHub go.mod Go version

git clone https://github.com/ipfs/kubo.git
cd kubo
make build    # creates cmd/ipfs/ipfs
make install  # installs to $GOPATH/bin/ipfs

See the Developer Guide for details, Windows instructions, and troubleshooting.

Package Managers

Kubo is available in community-maintained packages across many operating systems, Linux distributions, and package managers. See Repology for the full list: Packaging status

Warning

These packages are maintained by third-party volunteers. The IPFS Project and Kubo maintainers are not responsible for their contents or supply chain security. For increased security, build from source.

Linux

Distribution Install Version
Ubuntu PPA: sudo apt install ipfs-kubo PPA: twdragon
Arch pacman -S kubo Arch package
Fedora COPR: dnf install kubo COPR: taw
Nix nix-env -i kubo nixpkgs unstable
Gentoo emerge -a net-p2p/kubo Gentoo package
openSUSE zypper install kubo openSUSE Tumbleweed
Solus sudo eopkg install kubo Solus package
Guix guix install kubo Guix package
other See Repology for the full list

Snap no longer supported (#8688)

macOS

Manager Install Version
Homebrew brew install ipfs Homebrew
MacPorts sudo port install ipfs MacPorts
Nix nix-env -i kubo nixpkgs unstable
other See Repology for the full list

Windows

Manager Install Version
Scoop scoop install kubo Scoop
other See Repology for the full list

Chocolatey no longer supported (#9341)

Documentation

Topic Description
Configuration All config options reference
Environment variables Runtime settings via env vars
Experimental features Opt-in features in development
HTTP Gateway Path, subdomain, and trustless gateway setup
HTTP RPC clients Client libraries for Go, JS
Delegated routing Multi-router and HTTP routing
Metrics & monitoring Prometheus metrics
Content blocking Denylist for public nodes
Customizing Unsure if use Plugins, Boxo, or fork?
Debug guide CPU profiles, memory analysis, tracing
Changelogs Release notes for each version
All documentation Full list of docs

Development

See the Developer Guide for build instructions, testing, and contribution workflow.

Getting Help

Security Issues

See SECURITY.md.

Contributing

We welcome contributions. See CONTRIBUTING.md and the Developer Guide.

This repository follows the IPFS Code of Conduct.

Maintainer Info

Note

Kubo is maintained by the Shipyard team.

Release Process

License

Dual-licensed under Apache 2.0 and MIT: