Storing Data on CZAR
Now that you have your CZAR environment set up, let's explore how to store data on the CZAR network. CZAR uses a simple and efficient process for storing information on its decentralized storage platform.
Storing Data
Using the CZAR CLI:
CZAR provides a Command Line Interface (CLI) that simplifies the process of storing data. To store a file, use the following command:
bashCopy codeczar store path/to/your/file.txtReplace
path/to/your/file.txtwith the actual path to the file you want to store.Via HTTP API:
CZAR also offers a straightforward HTTP API for interacting with the network programmatically. You can use the
/storeendpoint to submit data for storage.Example using cURL:
bashCopy codecurl -X POST -H "Content-Type: application/json" -d '{"data": "Your data goes here"}' http://localhost:1984/storeAdjust the
datafield with the content you want to store.
Retrieving Data
Once data is stored on CZAR, you can retrieve it easily using the provided methods:
Using the CZAR CLI:
To retrieve a file, use the following command:
bashCopy codeczar retrieve <transaction_id> path/to/destination/file.txtReplace
<transaction_id>with the actual transaction ID of the stored data.Via HTTP API:
Utilize the
/retrieveendpoint to fetch data through the HTTP API.Example using cURL:
bashCopy codecurl -X GET http://localhost:1984/retrieve/<transaction_id> -o path/to/destination/file.txtReplace
<transaction_id>with the transaction ID of the data you want to retrieve.
Exploring Advanced Features
CZAR offers advanced features such as metadata management, smart contracts, and more. Explore the official documentation to learn about these advanced functionalities.
Congratulations! You've successfully stored and retrieved data on CZAR. The next pages will cover more aspects of CZAR, including advanced features and best practices.
Last updated