Documentation ¶
Index ¶
- func Migrate()
- func Prune()
- func Register()
- type SQLiteDriver
- func (s SQLiteDriver) CleanChain(chain *blockchain.Chain)
- func (s SQLiteDriver) CountOfPeers() int
- func (s SQLiteDriver) DeletePeer(peer *network.Peer)
- func (s SQLiteDriver) GetAllChains(yield func(ref int64, id string, wif string, count uint64))
- func (s SQLiteDriver) GetBlock(id int64, height uint64) *blockchain.Block
- func (s SQLiteDriver) GetBlockByHash(id int64, hash string) *blockchain.Block
- func (s SQLiteDriver) GetBlocks(id int64, from uint64, to uint64) []*blockchain.Block
- func (s SQLiteDriver) GetChain(chainID string, ref *int64, wif *string, count *uint64) bool
- func (s SQLiteDriver) GetPeer(addr string) *network.Peer
- func (s SQLiteDriver) GetPeers(count int) []*network.Peer
- func (s SQLiteDriver) IncreaseCount(chain *blockchain.Chain)
- func (s SQLiteDriver) SaveBlock(id int64, block *blockchain.Block)
- func (s SQLiteDriver) SaveChain(chain *blockchain.Chain) error
- func (s SQLiteDriver) SavePeer(peer *network.Peer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SQLiteDriver ¶
type SQLiteDriver struct {
// contains filtered or unexported fields
}
func (SQLiteDriver) CleanChain ¶
func (s SQLiteDriver) CleanChain(chain *blockchain.Chain)
func (SQLiteDriver) CountOfPeers ¶
func (s SQLiteDriver) CountOfPeers() int
func (SQLiteDriver) DeletePeer ¶
func (s SQLiteDriver) DeletePeer(peer *network.Peer)
func (SQLiteDriver) GetAllChains ¶
func (s SQLiteDriver) GetAllChains(yield func(ref int64, id string, wif string, count uint64))
func (SQLiteDriver) GetBlock ¶
func (s SQLiteDriver) GetBlock(id int64, height uint64) *blockchain.Block
TODO: returning an instance of Block may not be an good practice
func (SQLiteDriver) GetBlockByHash ¶
func (s SQLiteDriver) GetBlockByHash(id int64, hash string) *blockchain.Block
func (SQLiteDriver) GetBlocks ¶
func (s SQLiteDriver) GetBlocks(id int64, from uint64, to uint64) []*blockchain.Block
Get blocks of specific internal id by two heights 'from' and 'to' are both included
func (SQLiteDriver) IncreaseCount ¶
func (s SQLiteDriver) IncreaseCount(chain *blockchain.Chain)
func (SQLiteDriver) SaveBlock ¶
func (s SQLiteDriver) SaveBlock(id int64, block *blockchain.Block)
func (SQLiteDriver) SaveChain ¶
func (s SQLiteDriver) SaveChain(chain *blockchain.Chain) error
func (SQLiteDriver) SavePeer ¶
func (s SQLiteDriver) SavePeer(peer *network.Peer)
TODO: need a better error check
Click to show internal directories.
Click to hide internal directories.