cmd

package
v0.0.0-...-d5522c5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Overview

  • Copyright (c) 2021. Baidu Inc. All Rights Reserved.

Copyright (c) 2021. Baidu Inc. All Rights Reserved.

Index

Constants

View Source
const (
	ModuleName = "xkernel"
)

本文件封装了和共识模块有关的client调用接口, 具体格式为: xchain-cli consensus invoke 当前共识kernel调用

--type 标识共识名称,需符合当前共识状态
--method 标识共识方法,即调用的目标kernerl方法
--desc 标识输入参数,json格式

Variables

View Source
var (
	// ErrInvalidAmount error
	ErrInvalidAmount = errors.New("Invalid amount number")
	// ErrNegativeAmount error
	ErrNegativeAmount = errors.New("Amount in transaction can not be negative number")
	// ErrPutTx error
	ErrPutTx = errors.New("Put tx error")
	// ErrSelectUtxo error
	ErrSelectUtxo = errors.New("Select utxo error")
)
View Source
var (
	// commands 用于收集所有的子命令,在启动的时候统一往Cli注册
	Commands []CommandFunc
)

Functions

func AddCommand

func AddCommand(cmd CommandFunc)

AddCommand add sub cmd

func NewACLCommand

func NewACLCommand(cli *Cli) *cobra.Command

NewACLCommand new acl cmd

func NewACLQueryCommand

func NewACLQueryCommand(cli *Cli) *cobra.Command

NewACLQueryCommand new acl query cmd

func NewAccountBalanceCommand

func NewAccountBalanceCommand(cli *Cli) *cobra.Command

NewAccountBalanceCommand new function

func NewAccountCommand

func NewAccountCommand(cli *Cli) *cobra.Command

NewAccountCommand new account cmd

func NewAccountContractsCommand

func NewAccountContractsCommand(cli *Cli) *cobra.Command

NewAccountContractsCommand new account contracts cmd

func NewAccountDecryptCommand

func NewAccountDecryptCommand(cli *Cli) *cobra.Command

NewAccountDecryptCommand new decrypt account command

func NewAccountNewCommand

func NewAccountNewCommand(cli *Cli) *cobra.Command

NewAccountNewCommand new account new cmd

func NewAccountNewkeysCommand

func NewAccountNewkeysCommand(cli *Cli) *cobra.Command

NewAccountNewkeysCommand new addr account cmd

func NewAccountQueryCommand

func NewAccountQueryCommand(cli *Cli) *cobra.Command

NewAccountQueryCommand new account query cmd

func NewAccountRestoreCommand

func NewAccountRestoreCommand(cli *Cli) *cobra.Command

NewAccountRestoreCommand

func NewBlockCommand

func NewBlockCommand(cli *Cli) *cobra.Command

NewBlockCommand new block cmd

func NewConsensusCommand

func NewConsensusCommand(cli *Cli) *cobra.Command

NewAccountCommand new account cmd

func NewConsensusInvokeCommand

func NewConsensusInvokeCommand(cli *Cli) *cobra.Command

NewConsensusCommand new consensus cmd

func NewConsensusStatusCommand

func NewConsensusStatusCommand(cli *Cli) *cobra.Command

NewConsensusCommand new consensus cmd

func NewContractCommand

func NewContractCommand(cli *Cli) *cobra.Command

NewContractCommand new contract cmd

func NewContractDeployCommand

func NewContractDeployCommand(cli *Cli, module string) *cobra.Command

NewContractDeployCommand new wasm/native/evm deploy cmd

func NewContractInvokeCommand

func NewContractInvokeCommand(cli *Cli, module string) *cobra.Command

NewContractInvokeCommand new wasm/native/evm invoke cmd

func NewContractQueryCommand

func NewContractQueryCommand(cli *Cli, module string) *cobra.Command

NewContractQueryCommand new wasm/native/evm query cmd

func NewContractStatDataQueryCommand

func NewContractStatDataQueryCommand(cli *Cli) *cobra.Command

NewContractStatDataQueryCommand new a command for ContractStatDataQueryCommand

func NewContractUpgradeCommand

func NewContractUpgradeCommand(cli *Cli) *cobra.Command

NewContractUpgradeCommand new wasm deploy cmd

func NewCreateChainVersion

func NewCreateChainVersion(cli *Cli) *cobra.Command

NewCreateChainVersion new create chain cmd

func NewEVMAddrTransCommand

func NewEVMAddrTransCommand(cli *Cli) *cobra.Command

NewEVMAddrTransCommand new trans cmd

func NewEvmCommand

func NewEvmCommand(cli *Cli) *cobra.Command

NewEvmCommand new evm cmd

func NewGetComplianceCheckSignCommand

func NewGetComplianceCheckSignCommand(cli *Cli) *cobra.Command

func NewGovernInitCommand

func NewGovernInitCommand(cli *Cli) *cobra.Command

NewGovernInitCommand new transfer govern token cmd

func NewGovernTokenCommand

func NewGovernTokenCommand(cli *Cli) *cobra.Command

NewGovernTokenCommand new govern token cmd

func NewGovernTokenQueryCommand

