Get Started

Start submitting blobs to Celestia. Your feegrant covers all transaction fees.

Quick Start

Recommended

Clone the example repo and start submitting blobs in minutes

git clone https://github.com/Bidon15/blobcell-go-test.git

Then configure your environment:

  1. Copy .env.example to .env
  2. Add your private key from Keplr
  3. Add your feegranter address from your BlobCell profile
  4. Run go run main.go
or set up manually
1

Setup Environment

Create a .env file with your credentials

Get Your Private Key from Keplr

  1. Open Keplr extension → Click account icon (top right)
  2. Select "Show Private Key"
  3. Enter password and copy the key
.envbash
# .env - Your Celestia configuration
# Get your private key from Keplr: Settings > Show Private Key

CELESTIA_PRIVATE_KEY="your_hex_private_key_here"
CELESTIA_RPC_URL="http://localhost:26658"
CELESTIA_GRPC_URL="http://localhost:9090"
CELESTIA_NETWORK="mocha-4"

# Feegranter address from BlobCell (copy from your profile)
CELESTIA_FEEGRANTER="celestia1..."  # Your feegranter address

Never commit .env to git. Add it to .gitignore

2

Submit Your First Blob

Choose your language and start building

go mod init blobcell-example && go mod tidy
go.modgo
// go.mod
module blobcell-example

go 1.24

require (
	github.com/celestiaorg/celestia-node v0.28.4-mocha
	github.com/celestiaorg/go-square/v2 v2.1.0
	github.com/cosmos/cosmos-sdk v0.46.16
	github.com/joho/godotenv v1.5.1
)
main.gogo
package main

import (
	"context"
	"fmt"
	"os"
	"time"

	"github.com/joho/godotenv"
	"github.com/cosmos/cosmos-sdk/crypto/keyring"
	libshare "github.com/celestiaorg/go-square/v2/share"
	"github.com/celestiaorg/celestia-node/api/client"
	"github.com/celestiaorg/celestia-node/blob"
	"github.com/celestiaorg/celestia-node/state"
)

func main() {
	// Load .env file
	if err := godotenv.Load(); err != nil {
		fmt.Println("No .env file found, using environment variables")
	}

	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
	defer cancel()

	// Setup keyring
	keyname := "blobcell"
	kr, err := client.KeyringWithNewKey(client.KeyringConfig{
		KeyName:     keyname,
		BackendName: keyring.BackendTest,
	}, "./keys")
	if err != nil {
		panic(fmt.Sprintf("Failed to create keyring: %v", err))
	}

	// Configure client using env vars
	cfg := client.Config{
		ReadConfig: client.ReadConfig{
			BridgeDAAddr: os.Getenv("CELESTIA_RPC_URL"),
			DAAuthToken:  os.Getenv("CELESTIA_AUTH_TOKEN"),
		},
		SubmitConfig: client.SubmitConfig{
			DefaultKeyName: keyname,
			Network:        os.Getenv("CELESTIA_NETWORK"),
			CoreGRPCConfig: client.CoreGRPCConfig{
				Addr:       os.Getenv("CELESTIA_GRPC_URL"),
				TLSEnabled: false,
			},
		},
	}

	// Create client
	c, err := client.New(ctx, cfg, kr)
	if err != nil {
		panic(fmt.Sprintf("Failed to create client: %v", err))
	}

	// Create namespace for your blobs
	namespace := libshare.MustNewV0Namespace([]byte("blobcell"))

	// Configure feegrant - BlobCell pays your fees!
	feegranter := os.Getenv("CELESTIA_FEEGRANTER")
	submitOpts := state.NewTxConfig(state.WithFeeGranterAddress(feegranter))

	// Submit 3 blobs to demonstrate the workflow
	fmt.Println("Submitting 3 blobs to Celestia...\n")
	fmt.Printf("Using feegranter: %s\n\n", feegranter)

	for i := 1; i <= 3; i++ {
		// Create unique blob data
		data := fmt.Sprintf("Hello from BlobCell! Message #%d at %s",
			i, time.Now().Format(time.RFC3339))

		b, err := blob.NewBlob(libshare.ShareVersionZero, namespace, []byte(data), nil)
		if err != nil {
			panic(fmt.Sprintf("Failed to create blob %d: %v", i, err))
		}

		// Submit with feegrant - BlobCell pays the fees!
		height, err := c.Blob.Submit(ctx, []*blob.Blob{b}, submitOpts)
		if err != nil {
			panic(fmt.Sprintf("Failed to submit blob %d: %v", i, err))
		}
		fmt.Printf("āœ“ Blob %d submitted at height %d\n", i, height)

		// Verify by retrieving
		retrieved, err := c.Blob.Get(ctx, height, namespace, b.Commitment)
		if err != nil {
			fmt.Printf("  Warning: Could not verify blob %d: %v\n", i, err)
		} else {
			fmt.Printf("  āœ“ Verified: %s\n", string(retrieved.Data()))
		}

		// Small delay between submissions
		if i < 3 {
			time.Sleep(2 * time.Second)
		}
	}

	fmt.Println("\nšŸŽ‰ All 3 blobs submitted successfully!")
	fmt.Println("View your blobs on https://mocha.celenium.io")
}
Full Go Client Docs
3

Run & Verify

Go

go run main.go

Rust

cargo run

Your feegrant covers all transaction fees. Check your blob on Celenium Explorer

Community

...

Developers building with BlobCell