demo

package
v0.0.0-...-bd458c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package demo is an interactive demonstration of the Go SDK using the Stellar TestNet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialise

func Initialise(client *horizonclient.Client, keys []Account)

Initialise is a command that funds an initial set of accounts for use with other demo operations. The first account is funded from Friendbot; subseqeuent accounts are created and funded from this first account.

func Reset

func Reset(client *horizonclient.Client, keys []Account)

Reset is a command that removes all test accounts created by this demo. All funds are transferred back to Friendbot using the account merge operation.

func TXError

func TXError(client *horizonclient.Client, keys []Account)

TXError is a command that deliberately creates a bad transaction to trigger an error response from Horizon. This code demonstrates how to retrieve and inspect the error.

Types

type Account

type Account struct {
	Seed     string             `json:"name"`
	Address  string             `json:"address"`
	HAccount *hProtocol.Account `json:"account"`
	Keypair  *keypair.Full      `json:"keypair"`
	Exists   bool               `json:"exists"`
}

Account represents a Stellar account for this demo.

func InitKeys

func InitKeys(n int) []Account

InitKeys creates n random new keypairs, storing them in a local file. If the file exists, InitKeys reads the file instead to construct the keypairs (and ignores n).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL