Documentation
¶
Overview ¶
MIT License
Copyright (c) 2018 iota-tangle.io ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
spamalot description here. writing documentation is no fun.
Index ¶
- type Database
- func (s *Database) GetSentTransactionHashes() ([]giota.Trytes, error)
- func (s *Database) GetTransactions(txns []giota.Trytes) ([]*giota.Transaction, error)
- func (s *Database) GetUnconfirmedTransactionHashes() ([]giota.Trytes, error)
- func (s *Database) LogSentTransactions(txns []giota.Transaction)
- func (s *Database) RemoveConfirmedTransactions(txns []giota.Trytes) error
- func (s *Database) StoreTransactions(txns []giota.Transaction)
- type Metric
- type MetricType
- type Node
- type Option
- func ToAddress(addr string) Option
- func WithCooldown(cooldown time.Duration) Option
- func WithDatabase(db *Database) Option
- func WithDepth(depth int64) Option
- func WithLocalPoW(localPoW bool) Option
- func WithMWM(mwm int64) Option
- func WithMessage(msg string) Option
- func WithMessageMetrics(m bool) Option
- func WithMetricsRelay(relay chan<- Metric) Option
- func WithNode(node string, attachToTangle bool) Option
- func WithNodes(nodes []Node) Option
- func WithPoW(pow giota.PowFunc) Option
- func WithSecurityLevel(securityLvl SecurityLevel) Option
- func WithStrategy(strategy string) Option
- func WithTag(tag string) Option
- func WithTimeout(timeout time.Duration) Option
- func WithVerboseLogging(verboseLogging bool) Option
- type SecurityLevel
- type Spammer
- type Summary
- type TXData
- type Tips
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { *bolt.DB // contains filtered or unexported fields }
func NewDatabase ¶
func NewDatabase(db *bolt.DB) *Database
func (*Database) GetSentTransactionHashes ¶
Returns all sent transactions from the current run
func (*Database) GetTransactions ¶
Gets the full transaction data for the supplied txns
func (*Database) GetUnconfirmedTransactionHashes ¶ added in v0.1.1
Returns all sent transactions from the current run
func (*Database) LogSentTransactions ¶
func (s *Database) LogSentTransactions(txns []giota.Transaction)
func (*Database) RemoveConfirmedTransactions ¶ added in v0.1.1
Returns all sent transactions from the current run
func (*Database) StoreTransactions ¶
func (s *Database) StoreTransactions(txns []giota.Transaction)
Save the transactions to the database cache
type Metric ¶
type Metric struct { Kind MetricType `json:"kind" bson:"kind"` Data interface{} `json:"data" bson:"data"` }
type MetricType ¶
type MetricType byte
const ( INC_MILESTONE_BRANCH MetricType = iota INC_MILESTONE_TRUNK INC_BAD_TRUNK INC_BAD_BRANCH INC_BAD_TRUNK_AND_BRANCH INC_FAILED_TX INC_SUCCESSFUL_TX INC_NEW_CACHED_TX INC_GET_CACHED_TX INC_CONFIRMED_TX SET_CONFIRMATION_RATE SUMMARY )
type Option ¶
func WithCooldown ¶
func WithDatabase ¶
func WithLocalPoW ¶
func WithMessage ¶
func WithMessageMetrics ¶
func WithMetricsRelay ¶
func WithSecurityLevel ¶
func WithSecurityLevel(securityLvl SecurityLevel) Option
func WithStrategy ¶
func WithTimeout ¶
func WithVerboseLogging ¶
type SecurityLevel ¶
type SecurityLevel byte
const ( SECURITY_LVL_LOW SecurityLevel = 1 // 81-trits (low) SECURITY_LVL_MEDIUM SecurityLevel = 2 // 162-trits (medium) SECURITY_LVL_HIGH SecurityLevel = 3 // 243-trits (high) )
type Spammer ¶
func (*Spammer) UpdateConfirmedTransactions ¶ added in v0.1.1
func (*Spammer) UpdateSettings ¶
type Summary ¶
type Summary struct { TXsSucceeded int `json:"txs_succeeded"` TXsFailed int `json:"txs_failed"` BadBranch int `json:"bad_branch"` BadTrunk int `json:"bad_trunk"` BadTrunkAndBranch int `json:"bad_trunk_and_branch"` MilestoneTrunk int `json:"milestone_trunk"` MilestoneBranch int `json:"milestone_branch"` TPS float64 `json:"tps"` ErrorRate float64 `json:"error_rate"` CachedTX int `json:"cached_tx"` RetrievedTX int `json:"new_tx"` ConfirmedTX int `json:"confirmed_tx"` ConfirmationRate float64 `json:"confirmation_rate"` }
type Transaction ¶
type Transaction struct {
Trunk, Branch giota.Trytes
Transactions []giota.Transaction
}