Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
NewService instantiates a new Service layer for customer
Types ¶
type Block ¶
type Block struct { ID string `json:"id,omitempty"` Height int32 `json:"height,omitempty"` Version int32 `json:"version,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` Bits uint32 `json:"bits,omitempty"` Nonce uint32 `json:"nonce,omitempty"` MerkleRoot string `json:"merkle_root,omitempty"` Transactions []string `json:"transactions,omitempty"` TxCount int `json:"tx_count,omitempty"` Size int `json:"size,omitempty"` Weight int `json:"weight,omitempty"` Previousblockhash string `json:"previousblockhash,omitempty"` }
Block model defined by standard
type Service ¶
type Service interface { StoreBlock(b *Block, txs []tx.Tx) (err error) ReadFromHeight(height int32) (block Block, err error) ReadHeight() (height int32, err error) GetFromHash(hash string) (Block, error) GetFromHeight(height int32) (*BlockOut, error) GetFromHashWithTxs(hash string) (*BlockOut, error) GetLast() (*BlockOut, error) GetFromHeightRange(height int32, first int) (blocks []BlockOut, err error) GetStored() (blocks []Block, err error) GetStoredList(from int32) (blocks map[string]interface{}, err error) Remove(block *Block) error RemoveLast() error GetStoredTxs() (transactions []string, err error) GetTxBlock(hash string) (block *BlockOut, err error) GetTxBlockHeight(hash string) (height int32, err error) }
Service interface exports available methods for tx service
Click to show internal directories.
Click to hide internal directories.