common

package
v0.2.8-doc Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContractAddress

func GetContractAddress(name string) common.Address

GetContractAddress get contract address by name

func NewCpcClient

func NewCpcClient(ep string, kspath string, password string) (*cpclient.Client, *ecdsa.PrivateKey, *ecdsa.PublicKey, common.Address, error)

NewCpcClient new a cpc.client

Types

type Balance

type Balance struct {
	Balance big.Int
	Reward  RewardBalance
}

Balance of the cpchain node

type Manager

type Manager interface {
	GetStatus() (*Status, error)
	StartMining() error
	StopMining() error
	GetBalance() (*Balance, error)
	GetBalanceOnReward() (*RewardBalance, error)
	Withdraw() error
	SubmitDeposit() error
	WantRenew() error
	QuitRenew() error
}

Manager manage the cpchain node

type Output

type Output interface {
	Status(status *Status)
	Balance(balance *Balance)
	Info(msg string, params ...interface{})
	Error(msg string, params ...interface{})
	Fatal(msg string, params ...interface{})
	Warn(msg string, params ...interface{})
}

Output data

type RewardBalance

type RewardBalance struct {
	TotalBalance  *big.Int
	FreeBalance   *big.Int
	LockedBalance *big.Int
}

RewardBalance is balance of contract namded reward

type Status

type Status struct {
	Mining           bool
	RNode            bool
	ENode            bool
	Proposer         bool
	Locked           bool
	NextNumber       *big.Int
	SupportPrivateTx bool
}

Status is the status of cpchain ndoe

Jump to

Keyboard shortcuts

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