func NewGovernTokenQueryCommand(cli *Cli) *cobra.Command

NewContractQueryCommand new wasm/native/evm query cmd

func NewGovernTransferCommand

func NewGovernTransferCommand(cli *Cli) *cobra.Command

NewGovernTransferCommand new transfer govern token cmd

func NewListUtxoCommand

func NewListUtxoCommand(cli *Cli) *cobra.Command

NewListUtxoCommand an entry to query utxo records

func NewMergeUtxoCommand

func NewMergeUtxoCommand(cli *Cli) *cobra.Command

NewMergeUtxoCommand new an instance of merge utxo command

func NewMultisigCheckCommand

func NewMultisigCheckCommand(cli *Cli) *cobra.Command

NewMultisigCheckCommand multisig check init method

func NewMultisigCommand

func NewMultisigCommand(cli *Cli) *cobra.Command

NewMultisigCommand MultisigCommand init method

func NewMultisigGenCommand

func NewMultisigGenCommand(cli *Cli) *cobra.Command

NewMultisigGenCommand multisig gen init method

func NewMultisigSendCommand

func NewMultisigSendCommand(cli *Cli) *cobra.Command

NewMultisigSendCommand multisig gen init method

func NewMultisigSignCommand

func NewMultisigSignCommand(cli *Cli) *cobra.Command

NewMultisigSignCommand multisig sign init method

func NewNativeCommand

func NewNativeCommand(cli *Cli) *cobra.Command

NewNativeCommand new native cmd

func NewNetURLCommand

func NewNetURLCommand(cli *Cli) *cobra.Command

NewNetURLCommand new neturl cmd

func NewNetURLConvertCommand

func NewNetURLConvertCommand(cli *Cli) *cobra.Command

NewNetURLGenCommand new neturl gen cmd

func NewNetURLGenCommand

func NewNetURLGenCommand(cli *Cli) *cobra.Command

NewNetURLGenCommand new neturl gen cmd

func NewNetURLGetCommand

func NewNetURLGetCommand(cli *Cli) *cobra.Command

NewNetURLGetCommand new get neturl cmd

func NewNetURLPreviewCommand

func NewNetURLPreviewCommand(cli *Cli) *cobra.Command

NewNetURLPreviewCommand new get neturl cmd

func NewProposalCommand

func NewProposalCommand(cli *Cli) *cobra.Command

NewProposalCommand new proposal cmd

func NewProposalProposeCommand

func NewProposalProposeCommand(cli *Cli) *cobra.Command

NewProposalProposeCommand propose a proposal cmd

func NewProposalQueryCommand

func NewProposalQueryCommand(cli *Cli) *cobra.Command

NewProposalQueryCommand new proposal query cmd

func NewProposalThawCommand

func NewProposalThawCommand(cli *Cli) *cobra.Command

NewProposalThawCommand vote a proposal cmd

func NewProposalVoteCommand

func NewProposalVoteCommand(cli *Cli) *cobra.Command

NewProposalVoteCommand vote a proposal cmd

func NewQueryCandidatesCommand

func NewQueryCandidatesCommand(cli *Cli) *cobra.Command

NewQueryCandidatesCommand new query candidates cmd

func NewQueryCheckResultCommand

func NewQueryCheckResultCommand(cli *Cli) *cobra.Command

NewQueryCheckResultCommand new query res

func NewQueryNominateRecordsCommand

func NewQueryNominateRecordsCommand(cli *Cli) *cobra.Command

NewQueryNominateRecordsCommand new query Nominate cmd

func NewQueryNomineeRecordsCommand

func NewQueryNomineeRecordsCommand(cli *Cli) *cobra.Command

NewQueryNomineeRecordsCommand new query nominee records

func NewQueryStatusCommand

func NewQueryStatusCommand(cli *Cli) *cobra.Command

NewQueryStatusCommand new query vote records

func NewQueryVoteRecordsCommand

func NewQueryVoteRecordsCommand(cli *Cli) *cobra.Command

NewQueryVoteRecordsCommand new query vote records

func NewQueryVotedRecordsCommand

func NewQueryVotedRecordsCommand(cli *Cli) *cobra.Command

NewQueryVotedRecordsCommand new query votedrecords cmd

func NewSplitUtxoCommand

func NewSplitUtxoCommand(cli *Cli) *cobra.Command

NewSplitUtxoCommand return

func NewStatusCommand

func NewStatusCommand(cli *Cli) *cobra.Command

NewStatusCommand new status cmd

func NewTDposCommand

func NewTDposCommand(cli *Cli) *cobra.Command

NewTDposCommand new tdpos cmd

func NewTransferCommand

func NewTransferCommand(cli *Cli) *cobra.Command

NewTransferCommand new transfer cmd

func NewTxCommand

func NewTxCommand(cli *Cli) *cobra.Command

NewTxCommand new tx cmd

func NewTxQueryCommand

func NewTxQueryCommand(cli *Cli) *cobra.Command

NewTxQueryCommand new tx query cmd

func NewUtxoCommand

func NewUtxoCommand(cli *Cli) *cobra.Command

NewUtxoCommand init child utxo command

func NewVoteCommand

