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

  1. 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.txt

    Replace path/to/your/file.txt with the actual path to the file you want to store.

  2. Via HTTP API:

    CZAR also offers a straightforward HTTP API for interacting with the network programmatically. You can use the /store endpoint 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/store

    Adjust the data field with the content you want to store.

Retrieving Data

Once data is stored on CZAR, you can retrieve it easily using the provided methods:

  1. Using the CZAR CLI:

    To retrieve a file, use the following command:

    bashCopy codeczar retrieve <transaction_id> path/to/destination/file.txt

    Replace <transaction_id> with the actual transaction ID of the stored data.

  2. Via HTTP API:

    Utilize the /retrieve endpoint 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.txt

    Replace <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