Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckSequenceRefresh ¶
func CheckSequenceRefresh(minion *Minion, hclient horizonclient.ClientInterface) error
CheckSequenceRefresh establishes the minion's initial sequence number, if needed. This should also be passed to the minion.
func SubmitTransaction ¶
func SubmitTransaction(minion *Minion, hclient horizonclient.ClientInterface, tx string) (*hProtocol.Transaction, error)
SubmitTransaction should be passed to the Minion.
Types ¶
type Account ¶
Account implements the `txnbuild.Account` interface.
func (Account) GetAccountID ¶
GetAccountID returns the Account ID.
func (Account) GetSequenceNumber ¶
func (Account) IncrementSequenceNumber ¶
IncrementSequenceNumber increments the internal record of the account's sequence number by 1.
func (*Account) RefreshSequenceNumber ¶
func (a *Account) RefreshSequenceNumber(hclient horizonclient.ClientInterface) error
RefreshSequenceNumber gets an Account's correct in-memory sequence number from Horizon.
type Bot ¶
type Bot struct { Minions []Minion // contains filtered or unexported fields }
Bot represents the friendbot subsystem and primarily delegates work to its Minions.
type FriendbotHandler ¶
type FriendbotHandler struct {
Friendbot *Bot
}
FriendbotHandler causes an account at `Address` to be created.
func (*FriendbotHandler) Handle ¶
func (handler *FriendbotHandler) Handle(w http.ResponseWriter, r *http.Request)
Handle is a method that implements http.HandlerFunc
type Minion ¶
type Minion struct { Account Account Keypair *keypair.Full BotAccount txnbuild.Account BotKeypair *keypair.Full Horizon horizonclient.ClientInterface Network string StartingBalance string BaseFee int64 // Mockable functions SubmitTransaction func(minion *Minion, hclient horizonclient.ClientInterface, tx string) (*hProtocol.Transaction, error) CheckSequenceRefresh func(minion *Minion, hclient horizonclient.ClientInterface) error // contains filtered or unexported fields }
Minion contains a Stellar channel account and Go channels to communicate with friendbot.
func (*Minion) Run ¶
func (minion *Minion) Run(destAddress string, resultChan chan SubmitResult)
Run reads a payment destination address and an output channel. It attempts to pay that address and submits the result to the channel.
type SubmitResult ¶
type SubmitResult struct {
// contains filtered or unexported fields
}
SubmitResult is the result from the asynchronous tx submission.