func NewVoteCommand(cli *Cli) *cobra.Command

NewVoteCommand new vote

func NewWasmCommand

func NewWasmCommand(cli *Cli) *cobra.Command

NewWasmCommand new wasm cmd

Types

type ACLCommand

type ACLCommand struct {
	// contains filtered or unexported fields
}

ACLCommand acl cmd struct

type ACLQueryCommand

type ACLQueryCommand struct {
	// contains filtered or unexported fields
}

ACLQueryCommand query acl struct

type AccountBalanceCommand

type AccountBalanceCommand struct {
	// contains filtered or unexported fields
}

AccountBalanceCommand account balance command

type AccountCommand

type AccountCommand struct {
	// contains filtered or unexported fields
}

AccountCommand account cmd entrance

type AccountContractsCommand

type AccountContractsCommand struct {
	// contains filtered or unexported fields
}

AccountContractsCommand

type AccountDecryptCommand

type AccountDecryptCommand struct {
	// contains filtered or unexported fields
}

AccountDecryptCommand decrypt account struct

type AccountNewCommand

type AccountNewCommand struct {
	// contains filtered or unexported fields
}

AccountNewCommand new account struct

type AccountNewkeysCommand

type AccountNewkeysCommand struct {
	// contains filtered or unexported fields
}

AccountNewkeysCommand create account addr

type AccountQueryCommand

type AccountQueryCommand struct {
	// contains filtered or unexported fields
}

AccountQueryCommand query acl struct

type AccountRestoreCommand

type AccountRestoreCommand struct {
	// contains filtered or unexported fields
}

AccountRestoreCommand restore account by mnemonic

type BigInt

type BigInt big.Int

BigInt big int

func FromAmountBytes

func FromAmountBytes(buf []byte) BigInt

FromAmountBytes transfer bytes to bigint

func (*BigInt) MarshalJSON

func (b *BigInt) MarshalJSON() ([]byte, error)

MarshalJSON json.marshal

type BlockCommand

type BlockCommand struct {
	// contains filtered or unexported fields
}

BlockCommand query block

type ChainStatus

type ChainStatus struct {
	Name       string     `json:"name"`
	LedgerMeta LedgerMeta `json:"ledger"`
	UtxoMeta   UtxoMeta   `json:"utxo"`
	// add BranchBlockid
	BranchBlockid []string `json:"branchBlockid"`
}

ChainStatus proto.ChainStatus

type Cli

type Cli struct {
	RootOptions RootOptions
	CliConf     *CliConfig
	// contains filtered or unexported fields
}

Cli 是所有子命令执行的上下文.

func NewCli

func NewCli() *Cli

NewCli new cli cmd

func (*Cli) AddCommands

func (c *Cli) AddCommands(cmds []CommandFunc)

AddCommands add sub commands

func (*Cli) EventClient

func (c *Cli) EventClient() pb.EventServiceClient

EventClient get EventService client

func (*Cli) Execute

func (c *Cli) Execute()

Execute exe cmd

func (*Cli) GetNodes

func (c *Cli) GetNodes(ctx context.Context) ([]string, error)

GetNodes get all nodes

func (*Cli) Init

func (c *Cli) Init() error

Init cmd init entrance

func (*Cli) RangeNodes

func (c *Cli) RangeNodes(ctx context.Context, f func(addr string, client pb.XchainClient, err error) error) error

RangeNodes exe func in all nodes

func (*Cli) SetVer

func (c *Cli) SetVer(ver string)

func (*Cli) Transfer

func (c *Cli) Transfer(ctx context.Context, opt *TransferOptions) (string, error)

Transfer transfer cli entrance

func (*Cli) XchainClient

func (c *Cli) XchainClient() pb.XchainClient

XchainClient get xchain client

type CliConfig

type CliConfig struct {
	Host               string                `yaml:"host,omitempty"`
	Name               string                `yaml:"name,omitempty"`
	Keys               string                `yaml:"keys,omitempty"`
	Crypto             string                `yaml:"crypto,omitempty"`
	TLS                TLSOptions            `yaml:"tls,omitempty"`
	EndorseServiceHost string                `yaml:"endorseServiceHost,omitempty"`
	ComplianceCheck    ComplianceCheckConfig `yaml:"complianceCheck,omitempty"`
	MinNewChainAmount  string                `yaml:"minNewChainAmount,omitempty"`
}

func NewCliConfig

func NewCliConfig() *CliConfig

NewNodeConfig new a NodeConfig instance

func (*CliConfig) LoadConfig

func (nc *CliConfig) LoadConfig(fileName string) error

LoadConfig load Node Config from the specific path/file

type CommTrans

type CommTrans struct {
	To           string
	Amount       string
	Descfile     string
	Fee          string
	FrozenHeight int64
	Version      int32
	From         string
	ModuleName   string
	ContractName string
	MethodName   string
	Args         map[string][]byte
	// 走mulitisig gen流程
	MultiAddrs string
	Output     string
	IsQuick    bool
	IsPrint    bool

	ChainName    string
	Keys         string
	XchainClient pb.XchainClient
	CryptoType   string

	// DebugTx if enabled, tx will be printed instead of being posted
	DebugTx bool
	CliConf *CliConfig
}

CommTrans base method a. generate tx b. sign it for default single and send it

func (*CommTrans) ComplianceCheck

func (c *CommTrans) ComplianceCheck(tx *pb.Transaction, fee *pb.Transaction) (
	*pb.SignatureInfo, error)

func (*CommTrans) GenAuthRequire

func (c *CommTrans) GenAuthRequire(filename string) ([]string, error)

GenAuthRequire get auth require aks from file

func (*CommTrans) GenCompleteTxAndPost

func (c *CommTrans) GenCompleteTxAndPost(ctx context.Context, preExeResp *pb.PreExecWithSelectUTXOResponse) error

func (*CommTrans) GenComplianceCheckTx

func (c *CommTrans) GenComplianceCheckTx(utxoOutput *pb.UtxoOutput) (*pb.Transaction, error)

func (*CommTrans) GenPreExeRes

func (c *CommTrans) GenPreExeRes(ctx context.Context) (
	*pb.InvokeRPCResponse, []*pb.InvokeRequest, error)

GenPreExeRes 得到预执行的结果

func (*CommTrans) GenPreExeWithSelectUtxoRes

func (c *CommTrans) GenPreExeWithSelectUtxoRes(ctx context.Context) (
	*pb.PreExecWithSelectUTXOResponse, error)

func (*CommTrans) GenRawTx

func (c *CommTrans) GenRawTx(ctx context.Context, desc []byte, preExeRes *pb.InvokeResponse,
	preExeReqs []*pb.InvokeRequest) (*pb.Transaction, error)

GenRawTx 生成一个完整raw的交易

func (*CommTrans) GenRealTx

func (c *CommTrans) GenRealTx(response *pb.PreExecWithSelectUTXOResponse,
	complianceCheckTx *pb.Transaction) (*pb.Transaction, error)

func (*CommTrans) GenTxFile

func (c *CommTrans) GenTxFile(tx *pb.Transaction) error

GenTxFile generate raw tx file

func (*CommTrans) GenTxInputs

func (c *CommTrans) GenTxInputs(ctx context.Context, totalNeed *big.Int) (
	[]*pb.TxInput, *pb.TxOutput, error)

GenTxInputs 填充得到transaction的repeated TxInput tx_inputs, 如果输入大于输出,增加一个转给自己(data/keys/)的输入-输出的交易

func (*CommTrans) GenTxInputsWithMergeUTXO

func (c *CommTrans) GenTxInputsWithMergeUTXO(ctx context.Context) ([]*pb.TxInput, *pb.TxOutput, error)

GenTxInputsWithMergeUTXO generate tx with merge utxo

func (*CommTrans) GenTxOutputs

func (c *CommTrans) GenTxOutputs(gasUsed int64) ([]*pb.TxOutput, *big.Int, error)

GenTxOutputs 填充得到transaction的repeated TxOutput tx_outputs

func (*CommTrans) GenerateMultiTxOutputs

func (c *CommTrans) GenerateMultiTxOutputs(selfAmount string, gasUsed string) ([]*pb.TxOutput, error)

func (*CommTrans) GenerateMultisigGenRawTx

func (c *CommTrans) GenerateMultisigGenRawTx(ctx context.Context) error

GenerateMultisigGenRawTx for mulitisig gen cmd

func (*CommTrans) GeneratePureTxInputs

func (c *CommTrans) GeneratePureTxInputs(utxoOutputs *pb.UtxoOutput) (
	[]*pb.TxInput, error)

func (*CommTrans) GenerateTx

func (c *CommTrans) GenerateTx(ctx context.Context) (*pb.Transaction, error)

GenerateTx generate raw tx

func (*CommTrans) GenerateTxInput

func (c *CommTrans) GenerateTxInput(utxoOutputs *pb.UtxoOutput, totalNeed *big.Int) (
	[]*pb.TxInput, *pb.TxOutput, error)

func (*CommTrans) GenerateTxOutput

func (xc *CommTrans) GenerateTxOutput(to, amount, fee string) ([]*pb.TxOutput, error)

func (*CommTrans) GetDesc

func (c *CommTrans) GetDesc() ([]byte, error)

GetDesc 解析desc字段,主要是针对合约

func (*CommTrans) GetInvokeRequestFromDesc

func (c *CommTrans) GetInvokeRequestFromDesc() (*pb.InvokeRequest, error)

GetInvokeRequestFromDesc get invokerequest from desc file

func (*CommTrans) ReadPreExeReq

func (c *CommTrans) ReadPreExeReq(buf []byte) (*pb.InvokeRequest, error)

ReadPreExeReq 从desc中填充出发起合约调用的结构体

func (*CommTrans) SendTx

func (c *CommTrans) SendTx(ctx context.Context, tx *pb.Transaction) error

SendTx post tx

func (*CommTrans) Transfer

func (c *CommTrans) Transfer(ctx context.Context) error

Transfer quick access to transfer

type CommandFunc

type CommandFunc func(c *Cli) *cobra.Command

CommandFunc 代表了一个子命令,用于往Cli注册子命令

type ComplianceCheckConfig

type ComplianceCheckConfig struct {
	IsNeedComplianceCheck             bool   `yaml:"isNeedComplianceCheck,omitempty"`
	IsNeedComplianceCheckFee          bool   `yaml:"isNeedComplianceCheckFee,omitempty"`
	ComplianceCheckEndorseServiceFee  int    `yaml:"complianceCheckEndorseServiceFee,omitempty"`
	ComplianceCheckEndorseFeeAddr     string `yaml:"complianceCheckEndorseFeeAddr,omitempty"`
	ComplianceCheckEndorseServiceAddr string `yaml:"complianceCheckEndorseServiceAddr,omitempty"`
}

ComplianceCheckConfig: config of xendorser service control IsNeedComplianceCheck: is need compliance check IsNeedComplianceCheckFee: is need pay for compliance check ComplianceCheckEndorseServiceFee: fee for compliance check ComplianceCheckEndorseServiceAddr: compliance check addr

type ConsensusCommand

type ConsensusCommand struct {
	// contains filtered or unexported fields
}

AccountCommand account cmd entrance

type ConsensusInvokeCommand

type ConsensusInvokeCommand struct {
	// contains filtered or unexported fields
}

type ConsensusStatusCommand

type ConsensusStatusCommand struct {
	// contains filtered or unexported fields
}

type ContractCommand

type ContractCommand struct {
}

ContractCommand contract cmd

type ContractDeployCommand

type ContractDeployCommand struct {
	// contains filtered or unexported fields
}

ContractDeployCommand wasm/native/evm deploy cmd

type ContractDesc

type ContractDesc struct {
	Module  string      `json:"module"`
	Method  string      `json:"method"`
	Args    interface{} `json:"args"`
	Trigger TriggerDesc `json:"trigger"`
}

ContractDesc proto.ContractDesc

type ContractEvent

type ContractEvent struct {
	Contract string `json:"contract,omitempty"`
	Name     string `json:"name,omitempty"`
	Body     string `json:"body,omitempty"`
}

ContractEvent pb.ContractEvent

type ContractInvokeCommand

type ContractInvokeCommand struct {
	// contains filtered or unexported fields
}

ContractInvokeCommand wasm/native/evm invoke cmd

type ContractQueryCommand

type ContractQueryCommand struct {
	// contains filtered or unexported fields
}

ContractQueryCommand wasm/native/evm query cmd

type ContractStatData

type ContractStatData struct {
	AccountCount  int64 `json:"accountCount"`
	ContractCount int64 `json:"contractCount"`
}

ContractStatData proto.ContractStatData

type ContractStatDataQueryCommand

type ContractStatDataQueryCommand struct {
	// contains filtered or unexported fields
}

ContractStatDataQueryCommand contract statistic data query cmd

type ContractUpgradeCommand

type ContractUpgradeCommand struct {
	// contains filtered or unexported fields
}

ContractUpgradeCommand wasm upgrade cmd

type CreateChainCommand

type CreateChainCommand struct {

	// 创世块配置文件
	GenesisConf string
	// 环境配置文件
	EnvConf string
	// contains filtered or unexported fields
}

CreateChainCommand create chain cmd

type EVMAddrTransCommand

type EVMAddrTransCommand struct {
	// contains filtered or unexported fields
}

EVMAddrTransCommand address translation between EVM and xchain

type EvmCommand

type EvmCommand struct {
}

EvmCommand evm cmd struct

type FilteredBlock

type FilteredBlock struct {
	Bcname      string                 `json:"bcname,omitempty"`
	Blockid     string                 `json:"blockid,omitempty"`
	BlockHeight int64                  `json:"block_height,omitempty"`
	Txs         []*FilteredTransaction `json:"txs,omitempty"`
}

FilteredBlock pb.FilteredBlock

func FromFilteredBlockPB

func FromFilteredBlockPB(pbblock *pb.FilteredBlock) *FilteredBlock

FromFilteredBlockPB convert pb.FilteredBlock to FilteredBlock

type FilteredTransaction

type FilteredTransaction struct {
	Txid   string           `json:"txid,omitempty"`
	Events []*ContractEvent `json:"events,omitempty"`
}

FilteredTransaction pb.FilteredTransaction

type GasPrice

type GasPrice struct {
	CpuRate  int64 `json:"cpu_rate"`
	MemRate  int64 `json:"mem_rate"`
	DiskRate int64 `json:"disk_rate"`
	XfeeRate int64 `json:"xfee_rate"`
}

GasPrice proto.GasPrice

type GetComplianceCheckSignCommand

type GetComplianceCheckSignCommand struct {
	// contains filtered or unexported fields
}

func (*GetComplianceCheckSignCommand) XEndorserClient

func (c *GetComplianceCheckSignCommand) XEndorserClient() pb.XendorserClient

type GovernInitCommand

type GovernInitCommand struct {
	// contains filtered or unexported fields
}

GovernInitCommand transfer govern token struct

type GovernTokenCommand

type GovernTokenCommand struct {
	// contains filtered or unexported fields
}

GovernTokenCommand govern token cmd entrance

type GovernTokenQueryCommand

type GovernTokenQueryCommand struct {
	// contains filtered or unexported fields
}

GovernTokenQueryCommand govern token query cmd

type GovernTransferCommand

type GovernTransferCommand struct {
	// contains filtered or unexported fields
}

GovernTransferCommand transfer govern token struct

type HexID

type HexID []byte

HexID bytes

func (HexID) MarshalJSON

func (h HexID) MarshalJSON() ([]byte, error)

MarshalJSON json marshal

type InternalBlock

type InternalBlock struct {
	Version      int32             `json:"version"`
	Blockid      HexID             `json:"blockid"`
	PreHash      HexID             `json:"preHash"`
	Proposer     string            `json:"proposer"`
	Sign         HexID             `json:"sign"`
	Pubkey       string            `json:"pubkey"`
	MerkleRoot   HexID             `json:"merkleRoot"`
	Height       int64             `json:"height"`
	Timestamp    int64             `json:"timestamp"`
	Transactions []*Transaction    `json:"transactions"`
	TxCount      int32             `json:"txCount"`
	MerkleTree   []HexID           `json:"merkleTree"`
	InTrunk      bool              `json:"inTrunk"`
	NextHash     HexID             `json:"nextHash"`
	FailedTxs    map[string]string `json:"failedTxs"`
	CurTerm      int64             `json:"curTerm"`
	CurBlockNum  int64             `json:"curBlockNum"`
	Justify      *QuorumCert       `json:"justify"`
}

InternalBlock proto.InternalBlock

func FromInternalBlockPB

func FromInternalBlockPB(block *pb.InternalBlock) *InternalBlock

FromInternalBlockPB block info

type InvokeRequest

type InvokeRequest struct {
	ModuleName    string            `json:"moduleName"`
	ContractName  string            `json:"contractName"`
	MethodName    string            `json:"methodName"`
	Args          map[string]string `json:"args"`
	ResouceLimits []ResourceLimit   `json:"resource_limits"`
}

InvokeRequest proto.InvokeRequest

type LedgerMeta

type LedgerMeta struct {
	// RootBlockid root block id
	RootBlockid HexID `json:"rootBlockid"`
	// TipBlockid TipBlockid
	TipBlockid HexID `json:"tipBlockid"`
	// TrunkHeight TrunkHeight
	TrunkHeight int64 `json:"trunkHeight"`
}

LedgerMeta proto.LedgerMeta

type ListUtxoCommand

type ListUtxoCommand struct {
	// contains filtered or unexported fields
}

ListUtxoCommand necessary parmeters for query utxo records

type MergeUtxoCommand

type MergeUtxoCommand struct {
	// contains filtered or unexported fields
}

MergeUtxoCommand necessary parameter for merge utxo

type ModifyBlock

type ModifyBlock struct {
	Marked          bool   `json:"marked"`
	EffectiveHeight int64  `json:"effectiveHeight"`
	EffectiveTxid   string `json:"effectiveTxid"`
}

type MultisigCheckCommand

type MultisigCheckCommand struct {
	// contains filtered or unexported fields
}

MultisigCheckCommand multisig check struct

type MultisigCommand

type MultisigCommand struct {
}

MultisigCommand Multisig set command

type MultisigData

type MultisigData struct {
	R       []byte   // common random value
	C       []byte   // common public key
	KList   [][]byte // random value list
	PubKeys [][]byte // all public keys
}

MultisigData generated multisig data

type MultisigGenCommand

type MultisigGenCommand struct {
	// contains filtered or unexported fields
}

MultisigGenCommand multisig generate struct

type MultisigSendCommand

type MultisigSendCommand struct {
	// contains filtered or unexported fields
}

MultisigSendCommand multisig send struct

type MultisigSignCommand

type MultisigSignCommand struct {
	// contains filtered or unexported fields
}

MultisigSignCommand multisig sign struct

type NativeCommand

type NativeCommand struct {
}

NativeCommand native cmd struct

type NetURLCommand

type NetURLCommand struct {
}

NetURLCommand neturl cmd

type NetURLConvertCommand

type NetURLConvertCommand struct {
	// contains filtered or unexported fields
}

NetURLConvertCommand neturl gen cmd

type NetURLGenCommand

type NetURLGenCommand struct {
	// contains filtered or unexported fields
}

NetURLGenCommand neturl gen cmd

type NetURLGetCommand

type NetURLGetCommand struct {
	// contains filtered or unexported fields
}

NetURLGetCommand get neturl cmd

type NetURLPreviewCommand

type NetURLPreviewCommand struct {
	// contains filtered or unexported fields
}

NetURLPreviewCommand preview neturl using given params

type PartialSign

type PartialSign struct {
	Si    []byte
	Index int
}

PartialSign partial sign is single Si sign for multisig

type ProposalCommand

type ProposalCommand struct {
	// contains filtered or unexported fields
}

ProposalCommand proposal cmd entrance

type ProposalProposeCommand

type ProposalProposeCommand struct {
	// contains filtered or unexported fields
}

ProposalProposeCommand proposal a proposal struct

type ProposalQueryCommand

type ProposalQueryCommand struct {
	// contains filtered or unexported fields
}

ProposalQueryCommand proposal query cmd

type ProposalThawCommand

type ProposalThawCommand struct {
	// contains filtered or unexported fields
}

ProposalThawCommand thaw a proposal struct

type ProposalVoteCommand

type ProposalVoteCommand struct {
	// contains filtered or unexported fields
}

ProposalVoteCommand vote a proposal struct

type QCSignInfos

type QCSignInfos struct {
	// QCSignInfos
	QCSignInfos []*SignInfo `protobuf:"bytes,1,rep,name=QCSignInfos,proto3" json:"QCSignInfos,omitempty"`
}

QCSignInfos is the signs of the leader gathered from replicas of a specifically certType. A slice of signs is used at present. TODO @qizheng09: It will be change to Threshold-Signatures after Crypto lib support Threshold-Signatures.

type QCState

type QCState int32

QCState is the phase of hotstuff

const (
	QCState_NEW_VIEW   QCState = 0
	QCState_PREPARE    QCState = 1
	QCState_PRE_COMMIT QCState = 2
	QCState_COMMIT     QCState = 3
	QCState_DECIDE     QCState = 4
)

QCState defination

type QueryCandidatesCommand

type QueryCandidatesCommand struct {
	// contains filtered or unexported fields
}

QueryCandidatesCommand query candidates cmd

type QueryCheckResultCommand

type QueryCheckResultCommand struct {
	// contains filtered or unexported fields
}

QueryCheckResultCommand query res

type QueryNominateRecordsCommand

type QueryNominateRecordsCommand struct {
	// contains filtered or unexported fields
}

QueryNominateRecordsCommand query Nominate cmd

type QueryNomineeRecordsCommand

type QueryNomineeRecordsCommand struct {
	// contains filtered or unexported fields
}

QueryNomineeRecordsCommand query nominee records

type QueryStatusCommand

type QueryStatusCommand struct {
	// contains filtered or unexported fields
}

QueryStatusCommand query vote records

type QueryVoteRecordsCommand

type QueryVoteRecordsCommand struct {
	// contains filtered or unexported fields
}

QueryVoteRecordsCommand query vote records

type QueryVotedRecordsCommand

type QueryVotedRecordsCommand struct {
	// contains filtered or unexported fields
}

QueryVotedRecordsCommand query votedrecords cmd

type QuorumCert

type QuorumCert struct {
	// The id of Proposal this QC certified.
	ProposalId string `protobuf:"bytes,1,opt,name=ProposalId,proto3" json:"ProposalId,omitempty"`
	// The msg of Proposal this QC certified.
	ProposalMsg []byte `protobuf:"bytes,2,opt,name=ProposalMsg,proto3" json:"ProposalMsg,omitempty"`
	// The current type of this QC certified.
	// the type contains `NEW_VIEW`, `PREPARE`
	Type QCState `protobuf:"varint,3,opt,name=Type,proto3,enum=pb.QCState" json:"Type,omitempty"`
	// The view number of this QC certified.
	ViewNumber int64 `protobuf:"varint,4,opt,name=ViewNumber,proto3" json:"ViewNumber,omitempty"`
	// SignInfos is the signs of the leader gathered from replicas
	// of a specifically certType.
	SignInfos *QCSignInfos `protobuf:"bytes,5,opt,name=SignInfos,proto3" json:"SignInfos,omitempty"`
}

QuorumCert is a data type that combines a collection of signatures from replicas.

func FromPBJustify

func FromPBJustify(qc *pb.QuorumCert) *QuorumCert

FromPBJustify use pb.QuorumCert to construct local QuorumCert in block

type ResourceLimit

type ResourceLimit struct {
	Type  string `json:"type"`
	Limit int64  `json:"limit"`
}

type RootOptions

type RootOptions struct {
	Host   string
	Name   string
	Keys   string
	Crypto string
	Config string
}

RootOptions 代表全局通用的flag,可以以嵌套结构体的方式组织flags.

type SignInfo

type SignInfo struct {
	Address   string `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
	PublicKey string `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"`
	Sign      []byte `protobuf:"bytes,3,opt,name=Sign,proto3" json:"Sign,omitempty"`
}

SignInfo is the signature information of the

type SignatureInfo

type SignatureInfo struct {
	PublicKey string `json:"publickey"`
	Sign      HexID  `json:"sign"`
}

SignatureInfo proto.SignatureInfo

type SplitUtxoCommand

type SplitUtxoCommand struct {
	// contains filtered or unexported fields
}

SplitUtxoCommand split utxo of ak or account

type StatusCommand

type StatusCommand struct {
	// contains filtered or unexported fields
}

StatusCommand status cmd

type SystemStatus

type SystemStatus struct {
	ChainStatus []ChainStatus `json:"blockchains"`
	Peers       []string      `json:"peers"`
	Speeds      *pb.Speeds    `json:"speeds"`
}

SystemStatus proto.SystemStatus

func FromSystemStatusPB

func FromSystemStatusPB(statuspb *pb.SystemsStatus) *SystemStatus

FromSystemStatusPB systemstatus info

type TDposCommand

type TDposCommand struct {
}

TDposCommand tdpos cmd

type TLSOptions

