whyrusleeping / commp2cid

Command-line tool to convert Filecoin commitment hashes to CIDs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

commp2cid

Conversion tool from Piece commitment hashes used by Filecoin to Content IDs that meet the CIDv1 standard.

Install

There are no pre-built binaries, it has to be built from source.

The Go toolchain available must be available in the system. For development convenience this project uses asdf-vm with the respective asdf-golang plugin.

git clone https://github.com/subvisual/commp2cid.git --branch v1.0.1
cd commp2cid
make

For system-wide installation, move or link the commp2cid executable into a location in the system's PATH.

Usage

commp2cid < commps.txt

This tool maps each line of the standard input as a commitment hash into a line with the respective CID in the standard output.

Caveats

  • It does not read from a file;
  • It does not process any positional arguments;
  • It does not validate the provided commitment hashes.

Background

See the Filecoin PoRep Spec and the Filecoin Paper for how these piece commitment hashes are generated.

The conversion is handled by filecoin-project/go-fil-commcid.

License

This repository is under the MIT license.

Copyright 2020. Subvisual, Lda.

About

Command-line tool to convert Filecoin commitment hashes to CIDs

License:MIT License


Languages

Language:Go 77.4%Language:Makefile 22.6%