Developer Center

Developer Center

  • Getting Started
  • Built-in Features
  • REST API Endpoints
  • Guides
  • Cheat Sheet

›Metadata

Getting Started

  • What is Sirius Chain
  • Setting up your workstation
  • Writing your first application

Built-in Features

  • Account
  • Mosaic (SDA)
  • Namespace
  • Transfer Transaction
  • Aggregate Transaction
  • Multisig Account
  • Metadata
  • Account Restriction
  • Cross-Chain Swaps
  • Exchange Market
  • Decentralized Exchange Market
  • Liquidity Provider
  • Storage

Protocol

  • Node
  • Block
  • Cryptography
  • Transaction
  • Validating
  • Consensus Algorithms
  • Receipt
  • Inflation

REST API

  • Overview
  • Tools
  • Serialization
  • Websockets
  • Status Errors

SDKs

  • Overview
  • Architecture
  • Languages
  • Extending Sirius Chain Capabilities
  • SDK Development
  • SDK Documentation

Wallets & Explorers

  • Wallets & Explorers

Cheat Sheet

  • Sirius Chain Cheat Sheet

Guides

  • Overview
  • External Guides
  • Account

    • Creating and opening an account
    • Getting account information
    • Getting the amount of XPX sent to an account
    • Reading transactions from an account

    Account Restriction

    • Preventing spam attacks with account restrictions

    Aggregate Transaction

    • Sending payouts with aggregate-complete transaction
    • Creating an escrow with aggregate bonded transaction
    • Asking for mosaics with aggregate-bonded transaction
    • Signing announced aggregate-bonded transactions

    Block

    • Listening to New Blocks
    • Getting block by height

    Cross Chain Swaps

    • Atomic cross-chain swap between Sirius public and private chains

    Metadata

    • Account Metadata
    • Mosaic Metadata
    • Namespace Metadata
    • Account Metadata (Deprecated since 0.7.0 Sirius Chain release)
    • Mosaic Metadata (Deprecated since 0.7.0 Sirius Chain release)
    • Namespace Metadata (Deprecated since 0.7.0 Sirius Chain release)

    Monitoring

    • Monitor transaction

    Mosaic

    • Creating a mosaic (SDA)
    • Getting the mosaic information
    • Getting the asset identifier behind a namespace with receipts

    Mosaic Levy

    • Modifying Mosaic Supply

    Multisig Account

    • Converting an account to multisig
    • Modifying a multisig account
    • Creating a multi-level multisig-account
    • Sending a multisig transaction

    Namespace

    • Registering a namespace
    • Registering a subnamespace
    • Getting the Namespace information
    • Linking a namespace to a mosaic
    • Linking namespace to account

    Transfer Transaction

    • Transfer transaction
    • Sending an encrypted message

    Storage

    • Data Modification Cancel
    • Data Modification
    • Download Channel
    • Download Payment
    • Drive Closure
    • Finish Download Channel
    • Prepare Bc Drive
    • Replicator Offboarding
    • Replicator Onboarding
    • Storage Payment
    • Verification Payment

Storage

  • Overview
  • Participate
  • External Economy
  • Roles
  • Verification
  • Challenge
  • Rewards
  • Transaction Schemas
  • Built-In Features

    • Drive
    • Replicator
    • Verifier
    • Supercontracts

    Protocols

    • Cross-Block Protocol
    • Fair Streaming

    Storage User Application

    • Overview
    • Getting Started
    • Managing Drives
    • Managing Drive Files
    • Downloading Data

Namespace Metadata

Add metadata to namespace

Golang
package main

import (
"context"
"encoding/hex"
"fmt"
"time"

"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)

const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
// an account thad added metadata
privateKey = "809CD6699B7F38063E28F606BD3A8AECA6E13B1E688FE8E733D13DB843BC14B7"
)

func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}

// Use the default http client
client := sdk.NewClient(nil, conf)

metadataAdder, err := client.NewAccountFromPrivateKey(privateKey)
if err != nil {
panic(err)
}

namespaceId, err := sdk.NewNamespaceIdFromName(hex.EncodeToString([]byte("Name")))
if err != nil {
panic(err)
}

// NOTE: before NewNamespaceMetadataTransaction namespace should be registered with NewRegisterRootNamespaceTransaction
metadataTx, err := client.NewNamespaceMetadataTransaction(
sdk.NewDeadline(1*time.Hour),
namespaceId,
metadataAdder.PublicAccount,
1,
"Hello world",
"",
)
if err != nil {
panic(err)
}
metadataTx.ToAggregate(metadataAdder.PublicAccount)

abt, err := client.NewBondedAggregateTransaction(
sdk.NewDeadline(time.Hour),
[]sdk.Transaction{metadataTx},
)
if err != nil {
panic(err)
}

signedAbt, err := metadataAdder.Sign(abt)
if err != nil {
panic(err)
}

// Create lock funds transaction for aggregate bounded
lockFundsTransaction, err := client.NewLockFundsTransaction(
// The maximum amount of time to include the transaction in the blockchain.
sdk.NewDeadline(time.Hour*1),
// Funds to lock
sdk.XpxRelative(10),
// Duration of lock transaction in blocks
sdk.Duration(1000),
// Aggregate bounded transaction for lock
signedAbt,
)
if err != nil {
panic(err)
}

signedLockFundsTrx, err := metadataAdder.Sign(lockFundsTransaction)
if err != nil {
panic(err)
}

_, err = client.Transaction.Announce(context.Background(), signedLockFundsTrx)
if err != nil {
panic(err)
}
}

Get metadata of namespace

Golang
package main

import (
"context"
"encoding/hex"
"fmt"

"github.com/proximax-storage/go-xpx-chain-sdk/sdk"
)

const (
// Sirius api rest server
baseUrl = "http://localhost:3000"
// an account that added metadata and mosaic owner. Owner and account that added namespace metadata could be different
privateKey = "809CD6699B7F38063E28F606BD3A8AECA6E13B1E688FE8E733D13DB843BC14B7"
)

// suppose that namespace already exist
func main() {
conf, err := sdk.NewConfig(context.Background(), []string{baseUrl})
if err != nil {
fmt.Printf("NewConfig returned error: %s", err)
return
}

// Use the default http client
client := sdk.NewClient(nil, conf)

owner, err := client.NewAccountFromPrivateKey(privateKey)
if err != nil {
panic(err)
}

nameHex := hex.EncodeToString([]byte("SomeName"))

namespaceId, err := sdk.NewNamespaceIdFromName(nameHex)
if err != nil {
panic(err)
}

hash, err := sdk.CalculateUniqueNamespaceMetadataId(owner.Address, owner.PublicAccount, 1, namespaceId)
if err != nil {
panic(err)
}

metadata, err := client.MetadataV2.GetMetadataV2Info(context.Background(), hash)
if err != nil {
panic(err)
}

fmt.Println(metadata)
}
← Mosaic MetadataAccount Metadata (Deprecated since 0.7.0 Sirius Chain release) →
  • Add metadata to namespace
  • Get metadata of namespace
  • Follow our profile
  • Ask development questions
  • Join our Discord channel
  • Explore our Youtube channel
  • Explore Github
Protocol
BlockConsensus AlgorithmsCryptographyInflationNodeReceiptTransactionValidating
Built-in Features
AccountAggregate TransactionCross-Chain SwapsExchange MarketDecentralized Exchange MarketMetadataMosaicMultisig AccountNamespaceTransfer TransactionStorageLiquidity Provider
References
REST APISDKsCheat Sheet
Includes Documentation Forked from NEM
Copyright © 2025 Sirius Chain