Versions in this module Expand all Collapse all v0 v0.8.8 Aug 8, 2017 Changes in this version + func StartServer(option *Option, pmHandler pmHandler) + type Account struct + func NewAccount(ai AccountInterface) *Account + func (a *Account) Exist(addr string, reply *bool) error + func (a *Account) List(param uint8, reply *[]string) error + func (a *Account) New(args *AccountNewArgs, reply *accounts.Address) error + func (a *Account) Sign(args *SignTxArgs, reply *string) error + type AccountInterface interface + Accounts func() ([]string, error) + Find func(addr accounts.Address) *accounts.Account + HasAddress func(addr accounts.Address) bool + NewAccount func(passphrase string, accountType uint32) (accounts.Account, error) + SignTx func(a accounts.Account, tx *types.Transaction, pass string) (*types.Transaction, error) + type AccountNewArgs struct + AccountType uint32 + Passphrase string + type Block struct + BlockHeader *types.BlockHeader + TxHashList []crypto.Hash + type BroadcastReply struct + ContractAddr *string + TransactionHash crypto.Hash + type ContractQueryArgs struct + ContractAddr string + ContractParams []string + type GetTxsByBlockHashArgs struct + BlockHash string + TxType uint32 + type GetTxsByBlockNumberArgs struct + BlockNumber uint32 + TxType uint32 + type HttpConn struct + func (c *HttpConn) Close() error + func (c *HttpConn) Read(p []byte) (n int, err error) + func (c *HttpConn) Write(d []byte) (n int, err error) + type IBroadcast interface + QueryContract func(tx *types.Transaction) ([]byte, error) + Relay func(inv types.IInventory) + type INetWorkInfo interface + GetLocalPeer func() *p2p.Peer + GetPeers func() []*p2p.Peer + type Ledger struct + func NewLedger(legderInterface LedgerInterface) *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 interface + GetBalanceNonce func(addr accounts.Address) (*big.Int, uint32) + GetBlockByHash func(blockHashBytes []byte) (*types.BlockHeader, error) + GetBlockByNumber func(number uint32) (*types.BlockHeader, error) + GetBlockHashByNumber func(blockNum uint32) (crypto.Hash, error) + GetLastBlockHash func() (crypto.Hash, error) + GetTransaction func(txHash crypto.Hash) (*types.Transaction, error) + GetTransactionHashList func(number uint32) ([]crypto.Hash, error) + GetTxsByBlockHash func(blockHashBytes []byte, transactionType uint32) (types.Transactions, error) + GetTxsByBlockNumber func(blockNumber uint32, transactionType uint32) (types.Transactions, error) + GetTxsByMergeTxHash func(mergeTxHash crypto.Hash) (types.Transactions, error) + Height func() (uint32, error) + type Net struct + func NewNet(netServer INetWorkInfo) *Net + func (n *Net) GetLocalPeer(req string, reply *string) error + func (n *Net) GetPeers(req string, reply *[]string) error + type Option struct + Enabled bool + PassWord string + Port string + User string + func NewDefaultOption() *Option + type PayLoad struct + ContractAddr string + ContractCode string + ContractParams []string + type SignTxArgs struct + Addr string + OriginTx string + Pass string + type Transaction struct + func NewTransaction(pmHandler IBroadcast) *Transaction + func (t *Transaction) Broadcast(txHex string, reply *BroadcastReply) error + func (t *Transaction) Create(args *TransactionCreateArgs, reply *string) error + func (t *Transaction) Query(args *ContractQueryArgs, reply *string) error + type TransactionCreateArgs struct + Amount int64 + Fee int64 + FromChain string + Nonce uint32 + PayLoad interface{} + Recipient string + ToChain string + TxType uint32 + type ViewFunc func(http.ResponseWriter, *http.Request) + func BasicAuth(f ViewFunc, user, passwd string) ViewFunc