Skip to content
/ go-car Public

A content addressible archive utility

License

Notifications You must be signed in to change notification settings

ipld/go-car

Folders and files

NameName
Last commit message
Last commit date
Sep 25, 2024
Feb 25, 2025
Jul 6, 2022
Feb 14, 2023
Feb 25, 2025
Sep 15, 2021
Jan 30, 2023
Sep 25, 2024
Mar 24, 2023
Aug 6, 2021
Jan 23, 2023
Jul 31, 2023
Jul 31, 2023
Sep 10, 2024
Feb 17, 2025
Feb 17, 2025
Oct 1, 2021
Oct 1, 2021
Dec 10, 2021
Mar 25, 2023
Sep 25, 2024

Repository files navigation

go-car (go!)

Go Reference Coverage Status

Work with car (Content addressed ARchive) files!

This is a Golang implementation of the CAR specifications, both CARv1 and CARv2.

As a format, there are two major module versions:

  • go-car/v2 is geared towards reading and writing CARv2 files, and also supports consuming CARv1 files and using CAR files as an IPFS blockstore.
  • go-car, in the root directory, only supports reading and writing CARv1 files.

Most users should use v2, especially for new software, since the v2 API transparently supports both CAR formats.

Usage / Installation

This repository provides a car binary that can be used for creating, extracting, and working with car files.

To install the latest version of car, run:

go install github.com/ipld/go-car/cmd/car@latest

More information about this binary is available in cmd/car

Features

CARv2 features:

  • Generate index from an existing CARv1 file
  • Wrap CARv1 files into a CARv2 with automatic index generation.
  • Random-access to blocks in a CAR file given their CID via Read-Only blockstore API, with transparent support for both CARv1 and CARv2
  • Write CARv2 files via Read-Write blockstore API, with support for appending blocks to an existing CARv2 file, and resumption from a partially written CARv2 files.
  • Individual access to inner CARv1 data payload and index of a CARv2 file via the Reader API.

API Documentation

See docs on pkg.go.dev.

Examples

Here is a shortlist of other examples from the documentation

Maintainers

Contribute

PRs are welcome!

When editing the Readme, please conform to the standard-readme specification.

License

Apache-2.0/MIT © Protocol Labs