Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve cmd of downloading and uploading #90

Merged
merged 13 commits into from
Sep 21, 2023

Conversation

flywukong
Copy link
Collaborator

@flywukong flywukong commented Sep 15, 2023

Description

  1. Support upload, download, print details and speed
  2. Improve sealing information prompts
  3. Automatically convert 2G files into multipart uploads
  4. Solve the problem of recursive upload folder objectname parsing err
  5. support download into a temp file and rename it the right name after downloading finish

Rationale

improve cmd API

Example

wayen@c02fvfsdmd6m qa-test % ./gnfd-cmd  object put test11  gnfd://test11x/dss111123

object dss111123 created on chain
transaction hash:  0EA8971BF4CA0BF59D66A0261C99E558CB6CEB8D527BC7DA5D91435BE7390BDD
uploading progress: 99.81% [ 1.04G / 1.05G ], : 3.34 MB/s
sealing...
sealing...
sealing...
upload dss111123 to gnfd://test11x/dss111123


 qa-test % ./gnfd-cmd object get gnfd://quota123/ds1xlk11121231121 download11x11
Please enter a passphrase now:
downloding progress: 97.93% [ 44.84M / 45.79M ], rate: 1.10 MB/s
download object ds1xlk11121231121, the file path is download11x11, content length:48010024

Changes


Notable changes:
* add each change in a bullet point here
* ...

@flywukong flywukong changed the title feat : Improve cmd of downloading and uploading feat : improve cmd of downloading and uploading Sep 15, 2023
@flywukong flywukong changed the title feat : improve cmd of downloading and uploading feat: improve cmd of downloading and uploading Sep 15, 2023

// Check if object is sealed
timeout := time.After(1 * time.Hour)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it need to be that long?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After our discussion, we changed the seal printing strategy here. Users can manually cancel the wait for seal or set --bypassSeal now. If they do not cancel, they will wait until seal by default, so this time can actually be infinite.

cmd/cmd_object.go Outdated Show resolved Hide resolved
}
return filePath, fmt.Errorf("download file:%s already exist\n", filePath)
}
return filePath, nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return filePath, nil -> return filePath, err

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this file does not exist, it will be created for the user using CREAT mode open, so there is no need to return err.

cmd/utils.go Outdated
@@ -103,6 +105,7 @@ const (

noBalanceErr = "key not found"
maxListMemberNum = 1000
objectLargerSize = 10 * 1024 * 1024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a little bit confused the naming

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@flywukong flywukong merged commit f7a3815 into bnb-chain:develop Sep 21, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants