Documentation ¶
Index ¶
- Variables
- func GetNodeList(addresses []string) (map[string]*struct{}, error)
- type ApiNode
- type ApiNodeList
- func (nl *ApiNodeList) AttachToTangle(trunkTxHash trinary.Hash, branchTxHash trinary.Hash, mwm uint64, ...) ([]trinary.Trytes, error)
- func (nl *ApiNodeList) BroadcastTransactions(trytes ...trinary.Trytes) ([]trinary.Trytes, error)
- func (nl *ApiNodeList) CheckConsistency(hashes ...trinary.Hash) (bool, string, error)
- func (nl *ApiNodeList) Close()
- func (nl *ApiNodeList) ExecuteFunc(signalChanTimeout chan bool, signalChanQuit chan struct{}, ...) error
- func (nl *ApiNodeList) FindTransactions(query api.FindTransactionsQuery) (trinary.Hashes, error)
- func (nl *ApiNodeList) GetBalances(addresses trinary.Hashes) (*api.Balances, error)
- func (nl *ApiNodeList) GetHealthyNodeCount() int
- func (nl *ApiNodeList) GetInclusionStates(txHashes trinary.Hashes) ([]bool, error)
- func (nl *ApiNodeList) GetLatestMilestone() (milestone *Milestone)
- func (nl *ApiNodeList) GetLatestSolidMilestone() (milestone *Milestone)
- func (nl *ApiNodeList) GetNodeInfo() (*api.GetNodeInfoResponse, error)
- func (nl *ApiNodeList) GetTotalNodeCount() int
- func (nl *ApiNodeList) GetTransactionsToApprove(reference ...trinary.Hash) (*api.TransactionsToApprove, error)
- func (nl *ApiNodeList) GetTrytes(hashes ...trinary.Hash) ([]trinary.Trytes, error)
- func (nl *ApiNodeList) HandleError(apiNode *ApiNode, err error) (quit bool)
- func (nl *ApiNodeList) HandleRequests()
- func (nl *ApiNodeList) HandleResponse(apiNode *ApiNode, pr *PendingApiRequest, resp interface{}, err error) (quit bool)
- func (nl *ApiNodeList) Init(nodes []string, timeout time.Duration, validVersions []string, ...) error
- func (nl *ApiNodeList) StoreTransactions(trytes ...trinary.Trytes) ([]trinary.Trytes, error)
- func (nl *ApiNodeList) WereAddressesSpentFrom(addresses ...trinary.Hash) ([]bool, error)
- type JSON_NodesIotaWorks
- type Milestone
- type PendingApiRequest
Constants ¶
This section is empty.
Variables ¶
var (
ErrTimeout = errors.New("Request timeout")
)
Functions ¶
func GetNodeList ¶
Types ¶
type ApiNodeList ¶
type ApiNodeList struct {
// contains filtered or unexported fields
}
func (*ApiNodeList) AttachToTangle ¶
func (nl *ApiNodeList) AttachToTangle(trunkTxHash trinary.Hash, branchTxHash trinary.Hash, mwm uint64, trytes []trinary.Trytes) ([]trinary.Trytes, error)
AttachToTangle performs the Proof-of-Work required to attach a transaction to the Tangle by calling the attachToTangle IRI API command. Returns a list of transaction trytes and overwrites the following fields:
Hash, Nonce, AttachmentTimestamp, AttachmentTimestampLowerBound, AttachmentTimestampUpperBound ¶
If a Proof-of-Work function is supplied when composing the API, then that function is used instead of using the connected node.
func (*ApiNodeList) BroadcastTransactions ¶
BroadcastTransactions broadcasts a list of attached transaction trytes to the network. Tip-selection and Proof-of-Work must be done first by calling GetTransactionsToApprove and AttachToTangle or an equivalent attach method.
You may use this method to increase odds of effective transaction propagation.
Persist the transaction trytes in local storage before calling this command for first time, to ensure that reattachment is possible, until your bundle has been included.
func (*ApiNodeList) CheckConsistency ¶
CheckConsistency checks if a transaction is consistent or a set of transactions are co-consistent.
Co-consistent transactions and the transactions that they approve (directly or indirectly), are not conflicting with each other and the rest of the ledger.
As long as a transaction is consistent, it might be accepted by the network. In case a transaction is inconsistent, it will not be accepted and a reattachment is required by calling ReplayBundle().
func (*ApiNodeList) Close ¶
func (nl *ApiNodeList) Close()
func (*ApiNodeList) ExecuteFunc ¶
func (*ApiNodeList) FindTransactions ¶
func (nl *ApiNodeList) FindTransactions(query api.FindTransactionsQuery) (trinary.Hashes, error)
FindTransactions searches for transaction hashes. It allows to search for transactions by passing a query object with addresses, bundle hashes, tags and/or approvees fields. Multiple query fields are supported and FindTransactions returns the intersection of the results.
func (*ApiNodeList) GetBalances ¶
GetBalances fetches confirmed balances of the given addresses at the latest solid milestone.
func (*ApiNodeList) GetHealthyNodeCount ¶
func (nl *ApiNodeList) GetHealthyNodeCount() int
func (*ApiNodeList) GetInclusionStates ¶
func (nl *ApiNodeList) GetInclusionStates(txHashes trinary.Hashes) ([]bool, error)
GetInclusionStates fetches inclusion states of a given list of transactions.
func (*ApiNodeList) GetLatestMilestone ¶
func (nl *ApiNodeList) GetLatestMilestone() (milestone *Milestone)
GetLatestMilestone returns the latest milestone.
func (*ApiNodeList) GetLatestSolidMilestone ¶
func (nl *ApiNodeList) GetLatestSolidMilestone() (milestone *Milestone)
GetLatestSolidMilestone returns the latest solid milestone.
func (*ApiNodeList) GetNodeInfo ¶
func (nl *ApiNodeList) GetNodeInfo() (*api.GetNodeInfoResponse, error)
GetNodeInfo returns information about the connected node.
func (*ApiNodeList) GetTotalNodeCount ¶
func (nl *ApiNodeList) GetTotalNodeCount() int
func (*ApiNodeList) GetTransactionsToApprove ¶
func (nl *ApiNodeList) GetTransactionsToApprove(reference ...trinary.Hash) (*api.TransactionsToApprove, error)
GetTransactionsToApprove does the tip selection via the connected node.
Returns a pair of approved transactions which are chosen randomly after validating the transaction trytes, the signatures and cross-checking for conflicting transactions.
Tip selection is executed by a Random Walk (RW) starting at random point in the given depth, ending up to the pair of selected tips. For more information about tip selection please refer to the whitepaper (http://iotatoken.com/IOTA_Whitepaper.pdf).
The reference option allows to select tips in a way that the reference transaction is being approved too. This is useful for promoting transactions, for example with PromoteTransaction().
func (*ApiNodeList) GetTrytes ¶
GetTrytes fetches the transaction trytes given a list of transaction hashes.
func (*ApiNodeList) HandleError ¶
func (nl *ApiNodeList) HandleError(apiNode *ApiNode, err error) (quit bool)
func (*ApiNodeList) HandleRequests ¶
func (nl *ApiNodeList) HandleRequests()
func (*ApiNodeList) HandleResponse ¶
func (nl *ApiNodeList) HandleResponse(apiNode *ApiNode, pr *PendingApiRequest, resp interface{}, err error) (quit bool)
func (*ApiNodeList) StoreTransactions ¶
StoreTransactions persists a list of attached transaction trytes in the store of the connected node. Tip-selection and Proof-of-Work must be done first by calling GetTransactionsToApprove and AttachToTangle or an equivalent attach method.
Persist the transaction trytes in local storage before calling this command, to ensure reattachment is possible, until your bundle has been included.
Any transactions stored with this command will eventually be erased as a result of a snapshot.
func (*ApiNodeList) WereAddressesSpentFrom ¶
func (nl *ApiNodeList) WereAddressesSpentFrom(addresses ...trinary.Hash) ([]bool, error)
WereAddressesSpentFrom checks whether the given addresses were already spent from by calling the wereAddressesSpentFrom IRI API command.
type JSON_NodesIotaWorks ¶
type JSON_NodesIotaWorks struct {
Host string `json:"node"`
}
type PendingApiRequest ¶
type PendingApiRequest struct {
// contains filtered or unexported fields
}
PendingApiRequest contains the information about a request and the response channel for signaling
func (*PendingApiRequest) CheckTimeoutSignal ¶
func (pr *PendingApiRequest) CheckTimeoutSignal() (timedOut bool)