Sirius Chain Developer Center 0.2.6

Sirius Chain Developer Center 0.2.6

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

›Block

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 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

Monitoring

  • Monitor transaction

Mosaic

  • Creating a mosaic
  • Getting the mosaic information
  • Getting the asset identifier behind a namespace with receipts
  • 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

Getting block by height

Get the block information given a height.

Prerequisites

  • Text editor or IDE
  • XPX-Chain-SDK or XPX-Chain-CLI
  • Finish the getting started section

Getting into some code

Are you curious to see what happened in the genesis block?

Golang
TypeScript
JavaScript
Java
conf, err := sdk.NewConfig(context.Background(), []string{"http://localhost:3000"})
if err != nil {
panic(err)
}

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

block, err := client.Blockchain.GetBlockByHeight(context.Background(), sdk.Height(1))
if err != nil {
panic(err)
}
fmt.Printf(block.String())
const blockchainHttp = new BlockchainHttp('http://localhost:3000');

const height = 1;

blockchainHttp
.getBlockByHeight(height)
.subscribe(block => console.log(block), err => console.error(err));
const blockchainHttp = new BlockchainHttp('http://localhost:3000');

const height = 1;

blockchainHttp
.getBlockByHeight(height)
.subscribe(block => console.log(block), err => console.error(err));
    final BlockchainHttp blockchainHttp = new BlockchainHttp("http://localhost:3000");

// Replace with block height
final BigInteger blockHeight = BigInteger.valueOf(1);

final BlockInfo blockInfo = blockchainHttp.getBlockByHeight(blockHeight).toFuture().get();

System.out.print(blockInfo);

The following snippet returns the height of the latest block.

Golang
TypeScript
JavaScript
Java
CLI
conf, err := sdk.NewConfig(context.Background(), []string{"http://localhost:3000"})
if err != nil {
panic(err)
}

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

height, err := client.Blockchain.GetBlockchainHeight(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%s\n", height)
const blockchainHttp = new BlockchainHttp('http://localhost:3000');

blockchainHttp
.getBlockchainHeight()
.subscribe(height => console.log(height.compact()), err => console.error(err));
const blockchainHttp = new BlockchainHttp('http://localhost:3000');

blockchainHttp
.getBlockchainHeight()
.subscribe(height => console.log(height.compact()), err => console.error(err));
    final BlockchainHttp blockchainHttp = new BlockchainHttp("http://localhost:3000");

final BigInteger blockchainHeight = blockchainHttp.getBlockchainHeight().toFuture().get();

System.out.print(blockchainHeight);
xpx2-cli blockchain height
← Listening New BlocksAtomic cross-chain swap between Sirius public and private chains →
  • Prerequisites
  • Getting into some code
  • Join #general discussion
  • Ask development questions
  • Follow the dev updates
  • Explore Github
Protocol
BlockConsensus AlgorithmsCryptographyInflationNodeReceiptTransactionValidating
Built-in Features
AccountAccount FilterAggregate TransactionCross-Chain SwapsExchange MarketMetadataMosaicMultisig AccountNamespaceSuper contractTransfer Transaction
References
REST APISDKsXPX-Chain-CLICheat Sheet
Documentation Forked From NEM
Copyright © 2020 ProximaX