Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupDefaultDaemon ¶
func SetupDefaultDaemon(cfg Config)
SetupDefaultDaemon sets up and starts a default daemon. The chain options and constants need to be configured prior to this. This function does not return untill the daemon is stopped
func StartDaemon ¶
StartDaemon uses the config parameters to initialize Rivine modules and start
Types ¶
type Config ¶
type Config struct {
BlockchainInfo types.BlockchainInfo
// the password required to use the http api,
// if `AuthenticateAPI` is true, and the password is the empty string,
// a password will be prompted when the daemon starts
APIPassword string
// the host:port for the HTTP API to listen on.
// If `AllowAPIBind` is false, only localhost hosts are allowed
APIaddr string
// the host:port to listen for RPC calls
RPCaddr string
// indicates that the http API can listen on a non localhost address.
// If this is true, then the AuthenticateAPI parameter
// must also be true
AllowAPIBind bool
// the modules to enable, this string must contain one letter
// for each module (order does not matter).
// All required modules must be specified,
// if a required (parent) module is not present,
// an error is returned
Modules string
// indicates that the daemon should not try to connect to
// the bootstrap nodes
NoBootstrap bool
// the user agent required to connect to the http api.
RequiredUserAgent string
// indicates if the http api is password protected
AuthenticateAPI bool
// indicates if profile info should be collected while
// the daemon is running
Profile bool
// name of the directory to store the profile info,
// should this be collected
ProfileDir string
// the parent directory where the individual module
// directories will be created
RootPersistentDir string
// Network defines the network config to use
NetworkName string
// optional network config constructor,
// if you're implementing your own rivine-based blockchain,
// you'll probably want to define this one,
// as otherwise a pure rivine blockchain config will be created
CreateNetworConfig func(name string) (NetworkConfig, error)
}
Config contains all configurable variables for rivined.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default daemon configuration
type DaemonVersion ¶
type DaemonVersion struct {
Version string `json:"version"`
}
type NetworkConfig ¶
type NetworkConfig struct {
// Blockchain Constants for this network
Constants types.ChainConstants
// BootstrapPeers for this network
BootstrapPeers []modules.NetAddress
}
NetworkConfig are variables for a particular chain. Currently, these are genesis constants and bootstrap peers
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server creates and serves a HTTP server that offers communication with a Sia API.
func NewServer ¶
func NewServer(bindAddr, requiredUserAgent, requiredPassword string, chainCts types.ChainConstants, bcInfo types.BlockchainInfo) (*Server, error)
NewServer creates a new net.http server listening on bindAddr. Only the /daemon/ routes are registered by this func, additional routes can be registered later by calling serv.mux.Handle.
type SiaConstants ¶
type SiaConstants struct {
GenesisTimestamp types.Timestamp `json:"genesistimestamp"`
BlockSizeLimit uint64 `json:"blocksizelimit"`
BlockFrequency types.BlockHeight `json:"blockfrequency"`
FutureThreshold types.Timestamp `json:"futurethreshold"`
ExtremeFutureThreshold types.Timestamp `json:"extremefuturethreshold"`
BlockStakeCount types.Currency `json:"blockstakecount"`
BlockStakeAging uint64 `json:"blockstakeaging"`
BlockCreatorFee types.Currency `json:"blockcreatorfee"`
MinimumTransactionFee types.Currency `json:"minimumtransactionfee"`
TransactionFeeBeneficiary types.UnlockHash `json:"transactionfeebeneficiary"`
MaturityDelay types.BlockHeight `json:"maturitydelay"`
MedianTimestampWindow uint64 `json:"mediantimestampwindow"`
RootTarget types.Target `json:"roottarget"`
RootDepth types.Target `json:"rootdepth"`
TargetWindow types.BlockHeight `json:"targetwindow"`
MaxAdjustmentUp *big.Rat `json:"maxadjustmentup"`
MaxAdjustmentDown *big.Rat `json:"maxadjustmentdown"`
OneCoin types.Currency `json:"onecoin"`
}
SiaConstants is a struct listing all of the constants in use.
type UpdateInfo ¶
UpdateInfo indicates whether an update is available, and to what version.