Storage CLI is a client tool that interact with Storage node
Build Storage CLI with source code
git clone https://github.com/0glabs/0g-storage-client.git
cd 0g-storage-client
go build
Create a Test file for uploading with storage CLI
cd $HOME/0g-storage-client
./0g-storage-client gen
# this command will create a test file "tmp123456" in your location
# add --file <file-name> to get a specific file name.filetype
We will download the uploaded file by referring to its file_root_hash that we see in our upload log
# set file_root_hash you want to download to environment
root=0xac0bd9d83e593ec52dd5fe9d68b779c0bec25e820b501489567a9c5448971cef
# download test file uploaded
cd $HOME/0g-storage-client
./0g-storage-client download \
--node $STORAGE_RPC_ENDPOINT \
--root $root \
--file tmp123456_dl
Result example - you will see the file downloaded in your location as tmp123456_dl
INFO[2024-06-08T00:11:47+07:00] Begin to download file from storage node threads=1
INFO[2024-06-08T00:11:47+07:00] Completed to download file
INFO[2024-06-08T00:11:47+07:00] create segment root took duration=11.36477ms
INFO[2024-06-08T00:11:47+07:00] Succeeded to validate the downloaded file