cd 0g-storage-client
git tag -d v0.4.1
git fetch --all --tags
go build
Preparation
1. Input your json-rpc, storage node url and private key
PLEASE INPUT YOUR STORAGE NODE URL (http://STORAGE_NODE_IP:5678) YOUR JSON RPC ENDPOINT (http://VALIDATOR_NODE_IP:8545) OR YOU CAN OUR ENDPOINTS PLEASE CHECK
./0g-storage-client upload \
--url $BLOCKCHAIN_RPC_ENDPOINT \
--contract $LOG_CONTRACT_ADDRESS \
--key $PRIVATE_KEY \
--node $ZGS_NODE \
--file $INPUT_FILE_PATH \
--gas-limit 25000000
# Check if the upload was successful and then delete the file
if [ $? -eq 0 ]; then
rm $INPUT_FILE_PATH
echo "File $INPUT_FILE_PATH has been deleted after upload."
else
echo "Upload failed, file $INPUT_FILE_PATH was not deleted."
fi
echo -e "\033[3m\"lets buidl together\" - Grand Valley\033[0m"
Download file transaction
THESE COMMANDS CAN WORK IF THE FILE PATH IS INSIDE THE 0g-storage-client DIRECTORY.
THIS MEANS YOU MUST CREATE OR CHOOSE THE FILE INSIDE THE 0g-storage-client DIRECTORY.
YOU MUST UPLOAD YOUR FILE FIRST BEFORE YOU CAN DOWNLOAD IT. INPUT THE ROOT HASH VALUE FROM THE UPLOAD TRANSACTION LOGS.
1. input the output path and the root hash of the file you want to download