Documentation ¶
Index ¶
- func GetBlockchainDb() db.DB
- func LoadDB()
- type Service
- func (s *Service) AddBaseBlock(bb *protobuf.BaseBlock) error
- func (s *Service) CreateOrLoadGenesisBlock() (*protobuf.BaseBlock, error)
- func (s *Service) GetBlockByBlockHash(db db.DB, key []byte) (*protobuf.BaseBlock, error)
- func (s *Service) GetBlockByHeight(height int64) (*protobuf.BaseBlock, error)
- func (s *Service) GetLastBlock() *protobuf.BaseBlock
- func (s *Service) GetTx(txID string) ([]byte, error)
- func (s *Service) LoadStateDBWithInitialAccounts() ([]byte, error)
- type ServiceI
- type TxService
- func (t *TxService) GetLockedTxsByBlockNumber(blockNumber int64) (*pluginproto.TxLockedResponse, error)
- func (t *TxService) GetRedeemTxsByBlockNumber(blockNumber int64) (*pluginproto.TxRedeemResponse, error)
- func (t *TxService) GetTx(id string) (*pluginproto.TxDetailResponse, error)
- func (t *TxService) GetTxs(address string) (*pluginproto.TxsResponse, error)
- func (t *TxService) GetTxsByAssetAndAddress(assetName, address string) (*pluginproto.TxsResponse, error)
- func (t *TxService) GetTxsByHeight(height int64) (*pluginproto.TxsResponse, error)
- type TxServiceI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBlockchainDb ¶
Types ¶
type Service ¶
type Service struct{}
Service ...
func (*Service) AddBaseBlock ¶
AddBaseBlock adds base block to blockchain db
func (*Service) CreateOrLoadGenesisBlock ¶
CreateOrLoadGenesisBlock ...
func (*Service) GetBlockByBlockHash ¶
GetBlockByBlockHash ...
func (*Service) GetBlockByHeight ¶
GetBlockByHeight ...
func (*Service) GetLastBlock ¶
GetLastBlock ...
func (*Service) GetTx ¶
GetTx searches a transaction against a tx id in blockchain TODO: This will be completed in another PR since account since account registeration needs to be completed and I would like to complete the implementation once the account registeration works.
func (*Service) LoadStateDBWithInitialAccounts ¶
LoadStateDBWithInitialAccounts loads state db with initial predefined accounts. Initially 50 accounts will be loaded to state db
type ServiceI ¶
type ServiceI interface { GetBlockByHeight(height int64) (*protobuf.BaseBlock, error) CreateOrLoadGenesisBlock() (*protobuf.BaseBlock, error) GetBlockByBlockHash(db db.DB, key []byte) (*protobuf.BaseBlock, error) AddBaseBlock(bb *protobuf.BaseBlock) error GetLastBlock() *protobuf.BaseBlock GetTx(txID string) ([]byte, error) }
ServiceI is blockchain service interface
type TxService ¶
type TxService struct{}
TxService ...
func (*TxService) GetLockedTxsByBlockNumber ¶
func (t *TxService) GetLockedTxsByBlockNumber(blockNumber int64) (*pluginproto.TxLockedResponse, error)
GetLockedTxsByBlockNumber returns a list of all locked txs in a block
func (*TxService) GetRedeemTxsByBlockNumber ¶
func (t *TxService) GetRedeemTxsByBlockNumber(blockNumber int64) (*pluginproto.TxRedeemResponse, error)
GetRedeemTxsByBlockNumber returns a list of all locked txs in a block
func (*TxService) GetTx ¶
func (t *TxService) GetTx(id string) (*pluginproto.TxDetailResponse, error)
GetTx ...
func (*TxService) GetTxs ¶
func (t *TxService) GetTxs(address string) (*pluginproto.TxsResponse, error)
GetTxs : Get all the txs by account address
func (*TxService) GetTxsByAssetAndAddress ¶
func (t *TxService) GetTxsByAssetAndAddress(assetName, address string) (*pluginproto.TxsResponse, error)
GetTxsByAssetAndAddress : Get all the txs by account address and asset name
func (*TxService) GetTxsByHeight ¶
func (t *TxService) GetTxsByHeight(height int64) (*pluginproto.TxsResponse, error)
GetTxsByHeight returns a list of all txs in a given block by height
type TxServiceI ¶
type TxServiceI interface { GetTx(id string) (*pluginproto.TxDetailResponse, error) GetTxs(address string) (*pluginproto.TxsResponse, error) GetTxsByAssetAndAddress(assetName, address string) (*pluginproto.TxsResponse, error) GetTxsByHeight(height int64) (*pluginproto.TxsResponse, error) }
TxServiceI is transaction service interface over blockchain