From f41b9414d2ad82a94dbc4da5bfd5fd45349a7344 Mon Sep 17 00:00:00 2001 From: Peter Zhang Date: Wed, 24 Jul 2024 16:06:03 +0800 Subject: [PATCH] update comments --- README.md | 25 +++++-------------------- node/types.go | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 9c7fb59..4821cd6 100644 --- a/README.md +++ b/README.md @@ -32,39 +32,24 @@ To generate a file for test purpose, especially with a fixed file size or random **Upload file** -Use storage nodes urls directly: - ``` -./0g-storage-client upload --url --contract <0g-storage_contract_address> --key --node --file +./0g-storage-client upload --url --contract <0g-storage_contract_address> --key --indexer --file ``` -The `--node` accept comma separated URLs, the client will submit the data segments to all these nodes according to their shard configurations. - -Use indexer url to fetch storage nodes: -``` -./0g-storage-client upload --url --contract <0g-storage_contract_address> --key --indexer --file -``` +The client will submit the data segments to the storage nodes which is determined by the indexer according to their shard configurations. **Download file** ``` -./0g-storage-client download --node --root --file +./0g-storage-client download --indexer --root --file ``` -To download file from multiple storage nodes **in parallel**, `--node` option supports to specify multiple comma separated URLs, e.g. `url1,url2,url3`. - If you want to verify the **merkle proof** of downloaded segment, please specify `--proof` option. **Write to KV** -By storage node urls: - -``` -./0g-storage-client kv-write --url --contract <0g-storage_contract_address> --key --node --stream-id --stream-keys --stream-values -``` - By indexer: ``` -./0g-storage-client kv-write --url --contract <0g-storage_contract_address> --key --indexer --stream-id --stream-keys --stream-values +./0g-storage-client kv-write --url --contract <0g-storage_contract_address> --key --indexer --stream-id --stream-keys --stream-values ``` `--stream-keys` and `--stream-values` are comma separated string list and their length must be equal. @@ -75,4 +60,4 @@ By indexer: ./0g-storage-client kv-read --node --stream-id --stream-keys ``` -Please pay attention here `--node` is the url of a KV node, different from the command above. \ No newline at end of file +Please pay attention here `--node` is the url of a KV node. \ No newline at end of file diff --git a/node/types.go b/node/types.go index b250737..fc13f36 100644 --- a/node/types.go +++ b/node/types.go @@ -23,7 +23,7 @@ type Transaction struct { Seq uint64 `json:"seq"` // sequence id in on-chain flow contract } -// FileInfo information about a file responsed from 0g storage node +// FileInfo information about a file responded from 0g storage node type FileInfo struct { Tx Transaction `json:"tx"` // on-chain transaction Finalized bool `json:"finalized"` // whether the file has been finalized in the storage node