Documentation
¶
Overview ¶
Package cmd is all the available commands for the bux-cli application
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFailedToLoadBux = errors.New("failed to load bux")
ErrFailedToLoadBux is returned when bux fails to load
var ErrModeIsRequired = errors.New("mode is required")
ErrModeIsRequired is returned when a mode is required
var ErrModelIsNil = errors.New("model is nil")
ErrModelIsNil is returned when a model is nil
var ErrNoXpubsFound = errors.New("no xpubs found")
ErrNoXpubsFound is returned when no xpubs are found
var ErrServerModeIsNotImplemented = errors.New("server mode is not implemented")
ErrServerModeIsNotImplemented is returned when a server mode is not implemented
var ErrUnknownMode = errors.New("unknown mode")
ErrUnknownMode is returned when a mode is unknown
var ErrUnknownSubcommand = errors.New("unknown subcommand")
ErrUnknownSubcommand is returned when a subcommand is unknown
var ErrXprivIsRequired = errors.New("xpriv is required")
ErrXprivIsRequired is returned when a xpriv is required
var ErrXpubIDIsRequired = errors.New("xpub id is required")
ErrXpubIDIsRequired is returned when a xpub id is required
var ErrXpubIsRequired = errors.New("xpub is required")
ErrXpubIsRequired is returned when a xpub is required
var ErrXpubOrXpubIDIsRequired = errors.New("xpub or xpub id is required")
ErrXpubOrXpubIDIsRequired is returned when a xpub or xpub id is required
var Version = "v0.2.4"
Version of the application
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main application struct This is used to pass around the application configuration and services
func (*App) GetUserAgent ¶
GetUserAgent will return the outgoing user agent
func (*App) InitializeBUX ¶
func (a *App) InitializeBUX() (deferFunc func())
InitializeBUX will initialize BUX if it is not already initialized
type CachestoreConfig ¶
type CachestoreConfig struct {
Engine cachestore.Engine `json:"engine" mapstructure:"engine"` // Cache engine to use (redis, freecache)
}
CachestoreConfig is the configuration for the cachestore
type ChainstateConfig ¶
type ChainstateConfig struct { BroadcastInstantly bool `json:"broadcast_instantly" mapstructure:"broadcast_instantly"` // true for broadcasting instantly Broadcasting bool `json:"broadcast" mapstructure:"broadcast"` // true for broadcasting MinersBroadcast []string `json:"miners_broadcast" mapstructure:"miners_broadcast"` // Miners for broadcasting MinersQuery []string `json:"miners_query" mapstructure:"miners_query"` // Miners for querying P2P bool `json:"p2p" mapstructure:"p2p"` // true for p2p SyncOnChain bool `json:"sync_on_chain" mapstructure:"sync_on_chain"` // true for syncing on chain TaalAPIKey string `json:"taal_api_key" mapstructure:"taal_api_key"` // Taal API key }
ChainstateConfig is a configuration for the chainstate
type Config ¶
type Config struct { Cachestore CachestoreConfig `json:"cachestore" mapstructure:"cachestore"` // Cachestore config Chainstate ChainstateConfig `json:"chainstate" mapstructure:"chainstate"` // Chainstate config Datastore DatastoreConfig `json:"datastore" mapstructure:"datastore"` // Datastore config Debug bool `json:"debug" mapstructure:"debug"` // Debug mode Mode string `json:"mode" mapstructure:"mode"` // Mode is either database or server Mongo datastore.MongoDBConfig `json:"mongodb" mapstructure:"mongodb"` // MongoDB config Redis RedisConfig `json:"redis" mapstructure:"redis"` // Redis config SQL datastore.SQLConfig `json:"sql" mapstructure:"sql"` // SQL config (MySQL, Postgres, etc) SQLite datastore.SQLiteConfig `json:"sqlite" mapstructure:"sqlite"` // SQLite config TaskManager TaskManagerConfig `json:"task_manager" mapstructure:"task_manager"` // TaskManager config Verbose bool `json:"verbose" mapstructure:"verbose"` // Verbose mode (also enables debug) }
Config is the configuration for the application and BUX
type DatastoreConfig ¶
type DatastoreConfig struct { AutoMigrate bool `json:"auto_migrate" mapstructure:"auto_migrate"` // loads a blank database Debug bool `json:"debug" mapstructure:"debug"` // true for sql statements Engine datastore.Engine `json:"engine" mapstructure:"engine"` // mysql, sqlite TablePrefix string `json:"table_prefix" mapstructure:"table_prefix"` // pre_users (pre) }
DatastoreConfig is a configuration for the datastore
type Destination ¶ added in v0.1.1
type Destination struct { Bux *bux.Destination `json:"bux" mapstructure:"bux"` WOCBalance *whatsonchain.AddressBalance `json:"woc_balance,omitempty" mapstructure:"woc_balance"` WOCInfo *whatsonchain.AddressInfo `json:"woc_info,omitempty" mapstructure:"woc_info"` }
Destination is a struct for the bux model and whatsonchain destination
type Keys ¶
type Keys struct { PrivateKey string `json:"private_key" mapstructure:"private_key"` WIF string `json:"wif" mapstructure:"wif"` Xpriv string `json:"xpriv" mapstructure:"xpriv"` Xpub string `json:"xpub" mapstructure:"xpub"` }
Keys is a struct for the private keys, wif, xpriv and xpub
type RedisConfig ¶
type RedisConfig struct { DependencyMode bool `json:"dependency_mode" mapstructure:"dependency_mode"` // Only in Redis with script enabled MaxActiveConnections int `json:"max_active_connections" mapstructure:"max_active_connections"` // Max active connections MaxConnectionLifetime time.Duration `json:"max_connection_lifetime" mapstructure:"max_connection_lifetime"` // Max connection lifetime MaxIdleConnections int `json:"max_idle_connections" mapstructure:"max_idle_connections"` // Max idle connections MaxIdleTimeout time.Duration `json:"max_idle_timeout" mapstructure:"max_idle_timeout"` // Max idle timeout URL string `json:"url" mapstructure:"url"` // Redis URL connection string UseTLS bool `json:"use_tls" mapstructure:"use_tls"` // Flag for using TLS }
RedisConfig is a configuration for Redis cachestore or taskmanager
type TaskManagerConfig ¶
type TaskManagerConfig struct { Engine taskmanager.Engine `json:"engine" mapstructure:"engine"` // taskq, machinery Factory taskmanager.Factory `json:"factory" mapstructure:"factory"` // Factory (memory, redis) QueueName string `json:"queue_name" mapstructure:"queue_name"` // test_queue }
TaskManagerConfig is a configuration for the taskmanager
type Transaction ¶
type Transaction struct { Bux *bux.Transaction `json:"bux" mapstructure:"bux"` WOC *whatsonchain.TxInfo `json:"woc,omitempty" mapstructure:"woc"` }
Transaction is a struct for the bux model and whatsonchain transaction
type XpubExtended ¶
XpubExtended is an extended xpub struct with the full key