Documentation ¶
Index ¶
- Variables
- type Config
- type Daemon
- type SplitTicketMatcherService
- func (svc *SplitTicketMatcherService) BuyerError(ctx context.Context, req *pb.BuyerErrorRequest) (*pb.BuyerErrorResponse, error)
- func (svc *SplitTicketMatcherService) FindMatches(ctx context.Context, req *pb.FindMatchesRequest) (*pb.FindMatchesResponse, error)
- func (svc *SplitTicketMatcherService) FundSplitTx(ctx context.Context, req *pb.FundSplitTxRequest) (*pb.FundSplitTxResponse, error)
- func (svc *SplitTicketMatcherService) FundTicket(ctx context.Context, req *pb.FundTicketRequest) (*pb.FundTicketResponse, error)
- func (svc *SplitTicketMatcherService) GenerateTicket(ctx context.Context, req *pb.GenerateTicketRequest) (*pb.GenerateTicketResponse, error)
- func (svc *SplitTicketMatcherService) Status(context.Context, *pb.StatusRequest) (*pb.StatusResponse, error)
- func (svc *SplitTicketMatcherService) WatchWaitingList(req *pb.WatchWaitingListRequest, ...) error
- type WalletClient
- type WalletConfig
Constants ¶
This section is empty.
Variables ¶
var ( // ErrHelpRequested is the error returned when the help option was requested // on the command line ErrHelpRequested = fmt.Errorf("help requested") // ErrVersionRequested is the error returned when the version command line // option was requested ErrVersionRequested = fmt.Errorf("version requested") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ConfigFile string `short:"C" long:"configfile" description:"Path to config file"` Port int `long:"port" description:"Port to run the service on"` WaitingListWSBindAddr string `` /* 129-byte string literal not displayed */ LogLevel slog.Level LogLevelName string `long:"loglevel" description:"Log Level (CRITICAL, ERROR, WARNING, INFO, DEBUG, TRACE)"` LogDir string `long:"logdir" description:"Location to save log files."` KeyFile string `long:"keyfile" description:"Location of the rpc.key file (private key for the TLS certificate)."` CertFile string `long:"certfile" description:"Location of the rpc.cert file (TLS certificate)."` SplitPoolSignKey string `long:"splitpoolsignkey" description:"WIF private key for signing the split -> ticket intermediate pool fee txo"` DataDir string `long:"datadir" description:"Dir where session and other data will be saved"` ShowVersion bool `long:"version" description:"Show version and quit"` TestNet bool `long:"testnet" description:"Whether this is connecting to a testnet wallet/matcher service"` SimNet bool `long:"simnet" description:"Whether this is connecting to a simnet wallet"` DcrdHost string `long:"dcrdhost" description:"Address of the dcrd daemon"` DcrdUser string `long:"dcrduser" description:"Username of the rpc connection to dcrd"` DcrdPass string `long:"dcrdpass" description:"Password of the rpc connection to dcrd"` DcrdCert string `long:"dcrdcert" description:"Location of the rpc.cert file of dcrd"` DcrwHost string `long:"dcrwhost" description:"Address of the dcrwallet daemon"` DcrwUser string `long:"dcrwuser" description:"Username of the rpc connection to dcrwallet"` DcrwPass string `long:"dcrwpass" description:"Password of the rpc connection to dcrwallet"` DcrwCert string `long:"dcrwcert" description:"Location of the rpc.cert file of dcrwallet"` MinAmount float64 `long:"minamount" description:"Minimum amount to participate on a split ticket (in DCR)"` MaxSessionDuration time.Duration `long:"maxsessionduration" description:"Maximum number of seconds a session may take before being automatically closed"` StakeDiffChangeStopWindow int32 `` /* 135-byte string literal not displayed */ PublishTransactions bool `long:"publishtransactions" description:"Whether to actually publish transactions of successful sessions"` ValidateVoteAddressOnWallet bool `long:"validatevoteaddressonwallet" description:"Whether to validate the vote addresses of participants on the wallet"` PoolSubsidyWalletMasterPub string `` /* 246-byte string literal not displayed */ PoolFee float64 `long:"poolfee" description:"Pool fee as a percentage (eg: 5.0 = 5%)"` StakepooldIntegratorHost string `long:"stakepooldintegratorhost" description:"Host to connect to for stakepoold validation"` StakepooldIntegratorCert string `long:"stakepooldintegratorcert" description:"Certificate to use when connecting the stakepool integrator host"` AllowPublicSession bool `long:"allowpublicsession" description:"Whether to allow sessions with an empty name (public sessions) in the matcher."` KeepAliveTime time.Duration `` /* 133-byte string literal not displayed */ KeepAliveTimeout time.Duration `long:"keepalivetimeout" description:"Time duration to wait for a reply after a keepalive ping has been sent"` SuccessfulSessionCmd string `` /* 162-byte string literal not displayed */ // contains filtered or unexported fields }
Config stores the config needed to run an instance of the dcr split ticket matcher daemon
func LoadConfig ¶ added in v0.1.2
LoadConfig loads the daemon config from the local config file.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the main instance of a running dcr split ticket matcher daemon
type SplitTicketMatcherService ¶
type SplitTicketMatcherService struct {
// contains filtered or unexported fields
}
SplitTicketMatcherService implements the methods required to accept split ticket session commands from a grpc service.
func NewSplitTicketMatcherService ¶
func NewSplitTicketMatcherService(matcher *matcher.Matcher, networkProvider matcher.NetworkProvider, allowPublicSession bool, log slog.Logger) *SplitTicketMatcherService
NewSplitTicketMatcherService creates a new instance of a service, given all required options.
func (*SplitTicketMatcherService) BuyerError ¶ added in v0.7.0
func (svc *SplitTicketMatcherService) BuyerError(ctx context.Context, req *pb.BuyerErrorRequest) (*pb.BuyerErrorResponse, error)
BuyerError fulfills SplitTicketMatcherServiceServer
func (*SplitTicketMatcherService) FindMatches ¶
func (svc *SplitTicketMatcherService) FindMatches(ctx context.Context, req *pb.FindMatchesRequest) (*pb.FindMatchesResponse, error)
FindMatches fulfills SplitTicketMatcherServiceServer
func (*SplitTicketMatcherService) FundSplitTx ¶
func (svc *SplitTicketMatcherService) FundSplitTx(ctx context.Context, req *pb.FundSplitTxRequest) (*pb.FundSplitTxResponse, error)
FundSplitTx fulfills SplitTicketMatcherServiceServer
func (*SplitTicketMatcherService) FundTicket ¶
func (svc *SplitTicketMatcherService) FundTicket(ctx context.Context, req *pb.FundTicketRequest) (*pb.FundTicketResponse, error)
FundTicket fulfills SplitTicketMatcherServiceServer
func (*SplitTicketMatcherService) GenerateTicket ¶
func (svc *SplitTicketMatcherService) GenerateTicket(ctx context.Context, req *pb.GenerateTicketRequest) (*pb.GenerateTicketResponse, error)
GenerateTicket fulfills SplitTicketMatcherServiceServer
func (*SplitTicketMatcherService) Status ¶
func (svc *SplitTicketMatcherService) Status(context.Context, *pb.StatusRequest) (*pb.StatusResponse, error)
Status fulfills SplitTicketMatcherServiceServer
func (*SplitTicketMatcherService) WatchWaitingList ¶
func (svc *SplitTicketMatcherService) WatchWaitingList(req *pb.WatchWaitingListRequest, server pb.SplitTicketMatcherService_WatchWaitingListServer) error
WatchWaitingList fulfills SplitTicketMatcherServiceServer
type WalletClient ¶
type WalletClient struct {
// contains filtered or unexported fields
}
WalletClient is responsible for the interactions between the matcher service and the wallet it requires.
func ConnectToDcrWallet ¶ added in v0.1.2
func ConnectToDcrWallet(cfg *WalletConfig) ( *WalletClient, error)
ConnectToDcrWallet tries to connect to the given wallet.
func (*WalletClient) PoolFeeAddress ¶
func (wallet *WalletClient) PoolFeeAddress() dcrutil.Address
PoolFeeAddress returns the address to use when moving funds into the utxo of the split tx that will be used to fund the pool fee input of the ticket.
func (*WalletClient) Run ¶ added in v0.6.0
func (wallet *WalletClient) Run(serverCtx context.Context)
Run runs until serverCtx.Done is emited, then shuts down the wallet
func (*WalletClient) SignPoolSplitOutput ¶
func (wallet *WalletClient) SignPoolSplitOutput(split, ticket *wire.MsgTx) ([]byte, error)
SignPoolSplitOutput signs the pool fee input of the ticket with the key associated with PoolFeeAddress().
func (*WalletClient) ValidateVoteAddress ¶ added in v0.5.0
func (wallet *WalletClient) ValidateVoteAddress(voteAddr dcrutil.Address) error
ValidateVoteAddress checks whether the connected wallet can sign transactions with the provided addresses