type TLSOptions struct {
	Cert   string `yaml:"cert,omitempty"`
	Server string `yaml:"server,omitempty"`
	Enable bool   `yaml:"enable,omitempty"`
}

TLSOptions TLS part

type Transaction

type Transaction struct {
	Txid              HexID            `json:"txid"`
	Blockid           HexID            `json:"blockid"`
	TxInputs          []TxInput        `json:"txInputs"`
	TxOutputs         []TxOutput       `json:"txOutputs"`
	Desc              string           `json:"desc"`
	Nonce             string           `json:"nonce"`
	Timestamp         int64            `json:"timestamp"`
	Version           int32            `json:"version"`
	Autogen           bool             `json:"autogen"`
	Coinbase          bool             `json:"coinbase"`
	TxInputsExt       []TxInputExt     `json:"txInputsExt"`
	TxOutputsExt      []TxOutputExt    `json:"txOutputsExt"`
	ContractRequests  []*InvokeRequest `json:"contractRequests"`
	Initiator         string           `json:"initiator"`
	AuthRequire       []string         `json:"authRequire"`
	InitiatorSigns    []SignatureInfo  `json:"initiatorSigns"`
	AuthRequireSigns  []SignatureInfo  `json:"authRequireSigns"`
	ReceivedTimestamp int64            `json:"receivedTimestamp"`
	ModifyBlock       ModifyBlock      `json:"modifyBlock"`
}

Transaction proto.Transaction

func FromPBTx

func FromPBTx(tx *pb.Transaction) *Transaction

FromPBTx get tx

type TransferCommand

type TransferCommand struct {
	// contains filtered or unexported fields
}

TransferCommand transfer cmd

type TransferOptions

type TransferOptions struct {
	BlockchainName string
	KeyPath        string
	CryptoType     string
	To             string
	Amount         string
	Fee            string
	Desc           []byte
	FrozenHeight   int64
	Version        int32
	// 支持账户转账
	From        string
	AccountPath string
	Debug       bool
}

TransferOptions transfer cmd options

type TriggerDesc

type TriggerDesc struct {
	Module string      `json:"module"`
	Method string      `json:"method"`
	Args   interface{} `json:"args"`
	Height int64       `json:"height"`
}

TriggerDesc proto.TriggerDesc

type TxCommand

type TxCommand struct {
}

TxCommand tx cmd

type TxInput

type TxInput struct {
	RefTxid   HexID  `json:"refTxid"`
	RefOffset int32  `json:"refOffset"`
	FromAddr  string `json:"fromAddr"`
	Amount    BigInt `json:"amount"`
}

TxInput proto.TxInput

type TxInputExt

type TxInputExt struct {
	Bucket    string `json:"bucket"`
	Key       string `json:"key"`
	RefTxid   HexID  `json:"refTxid"`
	RefOffset int32  `json:"refOffset"`
}

TxInputExt proto.TxInputExt

type TxOutput

type TxOutput struct {
	Amount BigInt `json:"amount"`
	ToAddr string `json:"toAddr"`
}

TxOutput proto.TxOutput

type TxOutputExt

type TxOutputExt struct {
	Bucket string `json:"bucket"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

TxOutputExt proto.TxOutputExt

type TxQueryCommand

type TxQueryCommand struct {
	// contains filtered or unexported fields
}

TxQueryCommand tx query cmd

type UtxoCommand

type UtxoCommand struct {
	// contains filtered or unexported fields
}

UtxoCommand utxo cmd entry

type UtxoMeta

type UtxoMeta struct {
	// LatestBlockid LatestBlockid
	LatestBlockid HexID `json:"latestBlockid"`
	// LockKeyList LockKeyList
	LockKeyList []string `json:"lockKeyList"`
	// UtxoTotal UtxoTotal
	UtxoTotal string `json:"utxoTotal"`
	// Average confirmed dealy (ms)
	AvgDelay int64 `json:"avgDelay"`
	// Current unconfirmed tx amount
	UnconfirmTxAmount int64 `json:"unconfirmed"`
	// MaxBlockSize MaxBlockSize
	MaxBlockSize int64 `json:"maxBlockSize"`
	// ReservedContracts ReservedContracts
	ReservedContracts []InvokeRequest `json:"reservedContracts"`
	// ForbiddenContract forbidden contract
	ForbiddenContract InvokeRequest `json:"forbiddenContract"`
	// NewAccountResourceAmount resource amount of creating an account
	NewAccountResourceAmount int64 `json:"newAccountResourceAmount"`
	// IrreversibleBlockHeight irreversible block height
	IrreversibleBlockHeight int64 `json:"irreversibleBlockHeight"`
	// IrreversibleSlideWindow irreversible slide window
	IrreversibleSlideWindow int64 `json:"irreversibleSlideWindow"`
	// GasPrice gas rate to utxo for different type resources
	GasPrice GasPrice `json:"gasPrice"`
}

UtxoMeta proto.UtxoMeta

type VoteCommand

type VoteCommand struct {
	// contains filtered or unexported fields
}

VoteCommand vote cmd

type WasmCommand

type WasmCommand struct {
}

WasmCommand wasm cmd

Jump to

Keyboard shortcuts

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