node

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MaxTxToNameLength  = 100
	MaxTxMessageLength = 1024
)

Variables

This section is empty.

Functions

func VerifyTx

func VerifyTx(tx *types.Transaction) error

VerifyTx transaction parameter verification

Types

type AssetEquityBatchRsp

type AssetEquityBatchRsp struct {
	Equities []*types.AssetEquity `json:"equities" gencodec:"required"`
	Total    uint32               `json:"total" gencodec:"required"`
}

type AssetEquityBatchRspMarshaling

type AssetEquityBatchRspMarshaling struct {
	Total hexutil.Uint32
}

type CandidateInfo

type CandidateInfo struct {
	CandidateAddress string            `json:"address" gencodec:"required"`
	Votes            string            `json:"votes" gencodec:"required"`
	Profile          map[string]string `json:"profile"  gencodec:"required"`
}

func (CandidateInfo) MarshalJSON

func (c CandidateInfo) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*CandidateInfo) UnmarshalJSON

func (c *CandidateInfo) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type CandidateListRes

type CandidateListRes struct {
	CandidateList []*CandidateInfo `json:"candidateList" gencodec:"required"`
	Total         uint32           `json:"total" gencodec:"required"`
}

func (CandidateListRes) MarshalJSON

func (c CandidateListRes) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*CandidateListRes) UnmarshalJSON

func (c *CandidateListRes) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type Node

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

func New

func New(cfg *config.Config) (*Node, error)

func (*Node) Start

func (n *Node) Start() error

func (*Node) Stop

func (n *Node) Stop() error

type PrivateAccountAPI

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

Private

func NewPrivateAccountAPI

func NewPrivateAccountAPI(node *Node) *PrivateAccountAPI

NewPrivateAccountAPI

func (*PrivateAccountAPI) NewKeyPair

func (a *PrivateAccountAPI) NewKeyPair() (*crypto.AccountKey, error)

NewAccount get lemo address api

type PublicAccountAPI

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

PublicAccountAPI API for access to account information

func NewPublicAccountAPI

func NewPublicAccountAPI(node *Node) *PublicAccountAPI

NewPublicAccountAPI

func (*PublicAccountAPI) GetAccount

func (a *PublicAccountAPI) GetAccount(LemoAddress string) (*types.AccountData, error)

GetAccount return the struct of the &AccountData{}

func (*PublicAccountAPI) GetAllRewardValue

func (a *PublicAccountAPI) GetAllRewardValue() ([]*coreParams.Reward, error)

GetAllRewardValue get the value for each bonus

func (*PublicAccountAPI) GetAsset

func (a *PublicAccountAPI) GetAsset(assetCode common.Hash) (*types.Asset, error)

func (*PublicAccountAPI) GetAssetEquity

func (a *PublicAccountAPI) GetAssetEquity(LemoAddress string, index, limit int) (*AssetEquityBatchRsp, error)

func (*PublicAccountAPI) GetAssetEquityByAssetCode

func (a *PublicAccountAPI) GetAssetEquityByAssetCode(LemoAddress string, assetCode common.Hash, index, limit int) (*AssetEquityBatchRsp, error)

func (*PublicAccountAPI) GetAssetEquityByAssetId

func (a *PublicAccountAPI) GetAssetEquityByAssetId(LemoAddress string, assetId common.Hash) (*types.AssetEquity, error)

GetAssetEquity returns asset equity

func (*PublicAccountAPI) GetBalance

func (a *PublicAccountAPI) GetBalance(LemoAddress string) (string, error)

GetBalance get balance in mo

func (*PublicAccountAPI) GetMetaData

func (a *PublicAccountAPI) GetMetaData(assetId common.Hash) (*database.MateData, error)

type PublicChainAPI

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

ChainAPI

func NewPublicChainAPI

func NewPublicChainAPI(node *Node) *PublicChainAPI

NewChainAPI API for access to chain information

func (*PublicChainAPI) ChainID

func (c *PublicChainAPI) ChainID() uint16

ChainID get chain id

func (*PublicChainAPI) CurrentBlock

func (c *PublicChainAPI) CurrentBlock(withBody bool) *types.Block

CurrentBlock get the current latest block

func (*PublicChainAPI) GasPriceAdvice

func (c *PublicChainAPI) GasPriceAdvice() *big.Int

GasPriceAdvice get suggest gas price

func (*PublicChainAPI) Genesis

func (c *PublicChainAPI) Genesis() *types.Block

Genesis get the creation block

func (*PublicChainAPI) GetBlockByHash

func (c *PublicChainAPI) GetBlockByHash(hash string, withBody bool) *types.Block

GetBlockByHash get block information by hash

func (*PublicChainAPI) GetBlockByHeight

func (c *PublicChainAPI) GetBlockByHeight(height uint32, withBody bool) *types.Block

GetBlockByNumber get block information by height

func (*PublicChainAPI) GetCandidateList

func (c *PublicChainAPI) GetCandidateList(index, size int) (*CandidateListRes, error)

// GetCandidateNodeList get all candidate node list information and return total candidate node

func (*PublicChainAPI) GetCandidateTop30

func (c *PublicChainAPI) GetCandidateTop30() []*CandidateInfo

GetCandidateTop30 get top 30 candidate node

func (*PublicChainAPI) GetDeputyNodeList

func (c *PublicChainAPI) GetDeputyNodeList() []string

GetDeputyNodeList get deputy nodes who are in charge

func (*PublicChainAPI) GetServerVersion

func (c *PublicChainAPI) GetServerVersion() string

GetServerVersion

type PublicTxAPI

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

TXAPI

func NewPublicTxAPI

func NewPublicTxAPI(node *Node) *PublicTxAPI

NewTxAPI API for send a transaction

func (*PublicTxAPI) CreateAsset

func (t *PublicTxAPI) CreateAsset(prv string, category, decimals uint32, isReplenishable, isDivisible bool) (common.Hash, error)

CreateAsset 创建资产

func (*PublicTxAPI) GetTxByHash

func (t *PublicTxAPI) GetTxByHash(hash string) (*store.VTransactionDetail, error)

// GetTxByHash pull the specified transaction through a transaction hash

func (*PublicTxAPI) GetTxListByAddress

func (t *PublicTxAPI) GetTxListByAddress(lemoAddress string, index int, size int) (*TxListRes, error)

// GetTxListByAddress pull the list of transactions

func (*PublicTxAPI) GetTxListByTimestamp

func (t *PublicTxAPI) GetTxListByTimestamp(lemoAddress string, beginTime int64, endTime int64, index int, size int) (*TxListRes, error)

func (*PublicTxAPI) IssueAsset

func (t *PublicTxAPI) IssueAsset(prv string, receiver common.Address, assetCode common.Hash, amount *big.Int, metaData string) (common.Hash, error)

发行资产

func (*PublicTxAPI) ModifyAsset

func (t *PublicTxAPI) ModifyAsset(prv string, assetCode common.Hash) (common.Hash, error)

ModifyAsset 修改资产信息

func (*PublicTxAPI) ReplenishAsset

func (t *PublicTxAPI) ReplenishAsset(prv string, receiver common.Address, assetCode, assetId common.Hash, amount *big.Int) (common.Hash, error)

增发资产

func (*PublicTxAPI) SendReimbursedGasTx

func (t *PublicTxAPI) SendReimbursedGasTx(senderPrivate, gasPayerPrivate string, to, gasPayer common.Address, amount int64, data []byte, txType uint16, toName, message string) (common.Hash, error)

SendReimbursedGasTx gas代付交易 todo 测试使用

func (*PublicTxAPI) SendTx

func (t *PublicTxAPI) SendTx(tx *types.Transaction) (common.Hash, error)

Send send a transaction

func (*PublicTxAPI) TradingAsset

func (t *PublicTxAPI) TradingAsset(prv string, to common.Address, assetCode, assetId common.Hash, amount *big.Int, input []byte) (common.Hash, error)

交易资产

type TxListRes

type TxListRes struct {
	VTransactions []*store.VTransaction `json:"txList" gencodec:"required"`
	Total         uint32                `json:"total" gencodec:"required"`
}

Jump to

Keyboard shortcuts

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