What does IPFS mean in the Web3 world?
IPFS addresses are not locations, but point directly to resources and ensure that this data comes from the nearest source. This means that it is not plagued by centralised servers. IPFS is not built on top of the blockchain, but works with existing blockchain protocols. Each file uploaded to IPFS is given a permanent address, and you can store large amounts of information on IPFS and put immutable permanent IPFS addresses into blockchain transactions.
How to use IPFS?
To use IPFS, you first need to access a node through which to store and access data. You can:
-
Run your own IPFS node, which requires you to download and configure a local IPFS node.
-
Leverage other IPFS pin service providers that greatly increase access speed while maintaining stability, one of which is 4EVERLAND.
What is 4EVERLAND?
4EVERLAND is a Web 3.0 cloud computing platform that integrates storage, computing, and network core capabilities. It aims to help the user to make a smooth leap from Web 2.0 to Web 3.0 and become the infrastructure for millions of Web 3.0 developers and applications.
This means that anyone can quickly access Web3 through the services provided by 4EVERLAND, which includes IPFS storage service.
How to use 4EVERLAND in your projects?
There are two ways to use the 4EVERLAND IPFS storage service, where the user-friendly GUI interface allows regular users to quickly upload their files to IPFS with one click.
In addition, 4EVERLAND is also compatible with the AWS-S3 service, meaning that users or developers can use the AWS API to upload data to the IPFS network.
Bucket API
The Bucket API is an Amazon S3-compatible API cloud storage service interface, powered by an open Web protocol that confers trustless, decentralized, or user-controlled characteristics, describing the relevant API operations, the relevant requests and corresponding structures, and the error code.
Endpoint
You can follow the website http://endpoint.4everland.co to generate API Key from Bucket Auth Tokens
https:// endpoint.4everland.com
Supported Feature Calls
Currently, the API supports Bucket Calls, Object Calls, and also supports Multipart Calls and Privacy Calls.
Example for Javascript
Installing
npm install @aws-sdk/client-s3
Init s3 client
import { S3 } from “@aws-sdk/client-s3”;const { endpoint, accessKey, secretKey, sessionToken } = s3Params;
const s3 = new S3({
endpoint,
signatureVersion: “v4”,
credentials: {
accessKeyId: accessKey,
secretAccessKey: secretKey,
sessionToken,
},
region: “us-west-2”,
});
Create bucket and put object
import { Upload } from “@aws-sdk/lib-storage”;const createBucketOutput = await s3.createBucket({
Bucket: “bucketname”,
});
const putObjectOutput = await s3.putObject({
Bucket: “bucketname”,
Key: “key”,
Body: “data content”,
});// multipart upload
const params = {
Bucket,
Key: file.name,
Body: file,
ContentType: file.type,
};
try {
const task = new Upload({
client: s3,
queueSize: 3, // 3 MiB
params,
});
task.on(“httpUploadProgress”, (e) => {
const progress = ((e.loaded / e.total) * 100) | 0;
console.log(progress, e);
});
await task.done();
} catch (error) {
if (error) {
console.log(“task”, error.message);
}
}
List buckets and list objects
const buckets = await s3.listBuckets();
console.log(buckets);
const objects = s3.listObjectsV2({ Bucket: “bucketname” });
console.log(objects);
Join 4EVERLAND community:
Website | Twitter | Telegram | Discord | Reddit | Medium| Email