# Advanced Kubo Usage

# Working with Go

Kubo (go-ipfs) is the oldest implementation of IPFS. It is a command-line application, but can also be used as a library in other Go programs.

For more about using Kubo, see any of the following reference documents:

For more technical information about building, debugging or using the API, see:

If you plan to use Kubo as a package in your own Go application, you can take any of three main approaches:

# Go Embedded Client

Package coreapi (opens new window) provides direct access to the core commands in IPFS. If you are embedding IPFS directly in your Go program, this package is the public interface you should use to read and write files or otherwise control IPFS. This package is experimental and subject to change.

If you are running Kubo as a separate process, you should use the Kubo RPC Client (opens new window) to work with it via RPC.

# Packages

Listing of the main go packages in the IPFS ecosystem:

Name Go Reference Coverage Description
Libp2p
go-libp2p Go Reference (opens new window) codecov (opens new window) p2p networking library
go-libp2p-pubsub Go Reference (opens new window) codecov (opens new window) pubsub built on libp2p
go-libp2p-kad-dht Go Reference (opens new window) codecov (opens new window) dht-backed router
go-libp2p-pubsub-router Go Reference (opens new window) codecov (opens new window) pubsub-backed router
IPFS
boxo Go Reference (opens new window) codecov (opens new window) libraries for building IPFS applications and implementations
Multiformats
go-cid Go Reference (opens new window) codecov (opens new window) CID implementation
go-multiaddr Go Reference (opens new window) codecov (opens new window) multiaddr implementation
go-multihash Go Reference (opens new window) codecov (opens new window) multihash implementation
go-multibase Go Reference (opens new window) codecov (opens new window) mulitbase implementation
Datastores
go-datastore Go Reference (opens new window) codecov (opens new window) datastore interfaces, adapters, and basic implementations
go-ds-flatfs Go Reference (opens new window) codecov (opens new window) a filesystem-based datastore
go-ds-measure Go Reference (opens new window) codecov (opens new window) a metric-collecting database adapter
go-ds-leveldb Go Reference (opens new window) codecov (opens new window) a leveldb based datastore
go-ds-badger Go Reference (opens new window) codecov (opens new window) a badgerdb based datastore
Repo
go-fs-lock Go Reference (opens new window) codecov (opens new window) lockfile management functions
fs-repo-migrations Go Reference (opens new window) codecov (opens new window) repo migrations
IPLD
go-block-format Go Reference (opens new window) codecov (opens new window) block interfaces and implementations
go-ipld-format Go Reference (opens new window) codecov (opens new window) IPLD interfaces
go-ipld-cbor Go Reference (opens new window) codecov (opens new window) IPLD-CBOR implementation
go-ipld-git Go Reference (opens new window) codecov (opens new window) IPLD-Git implementation
go-merkledag Go Reference (opens new window) codecov (opens new window) IPLD-Merkledag implementation (and then some)
Commands
go-ipfs-cmds Go Reference (opens new window) codecov (opens new window) CLI & HTTP commands library
Metrics & Logging
go-metrics-interface Go Reference (opens new window) codecov (opens new window) metrics collection interfaces
go-metrics-prometheus Go Reference (opens new window) codecov (opens new window) prometheus-backed metrics collector
go-log Go Reference (opens new window) codecov (opens new window) logging framework

# Hands-on examples

There are use-case examples in the ipfs/kubo GitHub repository (opens new window). They're all self-contained projects that let your spin up and test environments quickly. Check them out → (opens new window).

A good starting place is the Use kubo as a library to spawn a node and add a file (opens new window).