commands

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2019 License: LGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerifierStatusNoRegistered = "Not Registered"
	VerifierStatusRegistered   = "Registered"
	VerifiedStatusCanceled     = "Canceled"
	VerifiedStatusUnstaked     = "Unstaked"
)

Variables

View Source
var (
	CheckSyncStatusDuration = time.Second * 3
)
View Source
var CliCommands = []cli.Command{
	{
		Name:    "quit",
		Aliases: []string{"exit"},
		Usage:   "quit",
		Action: func(c *cli.Context) error {
			os.Exit(0)
			return cli.NewExitError("", 0)
		},
		Hidden:   false,
		HideHelp: false,
	},
	{
		Name:    "rpc",
		Aliases: []string{"r"},
		Usage:   "control node",
		Flags:   rpcFlags,
		Action: func(c *cli.Context) error {
			RpcCall(c)
			return nil
		},
	},
}
View Source
var InnerRpcForbid = false
View Source
var SyncStatus atomic.Value

Functions

func AsyncLogElectionTx

func AsyncLogElectionTx() *time.Ticker

func CSCoinToMoneyValue

func CSCoinToMoneyValue(csCoinValue *hexutil.Big) (string, error)

CSCoin to money Value

func CheckAndChangeHexToAddress

func CheckAndChangeHexToAddress(address string) (common.Address, error)

check address format

func CheckDownloaderSyncStatus

func CheckDownloaderSyncStatus()

check downloader Sync Status

func CheckRegistration

func CheckRegistration() bool

func DecimalToInter

func DecimalToInter(src string, unitBit int) (*big.Int, error)

func InitAccountInfo

func InitAccountInfo(nodeType int, path, password, passPharse string)

func InitRpcClient

func InitRpcClient(port int)

func InterToDecimal

func InterToDecimal(csCoinValue *hexutil.Big, unitBit int) (string, error)

func MoneyValueToCSCoin

func MoneyValueToCSCoin(moneyValue string) (*big.Int, error)

check and change input money value input money unit is DIP

func ParseWalletPathAndName

func ParseWalletPathAndName(inputPath string) (path, name string)

func PrintDefaultAccountStake

func PrintDefaultAccountStake()

func RecordRegistration

func RecordRegistration(txHash string)

if user applies for registering verifier, record, creating a file in $Home/.dipperin for startup check, quit if node type is not verifier

func RemoveRegistration

func RemoveRegistration()

remove file after unregister transaction

func RpcCall

func RpcCall(c *cli.Context)

Types

type RpcClient

type RpcClient interface {
	Call(result interface{}, method string, args ...interface{}) error
	Subscribe(ctx context.Context, namespace string, channel interface{}, args ...interface{}) (*rpc.ClientSubscription, error)
}

Jump to

Keyboard shortcuts

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