SAO Network Releases Amazon S3 Compatible API

SAO Network
4 min readAug 17, 2023

On August 17, SAO Network announced the release of the Amazon S3 Compatible API, which provides a library of APIs and services for simpler use of data services on the SAO Network.

Source: PixelPlex

This API is applicable to multiple programming languages supported by Amazon S3 with the goal of simplifying the process of uploading and downloading. With this API, a variety of applications could easily apply SAO Network as their decentralized data storage layer. By improving its compatibility with Amazon S3, SAO Network allows developers to seamlessly integrate their existing Amazon-S3-based applications with SAO Network’s storage.

Introduction

As a Web3 storage infrastructure, SAO Network has been endowed with the mission to boost Web3 ecosystem and support the migration of Web2 users to Web3. As many applications rely on Amazon S3 to store their structured data, SAO Network has developed an Amazon S3 Compatible API to enable a smooth transition from Web2 to Web3. This API will make it easier to use SAO Network’s storage and reduce unnecessary development efforts.

QuickStart Guide

Now please follow the guide to set your own server to upload and download data onto SAO Network using MinIO with Amazon S3 services.

Prerequisites

  • Git
  • Go (version 1.19.x)

Clone the Repository

First, clone the MinIO repository from GitHub by running the following command line:

git clone git@github.com:SAONetwork/minio.git

Checkout the SAONetwork Branch

Navigate into the cloned repository and checkout the saonetwork branch:

cd minio
git checkout saonetwork

Build the Project

Then build a project by running the following command line:

make build

Configure Credentials

The default credentials for MinIO are minioadmin:minioadmin. You can change these by setting the MINIO_ROOT_USER and MINIO_ROOT_PASSWORD environment variables.

Configure SAOClient

MinIO uses the existing configuration file of SAOClient. To initialize the SAOClient with the network you want to connect to (beta network for example), you can use corresponding command lines as follows:

For Beta Network:

./saoclient --chain-address <https://rpc-beta.sao.network:443> --gateway <https://gateway-beta.sao.network/rpc/v0> init --chain-id sao-20230629 --key-name nancy

For a Customed Node:

If you have your own node, you can initialize the SAOClient with the following command lines, replacing the chain address and gateway with your specific node’s addresses. Also, specify the chain ID according to the network you want to connect to (sao-20230629 for beta and sao-testnet1 for testnet):

./saoclient --chain-address YOUR_CHAIN_ADDRESS --gateway YOUR_GATEWAY_ADDRESS init --chain-id YOUR_CHAIN_ID --key-name nancy

Replace YOUR_CHAIN_ADDRESS with the address of your chain (e.g., http://127.0.0.1:26657), YOUR_GATEWAY_ADDRESS with the address of your gateway (e.g., http://127.0.0.1:5151/rpc/v0), and YOUR_CHAIN_ID with the chain ID of the network you want to connect to (sao-20230629 for beta).

After successful initialization, the by default configuration file should be located at ~/.sao-cli/config.toml and presented in the following way:

GroupId = "YOUR_GROUP_ID"KeyName = "nancy"ChainAddress = "<https://rpc-beta.sao.network:443>"Gateway = "<https://gateway-beta.sao.network/rpc/v0>"Token = "DEFAULT_TOKEN"

Configuring MultiAddr:

In addition to the basic configuration file, you can also set the MultiAddr option in the config.toml file of your SAOClient. This option specifies the multiaddress of the libp2p node that the SAOClient will connect to. If MultiAddr is set, files wil be uploadeding to SAO through libp2p, which is a recommended method for large-file-uploading.

Here’s an example of setting the MultiAddr option:

MultiAddr = "/ip4/8.222.225.178/tcp/5153/p2p/12D3KooWJA2R7RTd6aD2pUdvjN29FdiC8f5edSifXA2tXBcbA2UX"

You can find the MultiAddr by running the following command line, replacing YOUR_GATEWAY_NODE_ADDRESS with your specific node address:

saod query node show-node YOUR_GATEWAY_NODE_ADDRESS

Alternatively, you can also use a curl command to find the MultiAddr:

curl -X GET "<https://api-beta.sao.network/SaoNetwork/sao/node/node/YOUR_GATEWAY_NODE_ADDRESS>" -H "accept: application/json"

Replace YOUR_GATEWAY_NODE_ADDRESS with the specific address of your node in the curl command as well.

Search for a TCP peer in the peer field, such as /ip4/8.222.225.178/tcp/5153/p2p/12D3KooWJA2R7RTd6aD2pUdvjN29FdiC8f5edSifXA2tXBcbA2UX

Start the Server

You can now start the MinIO server by running the following command line:

./minio server /data_folder

Replace /data_folder with the path to the folder where you want MinIO to store its data.

Concept

In the context of SAO Network, a MinIO bucket maps to a group ID in SAO, and an object name in MinIO maps to an alias in SAO. This mapping allows you to interact with SAO Network using familiar S3 operations.

You should now have a working MinIO server that’s configured to work with SAO Network. You can use the MinIO client or any S3-compatible client to interact with your MinIO server.

Upload & Download Data

Upon successful creation of your own server, you can upload and download data on the SAO Network with MinIO using the SDKs devloped by the SAO team.

For some frequently-used SDKs, please refer to the Quickstart code examples:

Using Go with MinIO and SAO Network

Using Java with MinIO and SAO Network

Using Node.js with MinIO and SAO Network

Conclusion

This article provides a brief introduction to the SAO Network’s Amazon S3 Compatible API, an easy-to-use storage tool with Amazon S3 compatibility, which ensures that developers can easily leverage the decentralized storage of SAO Network without a complicated migration of their application data. The team is confident that this new tooling release will provide developers with even more options for storing and accessing data. Try the API now at https://github.com/SAONetwork/minio/wiki ! Look forward to your feedback.

About SAO Network

SAO Network, developed by Hedra Labs, is a permissionless open DeStorage network for Web3. Composed of a consensus layer, a storage layer, and a computation layer, SAO Network offers a decentralized data storage and access protocol based on Cosmos SDK and IPFS. The vision of team is to facilitate the mass adoption of Web3 data storage and provide data services for various applications and users in Web3.

For more about SAO Network,

--

--

SAO Network

A secured and decentralized storage infrastructure for Web3