database

package
v0.0.0-...-75fa6d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2019 License: GPL-3.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate()

func Prune

func Prune()

func Register

func Register()

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) GetChain

func (s SQLiteDriver) GetChain(chainID string, ref *int64, wif *string, count *uint64) bool

func (SQLiteDriver) GetPeer

func (s SQLiteDriver) GetPeer(addr string) *network.Peer

func (SQLiteDriver) GetPeers

func (s SQLiteDriver) GetPeers(count int) []*network.Peer

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL