AWS SDK - Ruby

Please read the following to understand how to use the 4EVERLAND Bucket with AWS SDK - Ruby. This guide outlines the integration of AWS SDK API for Ruby with the 4EVERLAND Bucket to facilitate file uploads to the IPFS or Arweave storage networks.

Preparation

Development Examples

Create a bucket

endpoint: https://endpoint.4everland.co

aws_access_key_id: Bucket-Access Keys-API key

aws_secret_access_key: Bucket-Access Keys-API Secret

bucket_name: The desired bucket name to create

require 'aws-sdk-s3'

s3 = Aws::S3::Client.new(
access_key_id: '4EVERLAND-Bucket-APIKey',
secret_access_key: '4EVERLAND-Bucket-APISecret',
region: '4everland',
endpoint: 'https://endpoint.4everland.co'
)

bucket_name = 'new-bucketname'
s3.create_bucket(bucket: bucket_name)

Upload a file

bucket_name: Your bucket name

object_key: The name of the file to be uploaded

object_path: The path of the file to be uploaded

Requesting IPFS CID and Arweave Hash

endpoint: https://endpoint.4everland.co

aws_access_key_id: Bucket-Access Keys-API Key

aws_secret_access_key: Bucket-Access Keys-API Secret

bucket_name: The bucket name where the target file is stored

object_name: The name of the target file

If you have any questions, please join our Discord server, or send us an email at [email protected].

Last updated