Documentation ¶
Index ¶
- Variables
- type AccountData
- type AccountStatus
- type Client
- type Connector
- type FaucetEnqueueRequest
- type Input
- type OutputData
- type Outputs
- type ParametersTool
- type PayloadIssuanceData
- type ServerInfo
- type ServerInfos
- type TempOutputID
- type WebClient
- func (c *WebClient) APIForEpoch(index iotago.EpochIndex) iotago.API
- func (c *WebClient) APIForSlot(index iotago.SlotIndex) iotago.API
- func (c *WebClient) APIForTime(t time.Time) iotago.API
- func (c *WebClient) APIForVersion(version iotago.Version) (iotago.API, error)
- func (c *WebClient) Client() *nodeclient.Client
- func (c *WebClient) CommittedAPI() iotago.API
- func (c *WebClient) GetAccountFromIndexer(ctx context.Context, accountAddress *iotago.AccountAddress) (*iotago.OutputID, *iotago.AccountOutput, iotago.SlotIndex, error)
- func (c *WebClient) GetBlockConfirmationState(ctx context.Context, blkID iotago.BlockID) (*api.BlockMetadataResponse, error)
- func (c *WebClient) GetBlockIssuance(ctx context.Context) (resp *api.IssuanceBlockHeaderResponse, err error)
- func (c *WebClient) GetBlockStateFromTransaction(ctx context.Context, txID iotago.TransactionID) (*api.BlockMetadataResponse, error)
- func (c *WebClient) GetCommittee(ctx context.Context) (*api.CommitteeResponse, error)
- func (c *WebClient) GetCongestion(ctx context.Context, accAddress *iotago.AccountAddress, ...) (resp *api.CongestionResponse, err error)
- func (c *WebClient) GetOutput(ctx context.Context, outputID iotago.OutputID) iotago.Output
- func (c *WebClient) GetRewards(ctx context.Context, outputID iotago.OutputID) (*api.ManaRewardsResponse, error)
- func (c *WebClient) GetTransaction(ctx context.Context, txID iotago.TransactionID) (tx *iotago.SignedTransaction, err error)
- func (c *WebClient) GetTransactionMetadata(ctx context.Context, txID iotago.TransactionID) (*api.TransactionMetadataResponse, error)
- func (c *WebClient) GetValidator(ctx context.Context, accountAddress *iotago.AccountAddress) (resp *api.ValidatorResponse, err error)
- func (c *WebClient) GetValidators(ctx context.Context) (*api.ValidatorsResponse, bool, error)
- func (c *WebClient) Indexer() nodeclient.IndexerClient
- func (c *WebClient) LatestAPI() iotago.API
- func (c *WebClient) PostBlock(ctx context.Context, block *iotago.Block) (blockID iotago.BlockID, err error)
- func (c *WebClient) PostData(ctx context.Context, data []byte) (blkID string, err error)
- func (c *WebClient) RequestFaucetFunds(ctx context.Context, address iotago.Address) (err error)
- func (c *WebClient) URL() string
- type WebClients
- func (c *WebClients) AddClient(url string, setters ...options.Option[WebClient])
- func (c *WebClients) Clients(...bool) []Client
- func (c *WebClients) GetClient() Client
- func (c *WebClients) GetClients(numOfClt int) []Client
- func (c *WebClients) RemoveClient(url string)
- func (c *WebClients) ServerStatus(cltIdx int) (status *ServerInfo, err error)
- func (c *WebClients) ServersStatuses() ServerInfos
Constants ¶
This section is empty.
Variables ¶
var EmptyTempOutputID = TempOutputID{}
var ParamsTool = &ParametersTool{}
Functions ¶
This section is empty.
Types ¶
type AccountData ¶
type AccountStatus ¶
type AccountStatus uint8
const ( AccountPending AccountStatus = iota AccountReady )
type Client ¶
type Client interface { Client() *nodeclient.Client Indexer() nodeclient.IndexerClient // URL returns a client API url. URL() (cltID string) // PostBlock sends a block to the Tangle via a given client. PostBlock(ctx context.Context, block *iotago.Block) (iotago.BlockID, error) // PostData sends the given data (payload) by creating a block in the backend. PostData(ctx context.Context, data []byte) (blkID string, err error) // GetBlockConfirmationState returns the AcceptanceState of a given block ID. GetBlockConfirmationState(ctx context.Context, blkID iotago.BlockID) (resp *api.BlockMetadataResponse, err error) // GetBlockStateFromTransaction returns the AcceptanceState of a given transaction ID. GetBlockStateFromTransaction(ctx context.Context, txID iotago.TransactionID) (resp *api.BlockMetadataResponse, err error) // GetOutput gets the output of a given outputID. GetOutput(ctx context.Context, outputID iotago.OutputID) iotago.Output // GetTransaction gets the transaction. GetTransaction(ctx context.Context, txID iotago.TransactionID) (resp *iotago.SignedTransaction, err error) // GetTransactionMetadata gets the transaction metadata. GetTransactionMetadata(ctx context.Context, txID iotago.TransactionID) (resp *api.TransactionMetadataResponse, err error) // GetBlockIssuance returns the latest commitment and data needed to create a new block. GetBlockIssuance(ctx context.Context) (resp *api.IssuanceBlockHeaderResponse, err error) // GetCongestion returns congestion data such as rmc or issuing readiness. GetCongestion(ctx context.Context, addr *iotago.AccountAddress, optCommitmentID ...iotago.CommitmentID) (resp *api.CongestionResponse, err error) // RequestFaucetFunds requests funds from the faucet. RequestFaucetFunds(ctx context.Context, address iotago.Address) (err error) // GetAccountFromIndexer returns the outputID, accountOutput and slotIndex of a given accountAddress. GetAccountFromIndexer(ctx context.Context, accountAddress *iotago.AccountAddress) (*iotago.OutputID, *iotago.AccountOutput, iotago.SlotIndex, error) // GetCommittee returns the committee for a given epoch. GetCommittee(ctx context.Context) (*api.CommitteeResponse, error) // GetValidators returns the validators for the current epoch. GetValidators(ctx context.Context) (*api.ValidatorsResponse, bool, error) // GetValidator returns the validator data of a given accountAddress. GetValidator(ctx context.Context, accountAddress *iotago.AccountAddress) (resp *api.ValidatorResponse, err error) // GetRewards returns the rewards of a given outputID. GetRewards(ctx context.Context, outputID iotago.OutputID) (resp *api.ManaRewardsResponse, err error) iotago.APIProvider }
type Connector ¶
type Connector interface { // ServersStatuses retrieves the connected server status for each client. ServersStatuses() ServerInfos // ServerStatus retrieves the connected server status. ServerStatus(cltIdx int) (status *ServerInfo, err error) // Clients returns list of all clients. Clients(...bool) []Client // GetClients returns the numOfClt client instances that were used the longest time ago. GetClients(numOfClt int) []Client // AddClient adds a client to WebClients based on provided GoShimmerAPI url. AddClient(url string, setters ...options.Option[WebClient]) // RemoveClient removes a client with the provided url from the WebClients. RemoveClient(url string) // GetClient returns the client instance that was used the longest time ago. GetClient() Client }
type FaucetEnqueueRequest ¶
type FaucetEnqueueRequest struct { // The bech32 address. Address string `json:"address"` }
FaucetEnqueueRequest defines the request for a POST RouteFaucetEnqueue REST API call.
type OutputData ¶
type OutputData struct { OutputID iotago.OutputID TempID TempOutputID Address iotago.Address AddressIndex uint32 PrivateKey ed25519.PrivateKey OutputStruct iotago.Output }
OutputData contains details of an output ID.
func NewOutputDataWithID ¶
type ParametersTool ¶
type ParametersTool struct { NodeURLs []string `default:"http://localhost:8050" usage:"API URLs for clients used in test separated with commas"` FaucetURL string `default:"http://localhost:8088" usage:"Faucet URL used in test"` FaucetSplitNumber int `` /* 202-byte string literal not displayed */ AccountStatesFile string `default:"wallet.dat" usage:"File to store account states in"` BlockIssuerPrivateKey string `` /* 213-byte string literal not displayed */ AccountID string `default:"0x6aee704f25558e8aa7630fed0121da53074188abc423b3c5810f80be4936eb6e" usage:"Account ID to use for genesis account"` FaucetRequestsBlockIssuerPrivateKey string `default:"" usage:"Block issuer private key (in hex) to use for funds preparation from faucet outputs"` FaucetRequestsAccountID string `default:"" usage:"Account ID to use for fund preparation."` }
type PayloadIssuanceData ¶
type PayloadIssuanceData struct { Type iotago.PayloadType TransactionBuilder *builder.TransactionBuilder Payload iotago.Payload }
PayloadIssuanceData contains data for issuing a payload. Either ready payload or transaction build data along with issuer account required for signing.
type ServerInfo ¶
type ServerInfos ¶
type ServerInfos []*ServerInfo
type TempOutputID ¶
type TempOutputID [32]byte
func NewTempOutputID ¶
func (TempOutputID) Bytes ¶
func (f TempOutputID) Bytes() []byte
func (TempOutputID) String ¶
func (f TempOutputID) String() string
type WebClient ¶
type WebClient struct {
// contains filtered or unexported fields
}
WebClient contains a GoShimmer web API to interact with a node.
func NewWebClient ¶
NewWebClient creates Connector from provided iota-core API urls.
func (*WebClient) APIForEpoch ¶
func (c *WebClient) APIForEpoch(index iotago.EpochIndex) iotago.API
func (*WebClient) APIForVersion ¶
func (*WebClient) Client ¶
func (c *WebClient) Client() *nodeclient.Client
func (*WebClient) CommittedAPI ¶
func (*WebClient) GetAccountFromIndexer ¶
func (*WebClient) GetBlockConfirmationState ¶
func (c *WebClient) GetBlockConfirmationState(ctx context.Context, blkID iotago.BlockID) (*api.BlockMetadataResponse, error)
GetBlockConfirmationState returns the AcceptanceState of a given block ID.
func (*WebClient) GetBlockIssuance ¶
func (*WebClient) GetBlockStateFromTransaction ¶
func (c *WebClient) GetBlockStateFromTransaction(ctx context.Context, txID iotago.TransactionID) (*api.BlockMetadataResponse, error)
GetBlockStateFromTransaction returns the AcceptanceState of a given transaction ID.
func (*WebClient) GetCommittee ¶
func (*WebClient) GetCongestion ¶
func (c *WebClient) GetCongestion(ctx context.Context, accAddress *iotago.AccountAddress, optCommitmentID ...iotago.CommitmentID) (resp *api.CongestionResponse, err error)
func (*WebClient) GetRewards ¶
func (*WebClient) GetTransaction ¶
func (c *WebClient) GetTransaction(ctx context.Context, txID iotago.TransactionID) (tx *iotago.SignedTransaction, err error)
GetTransaction gets the transaction.
func (*WebClient) GetTransactionMetadata ¶
func (c *WebClient) GetTransactionMetadata(ctx context.Context, txID iotago.TransactionID) (*api.TransactionMetadataResponse, error)
GetTransactionMetadata gets the transaction metadata.
func (*WebClient) GetValidator ¶
func (c *WebClient) GetValidator(ctx context.Context, accountAddress *iotago.AccountAddress) (resp *api.ValidatorResponse, err error)
func (*WebClient) GetValidators ¶
func (*WebClient) Indexer ¶
func (c *WebClient) Indexer() nodeclient.IndexerClient
func (*WebClient) PostData ¶
PostData sends the given data (payload) by creating a block in the backend.
func (*WebClient) RequestFaucetFunds ¶
type WebClients ¶
type WebClients struct {
// contains filtered or unexported fields
}
WebClients is responsible for handling connections via GoShimmerAPI.
func NewWebClients ¶
func NewWebClients(urls []string, faucetURL string, setters ...options.Option[WebClient]) (*WebClients, error)
NewWebClients creates Connector from provided GoShimmerAPI urls.
func (*WebClients) AddClient ¶
func (c *WebClients) AddClient(url string, setters ...options.Option[WebClient])
AddClient adds client to WebClients based on provided GoShimmerAPI url.
func (*WebClients) Clients ¶
func (c *WebClients) Clients(...bool) []Client
Clients returns list of all clients.
func (*WebClients) GetClient ¶
func (c *WebClients) GetClient() Client
GetClient returns the client instance that was used the longest time ago.
func (*WebClients) GetClients ¶
func (c *WebClients) GetClients(numOfClt int) []Client
GetClients returns the numOfClt client instances that were used the longest time ago.
func (*WebClients) RemoveClient ¶
func (c *WebClients) RemoveClient(url string)
RemoveClient removes client with the provided url from the WebClients.
func (*WebClients) ServerStatus ¶
func (c *WebClients) ServerStatus(cltIdx int) (status *ServerInfo, err error)
ServerStatus retrieves the connected server status.
func (*WebClients) ServersStatuses ¶
func (c *WebClients) ServersStatuses() ServerInfos
ServersStatuses retrieves the connected server status for each client.