Documentation ¶
Index ¶
- Constants
- func DisableLog()
- func NewGetTicketsCacheData(tfar *dcrjson.TicketsForAddressResult) *getTicketsCacheData
- func UseLogger(logger btclog.Logger)
- type ApiController
- type BySpentByHeight
- type ByTicketHeight
- type MainController
- func (controller *MainController) API(c web.C, r *http.Request) *system.APIResponse
- func (controller *MainController) APIAddress(c web.C, r *http.Request) ([]string, codes.Code, string, error)
- func (controller *MainController) APIPurchaseInfo(c web.C, r *http.Request) (*poolapi.PurchaseInfo, codes.Code, string, error)
- func (controller *MainController) APIStats(c web.C, r *http.Request) (*poolapi.Stats, codes.Code, string, error)
- func (controller *MainController) APIVoting(c web.C, r *http.Request) ([]string, codes.Code, string, error)
- func (controller *MainController) Address(c web.C, r *http.Request) (string, int)
- func (controller *MainController) AddressPost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) CheckAndResetUserVoteBits(dbMap *gorp.DbMap)
- func (controller *MainController) EmailUpdate(c web.C, r *http.Request) (string, int)
- func (controller *MainController) EmailVerify(c web.C, r *http.Request) (string, int)
- func (controller *MainController) Error(c web.C, r *http.Request) (string, int)
- func (controller *MainController) FeeAddressForUserID(uid int) (dcrutil.Address, error)
- func (controller *MainController) GetVoteVersion() (uint32, error)
- func (controller *MainController) Index(c web.C, r *http.Request) (string, int)
- func (controller *MainController) IsValidVoteBits(userVoteBits uint16) bool
- func (controller *MainController) Logout(c web.C, r *http.Request) (string, int)
- func (controller *MainController) PasswordReset(c web.C, r *http.Request) (string, int)
- func (controller *MainController) PasswordResetPost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) PasswordUpdate(c web.C, r *http.Request) (string, int)
- func (controller *MainController) PasswordUpdatePost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) RPCIsStopped() bool
- func (controller *MainController) RPCStart()
- func (controller *MainController) RPCStop() error
- func (controller *MainController) RPCSync(dbMap *gorp.DbMap) error
- func (controller *MainController) SendMail(emailaddress string, subject string, body string) error
- func (controller *MainController) Settings(c web.C, r *http.Request) (string, int)
- func (controller *MainController) SettingsPost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) SignIn(c web.C, r *http.Request) (string, int)
- func (controller *MainController) SignInPost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) SignUp(c web.C, r *http.Request) (string, int)
- func (controller *MainController) SignUpPost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) Stats(c web.C, r *http.Request) (string, int)
- func (controller *MainController) Status(c web.C, r *http.Request) (string, int)
- func (controller *MainController) TicketAddressForUserID(uid int) (dcrutil.Address, error)
- func (controller *MainController) Tickets(c web.C, r *http.Request) (string, int)
- func (controller *MainController) TriggerStakepooldUpdate(userid int64) error
- func (controller *MainController) Voting(c web.C, r *http.Request) (string, int)
- func (controller *MainController) VotingPost(c web.C, r *http.Request) (string, int)
- func (controller *MainController) WalletStatus() ([]*dcrjson.WalletInfoResult, error)
- type TicketInfoHistoric
- type TicketInfoInvalid
- type TicketInfoLive
Constants ¶
const MaxUsers = 10000
MaxUsers is the maximum number of users supported by a stake pool. This is an artificial limit and can be increased by adjusting the ticket/fee address indexes above 10000.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func NewGetTicketsCacheData ¶
func NewGetTicketsCacheData(tfar *dcrjson.TicketsForAddressResult) *getTicketsCacheData
NewGetTicketsCacheData is a contructor for getTicketsCacheData that sets the last get time to now.
Types ¶
type ApiController ¶
type ApiController struct {
system.Controller
}
type BySpentByHeight ¶
type BySpentByHeight []TicketInfoHistoric
BySpentByHeight type implements sort.Sort for types with a SpentByHeight field, namely TicketInfoHistoric, the type for voted/missed/expired tickets.
func (BySpentByHeight) Len ¶
func (a BySpentByHeight) Len() int
func (BySpentByHeight) Less ¶
func (a BySpentByHeight) Less(i, j int) bool
func (BySpentByHeight) Swap ¶
func (a BySpentByHeight) Swap(i, j int)
type ByTicketHeight ¶
type ByTicketHeight []TicketInfoLive
ByTicketHeight type implements sort.Sort for types with a TicketHeight field. This includes all valid tickets, including spend tickets.
func (ByTicketHeight) Len ¶
func (a ByTicketHeight) Len() int
func (ByTicketHeight) Less ¶
func (a ByTicketHeight) Less(i, j int) bool
func (ByTicketHeight) Swap ¶
func (a ByTicketHeight) Swap(i, j int)
type MainController ¶
type MainController struct { // embed type for c.Env[""] context and ExecuteTemplate helpers system.Controller APISecret string APIVersionsSupported []int // contains filtered or unexported fields }
MainController is the wallet RPC controller type. Its methods include the route handlers.
func NewMainController ¶
func NewMainController(params *chaincfg.Params, adminIPs []string, APISecret string, APIVersionsSupported []int, baseURL string, closePool bool, closePoolMsg string, enablestakepoold bool, feeXpubStr string, grpcConnections []*grpc.ClientConn, poolFees float64, poolEmail, poolLink, recaptchaSecret, recaptchaSiteKey string, smtpFrom, smtpHost, smtpUsername, smtpPassword, version string, walletHosts, walletCerts, walletUsers, walletPasswords []string, minServers int, realIPHeader, votingXpubStr string, maxVotedAge int64) (*MainController, error)
NewMainController is the constructor for the entire controller routing.
func (*MainController) API ¶
func (controller *MainController) API(c web.C, r *http.Request) *system.APIResponse
API is the main frontend that handles all API requests.
func (*MainController) APIAddress ¶
func (controller *MainController) APIAddress(c web.C, r *http.Request) ([]string, codes.Code, string, error)
APIAddress is the API version of AddressPost
func (*MainController) APIPurchaseInfo ¶
func (controller *MainController) APIPurchaseInfo(c web.C, r *http.Request) (*poolapi.PurchaseInfo, codes.Code, string, error)
APIPurchaseInfo fetches and returns the user's info or an error
func (*MainController) APIStats ¶
func (controller *MainController) APIStats(c web.C, r *http.Request) (*poolapi.Stats, codes.Code, string, error)
APIStats is an API version of the stats page
func (*MainController) APIVoting ¶
func (controller *MainController) APIVoting(c web.C, r *http.Request) ([]string, codes.Code, string, error)
APIVotingPost is the API version of VotingPost
func (*MainController) AddressPost ¶
AddressPost is address form submit route.
func (*MainController) CheckAndResetUserVoteBits ¶
func (controller *MainController) CheckAndResetUserVoteBits(dbMap *gorp.DbMap)
CheckAndResetUserVoteBits reset users VoteBits if the VoteVersion has changed or if the stored VoteBits are somehow invalid.
func (*MainController) EmailUpdate ¶
EmailUpdate validates the passed token and updates the user's email address.
func (*MainController) EmailVerify ¶
EmailVerify renders the email verification page.
func (*MainController) FeeAddressForUserID ¶
func (controller *MainController) FeeAddressForUserID(uid int) (dcrutil.Address, error)
FeeAddressForUserID generates a unique payout address per used ID for fees for an individual pool user.
func (*MainController) GetVoteVersion ¶
func (controller *MainController) GetVoteVersion() (uint32, error)
GetVoteVersion
func (*MainController) IsValidVoteBits ¶
func (controller *MainController) IsValidVoteBits(userVoteBits uint16) bool
IsValidVoteBits returns an error if voteBits are not valid for agendas
func (*MainController) PasswordReset ¶
PasswordReset renders the password reset page.
func (*MainController) PasswordResetPost ¶
PasswordResetPost handles the posted password reset form.
func (*MainController) PasswordUpdate ¶
PasswordUpdate renders the password update page.
func (*MainController) PasswordUpdatePost ¶
PasswordUpdatePost handles updating passwords.
func (*MainController) RPCIsStopped ¶
func (controller *MainController) RPCIsStopped() bool
RPCIsStopped checks to see if w.shutdown is set or not.
func (*MainController) RPCStart ¶
func (controller *MainController) RPCStart()
RPCStart starts the connected rpcServers.
func (*MainController) RPCStop ¶
func (controller *MainController) RPCStop() error
RPCStop stops the connected rpcServers.
func (*MainController) RPCSync ¶
func (controller *MainController) RPCSync(dbMap *gorp.DbMap) error
RPCSync checks to ensure that the wallets are synced on startup.
func (*MainController) SendMail ¶
func (controller *MainController) SendMail(emailaddress string, subject string, body string) error
SendMail sends an email with the passed data using the system's SMTP configuration.
func (*MainController) SettingsPost ¶
SettingsPost handles changing the user's email address or password.
func (*MainController) SignInPost ¶
SignInPost is the form submit route. Logs user in or sets an appropriate message in session if login was not successful.
func (*MainController) SignUpPost ¶
SignUpPost form submit route. Registers new user or shows Sign Up route with appropriate messages set in session.
func (*MainController) TicketAddressForUserID ¶
func (controller *MainController) TicketAddressForUserID(uid int) (dcrutil.Address, error)
TicketAddressForUserID generates a unique ticket address per used ID for generating the 1-of-2 multisig.
func (*MainController) TriggerStakepooldUpdate ¶
func (controller *MainController) TriggerStakepooldUpdate(userid int64) error
TriggerStakepooldUpdate informs stakepoold via gRPC that an update for user information/voting preferences needs to be performed.
func (*MainController) VotingPost ¶
VotingPost form submit route.
func (*MainController) WalletStatus ¶
func (controller *MainController) WalletStatus() ([]*dcrjson.WalletInfoResult, error)
WalletStatus returns current WalletInfo from all rpcServers.
type TicketInfoHistoric ¶
type TicketInfoHistoric struct { Ticket string SpentBy string SpentByHeight uint32 TicketHeight uint32 }
TicketInfoHistoric represents spent tickets, either voted or revoked.
type TicketInfoInvalid ¶
type TicketInfoInvalid struct {
Ticket string
}
TicketInfoInvalid represents tickets that were not added by the wallets for any reason (e.g. incorrect subsidy address or pool fees).
type TicketInfoLive ¶
TicketInfoLive represents live or immature (mined) tickets that have yet to be spent by either a vote or revocation.