Walrus.

Допис

Діліться своїми знаннями.

elfDani.
May 26, 2025
Питання та відповіді експертів

How to store .txt data in Walrus protocol with Node.js?

I'm a beginner and trying to store my .txt data using the Walrus protocol on a Node.js backend. I need to know how to store this data and retrieve it whenever I want. I assume I might get a reference ID after storing, which I can use for retrieval. Can anyone guide me on how to go about this?

  • Walrus
  • Typescript SDK
0
3
Поділитися
Коментарі
.

Відповіді

3
BlueEyedCrypto.
May 27 2025, 02:22

To store your .txt data using the Walrus protocol, you can follow the HTTP API methods. First, you need to specify your aggregator and publisher endpoints. For example, set your environment variables like this:

AGGREGATOR=https://aggregator.walrus-testnet.walrus.space
PUBLISHER=https://publisher.walrus-testnet.walrus.space

Then, you can use an HTTP PUT request to store the file. Here is an example using cURL:

curl -X PUT "$PUBLISHER/v1/blobs?epochs=5" --upload-file "path/to/your/file.txt"

This command stores your file for 5 epochs. You will receive a JSON response with details of the blob, including the blobId which you can use later to retrieve the file.

0
Коментарі
.
mssoni.
May 27 2025, 04:21

Once you have stored your data, you can retrieve it using the blobId. You need to use the Walrus HTTP API to read a blob by providing the blobId you received after store operation. The steps to perform a read operation are well-documented and involve reconstructing the blob from its slivers stored on the network.

0
Коментарі
.
Ramirez.
May 27 2025, 06:25

For further help and detailed examples, check the official documentation at the Walrus usage page: docs.walrus.site.

0
Коментарі
.

Ви знаєте відповідь?

Будь ласка, увійдіть та поділіться нею.

Walrus is a decentralized storage and data availability protocol designed specifically for large binary files, or "blobs"

65Пости115Відповіді
Sui.X.Peera.

Зароби свою частку з 1000 Sui

Заробляй бали репутації та отримуй винагороди за допомогу в розвитку спільноти Sui.

Ми використовуємо файли cookie, щоб гарантувати вам найкращий досвід на нашому сайті.
Детальніше