rivined

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DaemonName = "rivine"
)

DaemonName sets the name of the daemon, used in some help messages

Functions

func SetupDefaultDaemon added in v0.1.2

func SetupDefaultDaemon(cfg RivinedCfg)

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

Types

type Config

type Config struct {
	// The APIPassword is input by the user after the daemon starts up, if the
	// --authenticate-api flag is set.
	APIPassword string

	// The Rivined variables are referenced directly by cobra, and are set
	// according to the flags.
	Rivined RivinedCfg
}

The Config struct contains all configurable variables for siad. It is compatible with gcfg.

type DaemonVersion

type DaemonVersion struct {
	Version string `json:"version"`
}

type RivinedCfg added in v0.1.2

type RivinedCfg struct {
	APIaddr      string
	RPCaddr      string
	HostAddr     string
	AllowAPIBind bool

	Modules           string
	NoBootstrap       bool
	RequiredUserAgent string
	AuthenticateAPI   bool

	Profile    bool
	ProfileDir string
	RivineDir  string
}

RivinedCfg holds variables referenced by cobra and set by flags

func DefaultConfig added in v0.1.2

func DefaultConfig() RivinedCfg

DefaultConfig returns the default daemon configuration

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) (*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.

func (*Server) Close

func (srv *Server) Close() error

Close closes the Server's listener, causing the HTTP server to shut down.

func (*Server) Serve

func (srv *Server) Serve() error

type SiaConstants

type SiaConstants struct {
	GenesisTimestamp      types.Timestamp   `json:"genesistimestamp"`
	BlockSizeLimit        uint64            `json:"blocksizelimit"`
	BlockFrequency        types.BlockHeight `json:"blockfrequency"`
	TargetWindow          types.BlockHeight `json:"targetwindow"`
	MedianTimestampWindow uint64            `json:"mediantimestampwindow"`
	FutureThreshold       types.Timestamp   `json:"futurethreshold"`
	BlockStakeCount       types.Currency    `json:"blockstakecount"`
	MaturityDelay         types.BlockHeight `json:"maturitydelay"`

	RootTarget types.Target `json:"roottarget"`
	RootDepth  types.Target `json:"rootdepth"`

	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

type UpdateInfo struct {
	Available bool   `json:"available"`
	Version   string `json:"version"`
}

UpdateInfo indicates whether an update is available, and to what version.

Jump to

Keyboard shortcuts

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