General use

Introduction

Let's review some code examples on how to handle generic tasks:

Tip: if you're new to our Java library, we suggest you begin with our Get Started guide.

Initializing a Universe

A Universe is an instance of a Radix Distributed Ledger which is defined by a genesis atom and a dynamic set of unpermissioned nodes forming a network.

Available networks

Network

Description

LOCALHOST_SINGLENODE

A locally hosted single node connection.

BETANET_SINGLENODE

A single node Betanet connection.

A predefined configuration to bootstrap into the LOCALHOST_SINGLENODE network is available:

BootstrapConfig config = Bootstrap.LOCALHOST_SINGLENODE;

Initializing the Application API

The Radix Application API is a client-side API exposing high-level abstractions to make DApp creation easier.

To initialize the API:

RadixApplicationAPI api = RadixApplicationAPI.create(Bootstrap.BETANET, identity);

To continually sync and pull from the network ledger on your account:

Disposable d = api.pull();

To stop syncing:

d.dispose();