Documentation
¶
Index ¶
- func StartServer(option *Option, pmHandler pmHandler)
- type Account
- type AccountInterface
- type AccountNewArgs
- type Block
- type BroadcastReply
- type ContractQueryArgs
- type GetTxsByBlockHashArgs
- type GetTxsByBlockNumberArgs
- type HttpConn
- type IBroadcast
- type INetWorkInfo
- type Ledger
- func (l *Ledger) DeserializeTx(hexString string, reply *types.Transaction) error
- func (l *Ledger) GetBalance(addr string, reply *state.Balance) error
- func (l *Ledger) GetBlockByHash(blockHashBytes string, reply *Block) error
- func (l *Ledger) GetBlockByNumber(number uint32, reply *Block) error
- func (l *Ledger) GetBlockHashByNumber(blockNumber uint32, reply *crypto.Hash) error
- func (l *Ledger) GetLastBlockHash(ignore string, reply *crypto.Hash) error
- func (l *Ledger) GetTxByHash(txHashBytes string, reply *types.Transaction) error
- func (l *Ledger) GetTxsByBlockHash(args GetTxsByBlockHashArgs, reply *types.Transactions) error
- func (l *Ledger) GetTxsByBlockNumber(args GetTxsByBlockNumberArgs, reply *types.Transactions) error
- func (l *Ledger) GetTxsByMergeTxHash(mergeTxHash string, reply *types.Transactions) error
- func (l *Ledger) Height(ignore string, reply *uint32) error
- type LedgerInterface
- type Net
- type Option
- type PayLoad
- type SignTxArgs
- type Transaction
- type TransactionCreateArgs
- type ViewFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartServer ¶
func StartServer(option *Option, pmHandler pmHandler)
StartServer with Test instance as a service
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
account
func NewAccount ¶
func NewAccount(ai AccountInterface) *Account
type AccountInterface ¶
type AccountInterface interface { NewAccount(passphrase string, accountType uint32) (accounts.Account, error) Accounts() ([]string, error) HasAddress(addr accounts.Address) bool Find(addr accounts.Address) *accounts.Account SignTx(a accounts.Account, tx *types.Transaction, pass string) (*types.Transaction, error) }
type AccountNewArgs ¶
type Block ¶
type Block struct { BlockHeader *types.BlockHeader `json:"header"` TxHashList []crypto.Hash `json:"txHashList"` }
Block json rpc return block
type BroadcastReply ¶
type ContractQueryArgs ¶
type GetTxsByBlockHashArgs ¶
GetTxsByBlockHashArgs get txs by block hash args
type GetTxsByBlockNumberArgs ¶
GetTxsByBlockNumberArgs get txs by block number args
type IBroadcast ¶
type IBroadcast interface { Relay(inv types.IInventory) QueryContract(tx *types.Transaction) ([]byte, error) }
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
Ledger ledger rpc api
func (*Ledger) DeserializeTx ¶
func (l *Ledger) DeserializeTx(hexString string, reply *types.Transaction) error
DeserializeTx deserializes transaction by transaction serialize string
func (*Ledger) GetBalance ¶
GetBalance returns balance by account address
func (*Ledger) GetBlockByHash ¶
GetBlockByHash returns the block detail by hash
func (*Ledger) GetBlockByNumber ¶
GetBlockByNumber get block by block number
func (*Ledger) GetBlockHashByNumber ¶
GetBlockHashByNumber return block hash by block number
func (*Ledger) GetLastBlockHash ¶
GetLastBlockHash returns the last Block hash
func (*Ledger) GetTxByHash ¶
func (l *Ledger) GetTxByHash(txHashBytes string, reply *types.Transaction) error
GetTxByHash returns transaction by tx hash []byte
func (*Ledger) GetTxsByBlockHash ¶
func (l *Ledger) GetTxsByBlockHash(args GetTxsByBlockHashArgs, reply *types.Transactions) error
GetTxsByBlockHash get txs by block hash
func (*Ledger) GetTxsByBlockNumber ¶
func (l *Ledger) GetTxsByBlockNumber(args GetTxsByBlockNumberArgs, reply *types.Transactions) error
GetTxsByBlockNumber get txs by block number
func (*Ledger) GetTxsByMergeTxHash ¶
func (l *Ledger) GetTxsByMergeTxHash(mergeTxHash string, reply *types.Transactions) error
GetTxsByMergeTxHash return cross chain transactions by merge transaction
type LedgerInterface ¶
type LedgerInterface interface { Height() (uint32, error) GetBalanceNonce(addr accounts.Address) (*big.Int, uint32) GetTransaction(txHash crypto.Hash) (*types.Transaction, error) GetBlockByHash(blockHashBytes []byte) (*types.BlockHeader, error) GetBlockByNumber(number uint32) (*types.BlockHeader, error) GetBlockHashByNumber(blockNum uint32) (crypto.Hash, error) GetLastBlockHash() (crypto.Hash, error) GetTxsByBlockHash(blockHashBytes []byte, transactionType uint32) (types.Transactions, error) GetTxsByBlockNumber(blockNumber uint32, transactionType uint32) (types.Transactions, error) GetTxsByMergeTxHash(mergeTxHash crypto.Hash) (types.Transactions, error) GetTransactionHashList(number uint32) ([]crypto.Hash, error) }
LedgerInterface ledger interface
type Net ¶
type Net struct {
// contains filtered or unexported fields
}
func NewNet ¶
func NewNet(netServer INetWorkInfo) *Net
type Option ¶
func NewDefaultOption ¶
func NewDefaultOption() *Option
type SignTxArgs ¶
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewTransaction ¶
func NewTransaction(pmHandler IBroadcast) *Transaction
func (*Transaction) Broadcast ¶
func (t *Transaction) Broadcast(txHex string, reply *BroadcastReply) error
func (*Transaction) Create ¶
func (t *Transaction) Create(args *TransactionCreateArgs, reply *string) error
func (*Transaction) Query ¶
func (t *Transaction) Query(args *ContractQueryArgs, reply *string) error
Query contract query