-
Notifications
You must be signed in to change notification settings - Fork 297
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.
@@ -73,6 +73,15 @@ describe('.files (the MFS API part)', function () { | |||
}) | |||
}) | |||
|
|||
it.only('files.add with progress options', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only needs to be removed.
stream.pipe(progressStream).pipe(req) | ||
} else { | ||
stream.pipe(req) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diasdavid OK I'm having a look at this.
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-api
with the daemon running.