diff --git a/README.md b/README.md index d4476a5..cf86db8 100644 --- a/README.md +++ b/README.md @@ -26,10 +26,20 @@ 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 ``` +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 +``` + **Download file** ``` ./0g-storage-client download --node --root --file @@ -38,3 +48,26 @@ To generate a file for test purpose, especially with a fixed file size or random 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 +``` + +`--stream-keys` and `--stream-values` are comma separated string list and their length must be equal. + +**Read from KV** + +``` +./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