Skip to content

application-research/fastcommp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastcommp

Filecoin fast piece commitment summation tool.

usage

package main

import (
    "fmt"
    "github.com/application-research/fastcommp"
)

func main() {
    fast := new(fastcommp.CommpWriter)
    fast.Write(data)
    sum, err := fast.Sum()
    if err != nil {
        panic(err)
    }
    fmt.Printf("commP: %s\n", sum.PieceCID.String())
}

build

make build

execute

./fastcommp <carfile.car>

optional: create car dummy data

  1. create an 8 GiB test file

dd if=/dev/urandom of=8G-payload.bin bs=1M count=8192

  1. car it up with https://github.com/ipld/go-car (install with go install github.com/ipld/go-car/cmd/car@latest)

car c --version 1 -f 8G-payload.bin.car 8G-payload.bin

benchmarks

Screenshot 2023-04-25 at 4 41 58 PM

* benchmarks run on optimized AMD hardware with ~1TB available memory