ipfs / ipfs/kubo

Is possible to find out new added block numbers into local repo after each “ipfs add file”?

Open
#5,826 13 comments 0 reactions 0 assignees View on GitHub
kind/enhancement
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

$ ipfs version --all
go-ipfs version: 0.4.17-
Repo version: 7
System version: 386/linux
Golang version: go1.10.3

-----------

I would like to find new added block numbers into local repo, after each `ipfs add file`. This could be reported after each `ipfs add` is done on the output of the results.

First time if I do `ipfs add file` transferred data size should be hash object's original size. But later when I do `ipfs add file` with the same hash, since the object blocks are already cached it should be 0, where added block number will be 0 as well. Is it possible to find out that?

**[Q]** Is it possible to find out added block number into repo after each `ipfs add file` operation? From the block number I guess I can obtain the total size of blocks added into local repo.

Please note that I can do `ipfs repo stat` before and after `ipfs add file` to observe change on `RepoSize`. But if there is another `ipfs add` processing in parallel on the background, `ipfs repo stat` will not work, where it will affected from both parallel running `ipfs add` operations. So it will be efficient to provide output for each `ipfs add` to see new added blocks into the local repo.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.