Adds wiring for a progress bar#596
Conversation
Passes the progress bar option for tranfers over http. Progress is shown for your payload being streamed upto the server. There is a pause. Then you get your list of files.
| }) | ||
| }) | ||
|
|
||
| it.only('files.add with progress options', (done) => { |
There was a problem hiding this comment.
only needs to be removed.
| stream.pipe(progressStream).pipe(req) | ||
| } else { | ||
| stream.pipe(req) | ||
| } |
There was a problem hiding this comment.
@Kubuxu how does go-ipfs tell the CLI how much 'data' was ingested files? Isn't it returning a ndjson update?
There was a problem hiding this comment.
I am not sure but I am not sure what exactly you are asking for.
how much 'data' was ingested files?
There was a problem hiding this comment.
@Kubuxu when running a ipfs add BIGFILE, how does the CLI know how much data has been processed by go-ipfs?
There was a problem hiding this comment.
Following object is being set by the daemon to the CLI as file is being digested:
type AddedObject struct {
Name string
Hash string `json:",omitempty"`
Bytes int64 `json:",omitempty"`
Size string `json:",omitempty"`
}
It causes update of the progress bar.
There was a problem hiding this comment.
Just confirmed with @whyrusleeping, go-ipfs http-api does indeed send a ndjson stream of updates when adding files if --progress is passed.
We can support streaming both in node and in the browser with stream-http (like we already do).
@bmordan your PR needs to change to capture that and instead of measuring on bytes sent, measure on bytes reported back. Could you change to that, please?
|
continues here: #604 |
Passes the 'progress bar' option for transfers over
ipfs-api(http). Progress is shown for your payload being streamed up to the server.There is a pause.
Then you get your response (list of files).
This example shows a folder of movie clips being added via
ipfs-apiwith the daemon running.