Upload file stream

This article shows how to upload file stream to oss.

Before upoloading file stream, you need to buy storage space and authorize it to DeOSS, please refer to Purchase Space and Authorized space.

See all OSS services on the CESS chain.

You can also use the OSS service officially provided by CESS, the address is:http://deoss-pub-gateway.cess.cloud/

An example of uploading a file stream:

package main

import (

	cess "github.com/CESSProject/cess-go-sdk"

// Substrate well-known mnemonic:
//	https://github.com/substrate-developer-hub/substrate-developer-hub.github.io/issues/613
var MY_MNEMONIC = "bottom drive obey lake curtain smoke basket hold race lonely fit walk"

var RPC_ADDRS = []string{

func main() {
	sdk, err := cess.New(
	if err != nil {
	// Fill in the real and complete file path
	fd, err := os.Open("/home/test/test.log")
	if err != nil {
	defer fd.Close()
	// Upload files to oss
	sdk.StoreObject("http://deoss-pub-gateway.cess.cloud/", fd, "test-bucket")

Last updated