Documentation ¶
Overview ¶
Copyright 2017-2018 OneLedger
Encapsulate any reads/writes to a terminal, to allow scripting later.
Should be separate from logging...
Copyright 2017 - 2018 OneLedger ¶
Query the chain for answers ¶
Copyright 2017 - 2018 OneLedger ¶
Structures and functions for getting command line arguments, and functions to convert these into specific requests.
Copyright 2017-2018 OneLedger ¶
Copyright 2017-2018 OneLedger ¶
Common Transaction utilities, helps to create them consistently
Index ¶
- func CatchSigterm(StopProcess func())
- func CreateApplyValidatorRequest(args *comm.ApplyValidatorArguments) []byte
- func CreateBalanceRequest(args *BalanceArguments) []byte
- func CreateExSendRequest(args *comm.ExSendArguments) []byte
- func CreateExecuteRequest(args *ExecuteArguments) []byte
- func CreateInstallRequest(args *InstallArguments, script []byte) []byte
- func CreateMintRequest(args *comm.SendArguments) []byte
- func CreateSendRequest(args *comm.SendArguments) []byte
- func CreateSwapRequest(args *comm.SwapArguments) []byte
- func GetAccountKey(identity string) []byte
- func GetBalance(accountKey id.AccountKey) *data.Balance
- func GetCurrencyAddress(currencyName string, id string) []byte
- func GetNodeName() string
- func GetPublicKey() id.PublicKey
- func GetSequenceNumber(accountKey id.AccountKey) int64
- func GetTxByHash(hash []byte) *ctypes.ResultTx
- func GetTxByHeight(height int) *ctypes.ResultTxSearch
- func GetTxByType(t string) *ctypes.ResultTxSearch
- func ParseVersion(argsVersion string) *version.Version
- func ReadFile(filePath string) []byte
- func RegisterIdentityRequest(args *RegisterArguments) interface{}
- func SignAndPack(transaction action.Transaction) []byte
- func UpdateAccountRequest(args *AccountArguments) interface{}
- type AccountArguments
- type BalanceArguments
- type ContractArguments
- type ExecuteArguments
- type InstallArguments
- type RegisterArguments
- type Terminal
- type Tty
- func (tty *Tty) Error(text ...interface{})
- func (tty *Tty) Fatal(text ...interface{})
- func (tty *Tty) Info(text ...interface{})
- func (tty *Tty) Password(prompt string) string
- func (tty *Tty) Print(text ...interface{})
- func (tty *Tty) Question(text ...interface{})
- func (tty *Tty) Read(prompt string) string
- func (tty *Tty) Warning(text ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatchSigterm ¶ added in v0.7.1
func CatchSigterm(StopProcess func())
A polite way of bring down the service on a SIGTERM
func CreateApplyValidatorRequest ¶ added in v0.7.1
func CreateApplyValidatorRequest(args *comm.ApplyValidatorArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateBalanceRequest ¶
func CreateBalanceRequest(args *BalanceArguments) []byte
func CreateExSendRequest ¶ added in v0.7.1
func CreateExSendRequest(args *comm.ExSendArguments) []byte
func CreateExecuteRequest ¶ added in v0.8.0
func CreateExecuteRequest(args *ExecuteArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateInstallRequest ¶ added in v0.8.0
func CreateInstallRequest(args *InstallArguments, script []byte) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateMintRequest ¶
func CreateMintRequest(args *comm.SendArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateSendRequest ¶
func CreateSendRequest(args *comm.SendArguments) []byte
CreateRequest builds and signs the transaction based on the arguments
func CreateSwapRequest ¶
func CreateSwapRequest(args *comm.SwapArguments) []byte
Create a swap request
func GetAccountKey ¶
func GetBalance ¶
func GetBalance(accountKey id.AccountKey) *data.Balance
TODO: Return a balance, not a coin
func GetCurrencyAddress ¶ added in v0.7.1
func GetNodeName ¶ added in v0.6.2
func GetNodeName() string
func GetPublicKey ¶
Given an Identity or Account, get the correct associated public key
func GetSequenceNumber ¶ added in v0.7.1
func GetSequenceNumber(accountKey id.AccountKey) int64
func GetTxByHash ¶ added in v0.7.0
func GetTxByHeight ¶ added in v0.7.0
func GetTxByHeight(height int) *ctypes.ResultTxSearch
func GetTxByType ¶ added in v0.7.0
func GetTxByType(t string) *ctypes.ResultTxSearch
func ParseVersion ¶ added in v0.8.0
func RegisterIdentityRequest ¶ added in v0.7.1
func RegisterIdentityRequest(args *RegisterArguments) interface{}
Create a request to register a new identity with the chain
func SignAndPack ¶
func SignAndPack(transaction action.Transaction) []byte
Prepare a transaction to be issued.
func UpdateAccountRequest ¶ added in v0.7.1
func UpdateAccountRequest(args *AccountArguments) interface{}
Types ¶
type AccountArguments ¶ added in v0.7.1
type AccountArguments struct { Account string Chain string PublicKey string PrivateKey string NodeAccount bool }
Registration
type BalanceArguments ¶
type BalanceArguments struct { }
type ContractArguments ¶ added in v0.8.2
type ExecuteArguments ¶ added in v0.8.0
type InstallArguments ¶ added in v0.8.0
type RegisterArguments ¶
Registration
type Terminal ¶
type Terminal interface { // Output //Print(text ...interface{}) Question(text ...interface{}) Info(text ...interface{}) Warning(text ...interface{}) Error(text ...interface{}) Fatal(text ...interface{}) // Input Read(string) string Password(string) string }
var Console Terminal
A globally accessable terminal called Console