Skip to content

Latest commit

 

History

History
115 lines (92 loc) · 24.8 KB

api.md

File metadata and controls

115 lines (92 loc) · 24.8 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 CoreAPI

CoreAPI interfaces for go-ipfs. Package iface defines IPFS Core API, which is a set of interfaces used to interact with IPFS nodes.

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 IPFS as a separate process, you should use go-ipfs-api to work with it via RPC. As we finalize the interfaces in this embedded client, go-ipfs-api will transparently adopt them so you can use the same code with either package.

Go HTTP clients

CoreAPI implementation using HTTP API. This package is experimental and subject to change. For an old but stable Go HTTP client, use CoreAPI interfaces.

Packages

This table is generated using the module package-table with package-table --data=package-list.json.

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
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
Files
go-unixfs Go Reference codecov the core 'filesystem' logic
go-mfs Go Reference codecov a mutable filesystem editor for unixfs
go-ipfs-posinfo Go Reference codecov helper datatypes for the filestore
go-ipfs-chunker Go Reference codecov file chunkers
Exchange
go-ipfs-exchange-interface Go Reference codecov exchange service interface
go-ipfs-exchange-offline Go Reference codecov (dummy) offline implementation of the exchange service
go-bitswap Go Reference codecov bitswap protocol implementation
go-blockservice Go Reference codecov service that plugs a blockstore and an exchange together
Datastores
go-datastore Go Reference codecov datastore interfaces, adapters, and basic implementations
go-ipfs-ds-help Go Reference codecov datastore utility functions
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
Namesys
go-ipns Go Reference codecov IPNS datastructures and validation logic
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-ipfs-blockstore Go Reference codecov blockstore 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
go-ipfs-files Go Reference codecov CLI & HTTP commands library
go-ipfs-api Go Reference codecov an old, stable shell for the IPFS HTTP API
go-ipfs-http-client Go Reference codecov a new, unstable shell for the IPFS HTTP API
interface-go-ipfs-core Go Reference codecov core go-ipfs API interface definitions
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
Generics/Utils
go-ipfs-routing Go Reference codecov routing (content, peer, value) helpers
go-ipfs-util Go Reference codecov the kitchen sink
go-ipfs-addr Go Reference codecov utility functions for parsing IPFS multiaddrs

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.