Documentation
¶
Index ¶
Constants ¶
View Source
const (
// BoltDB codifies the value to specify to use boltdb as a datastore.
BoltDB datastore = "boltdb"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
ID string `json:"id" storm:"id"`
Hash string `json:"hash" storm:"index"`
Confirmations int `json:"confirmations"`
StrippedSize int `json:"strippedsize"`
Size int `json:"size"`
Weight int `json:"weight"`
Height int `json:"height" storm:"index"`
Version int `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
BlockTransactions []string `json:"tx"`
Time int64 `json:"time"`
Mediantime int `json:"mediantime"`
Nonce uint32 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
Chainwork string `json:"chainwork"`
PreviousHash string `json:"previousBlockHash"`
NextHash string `json:"nextBlockHash"`
}
Block provides the domain model for a blockchain block.
type Coin ¶
type Coin struct {
// Name is the human readable name of the coin. For example, "Feathercoin".
Name string `yaml:"name"`
// Code is the 3 letter coin code. For example, "FTC".
Code string `yaml:"code"`
// Host is the Coin's API daemon hostname on which to connect to the API.
Host string `yaml:"host"`
// Port is the Coin's API daemon port on which to connect to the API.
Port uint16 `yaml:"port"`
// Username is the username to use in order to authenticate to the Coin's
// API daemon.
Username string `yaml:"username"`
// Password is the password to use in order to authenticate to the Coin's
// API daemon.
Password string `yaml:"password"`
// Timeout is how long to wait before timing out API requests.
Timeout int `yaml:"timeout"`
// SSL is whether to connect over SSL.
// If not specified, the default is false.
SSL bool `yaml:"ssl"`
// EnableCoinCodexAPI is whether to enable the coin's codex API.
// If not specified, the default is false.
EnableCoinCodexAPI bool `yaml:"enableCoinCodexAPI"`
}
Coin provides the configuration required to connect to a coin daemon API.
type Config ¶
type Config struct {
// Port configures the API port CAPI will serve from.
Port uint16 `yaml:"port"`
// Coin Configuration.
Coins []Coin `yaml:"coins"`
// Datastore configuration.
Datastore Datastore `yaml:"datastore"`
}
Config provides the domain structure to enable configuring CAPI.
type ConfigBoltDB ¶
type ConfigBoltDB struct {
// DbPath enables storing data files at a path other than where the binary
// is started from.
DbPath string `yaml:"dbPath"`
// Timeout specifies, in seconds, how long to wait before timing out when
// trying to gain a file lock on the database's BoltDB data file.
Timeout int `yaml:"timeout"`
}
ConfigBoltDB provides specific configuration customisation for BoltDB.
type Datastore ¶
type Datastore struct {
// Backend is the specific datastore driver to use.
Backend datastore `yaml:"backend"`
// BoltDB specific datastore configuration.
BoltDB ConfigBoltDB `yaml:"boltdb"`
}
Datastore provides customization for backend datastores.
type Transaction ¶
type Transaction struct {
ID string
}
Transaction provides the domain model for a blockchain transaction.
Click to show internal directories.
Click to hide internal directories.