Documentation
¶
Index ¶
Constants ¶
const ApplicationID int32 = 0x0FA7D000
const (
// TODO: expose this as flag
PoolSize = 2
)
Variables ¶
This section is empty.
Functions ¶
func OpenConnPool ¶
func OpenConnPool(ctx context.Context, dbURI string) ( conn *sqlite.Conn, pool *sqlitex.Pool, err error)
OpenConnPool opens a Conn to the sqlite3 database at dbURI and performs a number of checks and operations to ensure that the Conn is ready for use. The Interrupt on the Conn is set to ctx.Done().
If the Conn is successfully initialized a read-only Pool will be opened on the same database.
The caller is responsible for closing conn and pool if err is not nil.
Types ¶
type FATChain ¶ added in v1.1.0
type FATChain struct {
// FAT Specific Data
TokenID string
IssuerChainID *factom.Bytes32
Identity factom.Identity
Issuance fat.Issuance
NumIssued uint64
// General Factom Blockchain Data
FactomChain
}
func NewFATChain ¶ added in v1.1.0
func OpenAllFATChains ¶ added in v1.1.0
func OpenFATChain ¶ added in v1.1.0
func (*FATChain) AddNumIssued ¶ added in v1.1.0
type FactomChain ¶ added in v1.1.0
type FactomChain struct {
ID *factom.Bytes32
Head factom.EBlock
HeadDBKeyMR *factom.Bytes32
NetworkID factom.NetworkID
SyncHeight uint32
SyncDBKeyMR *factom.Bytes32
DBFile string
Conn *sqlite.Conn // Read/Write
Pool *sqlitex.Pool // Read Only Pool
CloseMtx trylock.TryLocker
Log _log.Log
}
func NewFactomChain ¶ added in v1.1.0
func OpenFactomChain ¶ added in v1.1.0
func OpenFactomChain(ctx context.Context, dbPath, fname string) (_ FactomChain, err error)
func (*FactomChain) Close ¶ added in v1.1.0
func (chain *FactomChain) Close() error
Close all database connections. Log any errors.
func (*FactomChain) LatestEntryTimestamp ¶ added in v1.1.0
func (chain *FactomChain) LatestEntryTimestamp() time.Time
Directories
¶
| Path | Synopsis |
|---|---|
|
Package address provides functions and SQL framents for working with the "address" table, which stores factom.FAAddress with its balance.
|
Package address provides functions and SQL framents for working with the "address" table, which stores factom.FAAddress with its balance. |
|
Package eblock provides functions and SQL framents for working with the "eblock" table, which stores factom.EBlock.
|
Package eblock provides functions and SQL framents for working with the "eblock" table, which stores factom.EBlock. |
|
Package entry provides functions and SQL framents for working with the "entry" table, which stores factom.Entry with a valid flag.
|
Package entry provides functions and SQL framents for working with the "entry" table, which stores factom.Entry with a valid flag. |
|
Package metadata provides functions and SQL fragments for working with the "factom_chain" and "fat_chain" metadata tables, which store the sync height, sync DBKeyMR, factom.NetworkID, and factom.Identity.
|
Package metadata provides functions and SQL fragments for working with the "factom_chain" and "fat_chain" metadata tables, which store the sync height, sync DBKeyMR, factom.NetworkID, and factom.Identity. |
|
Package nftoken provides functions and SQL framents for working with the "nftoken" table, which stores fat.NFToken with owner, creation id, and metadata.
|
Package nftoken provides functions and SQL framents for working with the "nftoken" table, which stores fat.NFToken with owner, creation id, and metadata. |