Authorized space

OSS is a fast channel for CESS network file upload, so authorize your space to your trusted OSS service to help us upload files.

See all OSS services on the CESS chain.

You can also use the OSS service officially provided by CESS, the account is:cXhwBytXqrZLr1qM5NHJhCzEMckSTzNKw17ci2aHft6ETSQm9

The reference code is as follows:

package main

import (
	"context"
	"fmt"

	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{
	"wss://testnet-rpc0.cess.cloud/ws/",
	"wss://testnet-rpc1.cess.cloud/ws/",
	"wss://testnet-rpc2.cess.cloud/ws/",
}

func main() {
	sdk, err := cess.New(
		context.Background(),
		cess.ConnectRpcAddrs(RPC_ADDRS),
		cess.Mnemonic(MY_MNEMONIC),
	)
	if err != nil {
		panic(err)
	}
	// buy 1GiB space
	_, err = sdk.BuySpace(1)
	if err != nil {
		panic(err)
	}
	// authorize space
	fmt.Println(sdk.AuthorizeSpace("cXhwBytXqrZLr1qM5NHJhCzEMckSTzNKw17ci2aHft6ETSQm9"))
}

⚠️You must authorize space to oss to upload files.

Last updated