Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 15.9 KB

api.md

File metadata and controls

85 lines (67 loc) · 15.9 KB
title description
Advanced Kubo Usage
Developer resources for working in Go with IPFS, the InterPlanetary File System.

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:

  • Use kubo to run Kubo IPFS directly in your own process.
  • Use kubo RPC client to communicate with a Kubo IPFS daemon in a separate process via its HTTP RPC API (this is what Kubo does if a daemon is already running).
  • Use other Go packages to communicate with the HTTP RPC API directly. See the RPC API reference.

Go Embedded Client

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

Hands-on examples

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

A good starting place is the Use kubo as a library to spawn a node and add a file.