Documentation ¶
Index ¶
Constants ¶
const ( // NetFilename is the name of the net file in the kmd data dir NetFilename = "kmd.net" // PIDFilename is the name of the PID file in the kmd data dir PIDFilename = "kmd.pid" // LockFilename is the name of the lock file in the kmd data dir LockFilename = "kmd.lock" // DefaultKMDPort is the port that kmd will first try to start on if none is specified DefaultKMDPort = 7833 // DefaultKMDHost is the host that kmd will first try to start on if none is specified DefaultKMDHost = "127.0.0.1" )
Variables ¶
var ErrAlreadyRunning = fmt.Errorf("failed to lock kmd.lock; is an instance of kmd already running in this data directory?")
ErrAlreadyRunning is returned if we failed to start kmd because we couldn't acquire its file lock. We export this so that the kmd cli can return a different exit code for this situation
Functions ¶
func ValidateConfig ¶
func ValidateConfig(cfg WalletServerConfig) error
ValidateConfig returns an error if and only if the passed WalletServerConfig is invalid.
Types ¶
type WalletServer ¶
type WalletServer struct { WalletServerConfig // contains filtered or unexported fields }
WalletServer deals with serving API requests
func MakeWalletServer ¶
func MakeWalletServer(config WalletServerConfig) (*WalletServer, error)
MakeWalletServer takes a WalletServerConfig, and returns a validated, configured WalletServer.
func (*WalletServer) Start ¶
Start begins serving kmd API requests from the configured WalletServer. It returns an error if it was unable to start the server. It reads from the `kill` channel in order to shut down the server gracefully, and returns a `died` channel that will be written after the server exits.