Documentation ¶
Index ¶
- Constants
- type ActivateAccountOperationElem
- type BalanceUpdate
- type BalanceUpdates
- type BalanceUpdatesOperation
- type BalanceUpdatesOperationMetadata
- type Ballot
- type BallotListing
- type BallotOperationElem
- type Ballots
- type BigInt
- type Block
- type BlockHeaderMetadata
- type BlockHeaderMetadataLevel
- type BlockInfo
- type BootstrappedBlock
- type ContractBalanceUpdate
- type DelegationOperationElem
- type DelegationOperationMetadata
- type DelegationOperationResult
- type DoubleBakingEvidenceOperationElem
- type DoubleEndorsementEvidenceOperationElem
- type EndorsementOperationElem
- type EndorsementOperationMetadata
- type Error
- type Errors
- type ForkingTestChainStatus
- type FreezerBalanceUpdate
- type GenericBalanceUpdate
- type GenericError
- type GenericOperationElem
- type GenericTestChainStatus
- type HTTPError
- type HTTPStatus
- type HexBytes
- type IDTimestamp
- type InlinedEndorsement
- type InlinedEndorsementContents
- type InvalidBlock
- type Logger
- type MaxOperationListLength
- type MempoolOperations
- type NetworkAddress
- type NetworkConnection
- type NetworkConnectionTimestamp
- type NetworkMetadata
- type NetworkPeer
- type NetworkPeerLogEntry
- type NetworkPoint
- type NetworkPointLogEntry
- type NetworkPointState
- type NetworkStats
- type NetworkVersion
- type NotRunningTestChainStatus
- type Operation
- type OperationAlt
- type OperationElem
- type OperationElements
- type OperationWithError
- type OperationWithErrorAlt
- type OperationWithFee
- type OriginationOperationElem
- type OriginationOperationMetadata
- type OriginationOperationResult
- type PeriodKind
- type Proposal
- type ProposalOperationElem
- type RPCClient
- type RPCError
- type RawBlockHeader
- type RevealOperationElem
- type RevealOperationMetadata
- type RunningTestChainStatus
- type ScriptedContracts
- type SeedNonceRevelationOperationElem
- type Service
- func (s *Service) BanNetworkPeer(ctx context.Context, peerID string) error
- func (s *Service) BanNetworkPoint(ctx context.Context, address string) error
- func (s *Service) ConnectToNetworkPoint(ctx context.Context, address string, timeout time.Duration) error
- func (s *Service) GetBallotList(ctx context.Context, chainID, blockID string) ([]*Ballot, error)
- func (s *Service) GetBallotListings(ctx context.Context, chainID, blockID string) ([]*BallotListing, error)
- func (s *Service) GetBallots(ctx context.Context, chainID, blockID string) (*Ballots, error)
- func (s *Service) GetBlock(ctx context.Context, chainID, blockID string) (*Block, error)
- func (s *Service) GetContractBalance(ctx context.Context, chainID string, blockID string, contractID string) (*big.Int, error)
- func (s *Service) GetCurrentPeriodKind(ctx context.Context, chainID, blockID string) (PeriodKind, error)
- func (s *Service) GetCurrentProposals(ctx context.Context, chainID, blockID string) (string, error)
- func (s *Service) GetCurrentQuorum(ctx context.Context, chainID, blockID string) (int, error)
- func (s *Service) GetDelegateBalance(ctx context.Context, chainID string, blockID string, pkh string) (*big.Int, error)
- func (s *Service) GetInvalidBlocks(ctx context.Context, chainID string) ([]*InvalidBlock, error)
- func (s *Service) GetMempoolPendingOperations(ctx context.Context, chainID string) (*MempoolOperations, error)
- func (s *Service) GetNetworkConnections(ctx context.Context) ([]*NetworkConnection, error)
- func (s *Service) GetNetworkPeer(ctx context.Context, peerID string) (*NetworkPeer, error)
- func (s *Service) GetNetworkPeerBanned(ctx context.Context, peerID string) (bool, error)
- func (s *Service) GetNetworkPeerLog(ctx context.Context, peerID string) ([]*NetworkPeerLogEntry, error)
- func (s *Service) GetNetworkPeers(ctx context.Context, filter string) ([]*NetworkPeer, error)
- func (s *Service) GetNetworkPoint(ctx context.Context, address string) (*NetworkPoint, error)
- func (s *Service) GetNetworkPointBanned(ctx context.Context, address string) (bool, error)
- func (s *Service) GetNetworkPointLog(ctx context.Context, address string) ([]*NetworkPointLogEntry, error)
- func (s *Service) GetNetworkPoints(ctx context.Context, filter string) ([]*NetworkPoint, error)
- func (s *Service) GetNetworkStats(ctx context.Context) (*NetworkStats, error)
- func (s *Service) GetProposals(ctx context.Context, chainID, blockID string) ([]*Proposal, error)
- func (s *Service) MonitorBootstrapped(ctx context.Context, results chan<- *BootstrappedBlock) error
- func (s *Service) MonitorHeads(ctx context.Context, chainID string, results chan<- *BlockInfo) error
- func (s *Service) MonitorMempoolOperations(ctx context.Context, chainID, filter string, results chan<- []*Operation) error
- func (s *Service) MonitorNetworkPeerLog(ctx context.Context, peerID string, results chan<- []*NetworkPeerLogEntry) error
- func (s *Service) MonitorNetworkPointLog(ctx context.Context, address string, results chan<- []*NetworkPointLogEntry) error
- func (s *Service) TrustNetworkPeer(ctx context.Context, peerID string) error
- func (s *Service) TrustNetworkPoint(ctx context.Context, address string) error
- type TestChainStatus
- type TransactionOperationElem
- type TransactionOperationMetadata
- type TransactionOperationResult
Constants ¶
const ( // ErrorKindPermanent Tezos RPC error kind. ErrorKindPermanent = "permanent" // ErrorKindTemporary Tezos RPC error kind. ErrorKindTemporary = "temporary" // ErrorKindBranch Tezos RPC error kind. ErrorKindBranch = "branch" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivateAccountOperationElem ¶
type ActivateAccountOperationElem struct { GenericOperationElem `yaml:",inline"` PKH string `json:"pkh" yaml:"pkh"` Secret string `json:"secret" yaml:"secret"` Metadata BalanceUpdatesOperationMetadata `json:"metadata" yaml:"metadata"` }
ActivateAccountOperationElem represents activate_account operation
func (*ActivateAccountOperationElem) BalanceUpdates ¶
func (el *ActivateAccountOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
type BalanceUpdate ¶
type BalanceUpdate interface {
BalanceUpdateKind() string
}
BalanceUpdate is a variable structure depending on the Kind field
type BalanceUpdates ¶
type BalanceUpdates []BalanceUpdate
BalanceUpdates is a list of balance update operations
func (*BalanceUpdates) UnmarshalJSON ¶
func (b *BalanceUpdates) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type BalanceUpdatesOperation ¶
type BalanceUpdatesOperation interface {
BalanceUpdates() BalanceUpdates
}
BalanceUpdatesOperation is implemented by operations providing balance updates
type BalanceUpdatesOperationMetadata ¶
type BalanceUpdatesOperationMetadata struct {
BalanceUpdates BalanceUpdates `json:"balance_updates" yaml:"balance_updates"`
}
BalanceUpdatesOperationMetadata contains balance updates only
type Ballot ¶
type Ballot struct { PKH string `json:"pkh" yaml:"pkh"` Ballot string `json:"ballot" yaml:"ballot"` }
Ballot holds information about a Tezos ballot
type BallotListing ¶
type BallotListing struct { PKH string `json:"pkh" yaml:"pkh"` Rolls int64 `json:"rolls" yaml:"rolls"` }
BallotListing holds information about a Tezos delegate and his voting weight in rolls
type BallotOperationElem ¶
type BallotOperationElem struct { GenericOperationElem `yaml:",inline"` Source string `json:"source" yaml:"source"` Period int `json:"period" yaml:"period"` Proposal string `json:"proposal" yaml:"proposal"` Ballot string `json:"ballot" yaml:"ballot"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` }
BallotOperationElem represents a ballot operation
type Ballots ¶
type Ballots struct { Yay int64 `json:"yay" yaml:"yay"` Nay int64 `json:"nay" yaml:"nay"` Pass int64 `json:"pass" yaml:"pass"` }
Ballots holds summary data about a voting period
type BigInt ¶
BigInt overrides UnmarshalJSON for big.Int
func (*BigInt) MarshalYAML ¶
MarshalYAML implements yaml.Marshaler
func (*BigInt) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type Block ¶
type Block struct { Protocol string `json:"protocol" yaml:"protocol"` ChainID string `json:"chain_id" yaml:"chain_id"` Hash string `json:"hash" yaml:"hash"` Header RawBlockHeader `json:"header" yaml:"header"` Metadata BlockHeaderMetadata `json:"metadata" yaml:"metadata"` Operations [][]*Operation `json:"operations" yaml:"operations"` }
Block holds information about a Tezos block
type BlockHeaderMetadata ¶
type BlockHeaderMetadata struct { Protocol string `json:"protocol" yaml:"protocol"` NextProtocol string `json:"next_protocol" yaml:"next_protocol"` TestChainStatus TestChainStatus `json:"-" yaml:"-"` MaxOperationsTTL int `json:"max_operations_ttl" yaml:"max_operations_ttl"` MaxOperationDataLength int `json:"max_operation_data_length" yaml:"max_operation_data_length"` MaxBlockHeaderLength int `json:"max_block_header_length" yaml:"max_block_header_length"` MaxOperationListLength []*MaxOperationListLength `json:"max_operation_list_length" yaml:"max_operation_list_length"` Baker string `json:"baker" yaml:"baker"` Level BlockHeaderMetadataLevel `json:"level" yaml:"level"` VotingPeriodKind string `json:"voting_period_kind" yaml:"voting_period_kind"` NonceHash string `json:"nonce_hash" yaml:"nonce_hash"` ConsumedGas *BigInt `json:"consumed_gas" yaml:"consumed_gas"` Deactivated []string `json:"deactivated" yaml:"deactivated"` BalanceUpdates BalanceUpdates `json:"balance_updates" yaml:"balance_updates"` }
BlockHeaderMetadata is a part of the Tezos block data
func (*BlockHeaderMetadata) UnmarshalJSON ¶
func (bhm *BlockHeaderMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the BlockHeaderMetadata JSON
type BlockHeaderMetadataLevel ¶
type BlockHeaderMetadataLevel struct { Level int `json:"level" yaml:"level"` LevelPosition int `json:"level_position" yaml:"level_position"` Cycle int `json:"cycle" yaml:"cycle"` CyclePosition int `json:"cycle_position" yaml:"cycle_position"` VotingPeriod int `json:"voting_period" yaml:"voting_period"` VotingPeriodPosition int `json:"voting_period_position" yaml:"voting_period_position"` ExpectedCommitment bool `json:"expected_commitment" yaml:"expected_commitment"` }
BlockHeaderMetadataLevel is a part of BlockHeaderMetadata
type BlockInfo ¶
type BlockInfo struct { Hash string `json:"hash" yaml:"hash"` Level int `json:"level" yaml:"level"` Proto int `json:"proto" yaml:"proto"` Predecessor string `json:"predecessor" yaml:"predecessor"` Timestamp time.Time `json:"timestamp" yaml:"timestamp"` ValidationPass int `json:"validation_pass" yaml:"validation_pass"` OperationsHash string `json:"operations_hash" yaml:"operations_hash"` Fitness []HexBytes `json:"fitness" yaml:"fitness,flow"` Context string `json:"context" yaml:"context"` ProtocolData string `json:"protocol_data" yaml:"protocol_data"` }
BlockInfo holds information about block returned by monitor heads endpoint
type BootstrappedBlock ¶
type BootstrappedBlock struct { Block string `json:"block"` Timestamp time.Time `json:"timestamp"` }
BootstrappedBlock represents bootstrapped block stream message
type ContractBalanceUpdate ¶
type ContractBalanceUpdate struct { GenericBalanceUpdate `yaml:",inline"` Contract string `json:"contract" yaml:"contract"` }
ContractBalanceUpdate is a BalanceUpdatesType variant for Kind=contract
type DelegationOperationElem ¶
type DelegationOperationElem struct { GenericOperationElem `yaml:",inline"` Source string `json:"source" yaml:"source"` Fee *BigInt `json:"fee" yaml:"fee"` Counter *BigInt `json:"counter" yaml:"counter"` GasLimit *BigInt `json:"gas_limit" yaml:"gas_limit"` StorageLimit *BigInt `json:"storage_limit" yaml:"storage_limit"` ManagerPubKey string `json:"managerPubkey" yaml:"managerPubkey"` Balance *BigInt `json:"balance" yaml:"balance"` Spendable *bool `json:"spendable,omitempty" yaml:"spendable,omitempty"` Delegatable *bool `json:"delegatable,omitempty" yaml:"delegatable,omitempty"` Delegate string `json:"delegate,omitempty" yaml:"delegate,omitempty"` Script *ScriptedContracts `json:"script,omitempty" yaml:"script,omitempty"` Metadata DelegationOperationMetadata `json:"metadata" yaml:"metadata"` }
DelegationOperationElem represents a delegation operation
func (*DelegationOperationElem) BalanceUpdates ¶
func (el *DelegationOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
func (*DelegationOperationElem) OperationFee ¶
func (el *DelegationOperationElem) OperationFee() *big.Int
OperationFee implements OperationWithFee
type DelegationOperationMetadata ¶
type DelegationOperationMetadata struct { BalanceUpdates BalanceUpdates `json:"balance_updates" yaml:"balance_updates"` OperationResult DelegationOperationResult `json:"operation_result" yaml:"operation_result"` }
DelegationOperationMetadata represents a delegation operation metadata
type DelegationOperationResult ¶
type DelegationOperationResult struct { Status string `json:"status" yaml:"status"` Errors Errors `json:"errors" yaml:"errors"` }
DelegationOperationResult represents a delegation operation result
type DoubleBakingEvidenceOperationElem ¶
type DoubleBakingEvidenceOperationElem struct { GenericOperationElem `yaml:",inline"` BlockHeader1 RawBlockHeader `json:"bh1" yaml:"bh1"` BlockHeader2 RawBlockHeader `json:"bh2" yaml:"bh2"` Metadata BalanceUpdatesOperationMetadata `json:"metadata" yaml:"metadata"` }
DoubleBakingEvidenceOperationElem represents double_baking_evidence operation
func (*DoubleBakingEvidenceOperationElem) BalanceUpdates ¶
func (el *DoubleBakingEvidenceOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
type DoubleEndorsementEvidenceOperationElem ¶
type DoubleEndorsementEvidenceOperationElem struct { GenericOperationElem `yaml:",inline"` Operation1 InlinedEndorsement `json:"op1" yaml:"op1"` Operation2 InlinedEndorsement `json:"op2" yaml:"op2"` Metadata BalanceUpdatesOperationMetadata `json:"metadata" yaml:"metadata"` }
DoubleEndorsementEvidenceOperationElem represents double_endorsement_evidence operation
func (*DoubleEndorsementEvidenceOperationElem) BalanceUpdates ¶
func (el *DoubleEndorsementEvidenceOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
type EndorsementOperationElem ¶
type EndorsementOperationElem struct { GenericOperationElem `yaml:",inline"` Level int `json:"level" yaml:"level"` Metadata EndorsementOperationMetadata `json:"metadata" yaml:"metadata"` }
EndorsementOperationElem represents an endorsement operation
func (*EndorsementOperationElem) BalanceUpdates ¶
func (el *EndorsementOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
type EndorsementOperationMetadata ¶
type EndorsementOperationMetadata struct { BalanceUpdates BalanceUpdates `json:"balance_updates" yaml:"balance_updates"` Delegate string `json:"delegate" yaml:"delegate"` Slots []int `json:"slots" yaml:"slots,flow"` }
EndorsementOperationMetadata represents an endorsement operation metadata
type Error ¶
Error is a Tezos error as documented on http://tezos.gitlab.io/mainnet/api/errors.html.
type Errors ¶
type Errors []Error
Errors is a slice of Error with custom JSON unmarshaller
func (*Errors) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type ForkingTestChainStatus ¶
type ForkingTestChainStatus struct { GenericTestChainStatus Protocol string `json:"protocol" yaml:"protocol"` Expiration string `json:"expiration" yaml:"expiration"` }
ForkingTestChainStatus is a TestChainStatus variant for Status=forking
type FreezerBalanceUpdate ¶
type FreezerBalanceUpdate struct { GenericBalanceUpdate `yaml:",inline"` Category string `json:"category" yaml:"category"` Delegate string `json:"delegate" yaml:"delegate"` Level int `json:"level" yaml:"level"` }
FreezerBalanceUpdate is a BalanceUpdatesType variant for Kind=freezer
type GenericBalanceUpdate ¶
type GenericBalanceUpdate struct { Kind string `json:"kind" yaml:"kind"` Change int64 `json:"change,string" yaml:"change"` }
GenericBalanceUpdate holds the common values among all BalanceUpdatesType variants
func (*GenericBalanceUpdate) BalanceUpdateKind ¶
func (g *GenericBalanceUpdate) BalanceUpdateKind() string
BalanceUpdateKind returns the BalanceUpdateType's Kind field
type GenericError ¶
GenericError is a basic error type
func (*GenericError) Error ¶
func (e *GenericError) Error() string
func (*GenericError) ErrorID ¶
func (e *GenericError) ErrorID() string
ErrorID returns Tezos error id
func (*GenericError) ErrorKind ¶
func (e *GenericError) ErrorKind() string
ErrorKind returns Tezos error kind
type GenericOperationElem ¶
type GenericOperationElem struct {
Kind string `json:"kind" yaml:"kind"`
}
GenericOperationElem is a most generic element type
func (*GenericOperationElem) OperationElemKind ¶
func (e *GenericOperationElem) OperationElemKind() string
OperationElemKind implements OperationElem
type GenericTestChainStatus ¶
type GenericTestChainStatus struct {
Status string `json:"status" yaml:"status"`
}
GenericTestChainStatus holds the common values among all TestChainStatus variants
func (*GenericTestChainStatus) TestChainStatus ¶
func (t *GenericTestChainStatus) TestChainStatus() string
TestChainStatus gets the TestChainStatus's Status field
type HTTPStatus ¶
type HTTPStatus interface { Response() *http.Response Status() string // e.g. "200 OK" StatusCode() int // e.g. 200 Body() []byte }
HTTPStatus interface represents an unprocessed HTTP reply
type HexBytes ¶
type HexBytes []byte
HexBytes represents bytes as a JSON string of hexadecimal digits
func (*HexBytes) UnmarshalText ¶
UnmarshalText umarshalls a hex string to bytes
type IDTimestamp ¶
IDTimestamp represents peer id with timestamp
func (*IDTimestamp) UnmarshalJSON ¶
func (i *IDTimestamp) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type InlinedEndorsement ¶
type InlinedEndorsement struct { Branch string `json:"branch" yaml:"branch"` Operations InlinedEndorsementContents `json:"operations" yaml:"operations"` Signature string `json:"signature" yaml:"signature"` }
InlinedEndorsement corresponds to $inlined.endorsement
type InlinedEndorsementContents ¶
type InlinedEndorsementContents struct { Kind string `json:"endorsement" yaml:"endorsement"` Level int `json:"level" yaml:"level"` }
InlinedEndorsementContents corresponds to $inlined.endorsement.contents
type InvalidBlock ¶
type InvalidBlock struct { Block string `json:"block"` Level int `json:"level"` Error Errors `json:"error"` }
InvalidBlock represents invalid block hash along with the errors that led to it being declared invalid
type Logger ¶
type Logger interface { log.FieldLogger Writer() *io.PipeWriter WriterLevel(level log.Level) *io.PipeWriter }
Logger is an extension to logrus.FieldLogger
type MaxOperationListLength ¶
type MaxOperationListLength struct { MaxSize int `json:"max_size" yaml:"max_size"` MaxOp int `json:"max_op" yaml:"max_op"` }
MaxOperationListLength is a part of the BlockHeaderMetadata
type MempoolOperations ¶
type MempoolOperations struct { Applied []*Operation `json:"applied"` Refused []*OperationWithErrorAlt `json:"refused"` BranchRefused []*OperationWithErrorAlt `json:"branch_refused"` BranchDelayed []*OperationWithErrorAlt `json:"branch_delayed"` Unprocessed []*OperationAlt `json:"unprocessed"` }
MempoolOperations represents mempool operations
type NetworkAddress ¶
NetworkAddress models a point's address and port.
type NetworkConnection ¶
type NetworkConnection struct { Incoming bool `json:"incoming"` PeerID string `json:"peer_id"` IDPoint NetworkAddress `json:"id_point"` RemoteSocketPort uint16 `json:"remote_socket_port"` Versions []*NetworkVersion `json:"versions"` Private bool `json:"private"` LocalMetadata NetworkMetadata `json:"local_metadata"` RemoteMetadata NetworkMetadata `json:"remote_metadata"` }
NetworkConnection models detailed information for one network connection.
type NetworkConnectionTimestamp ¶
type NetworkConnectionTimestamp struct { NetworkAddress Timestamp time.Time }
NetworkConnectionTimestamp represents peer address with timestamp added
func (*NetworkConnectionTimestamp) UnmarshalJSON ¶
func (n *NetworkConnectionTimestamp) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type NetworkMetadata ¶
type NetworkMetadata struct { DisableMempool bool `json:"disable_mempool"` PrivateNode bool `json:"private_node"` }
NetworkMetadata models metadata of a node.
type NetworkPeer ¶
type NetworkPeer struct { PeerID string `json:"-"` Score int64 `json:"score"` Trusted bool `json:"trusted"` ConnMetadata *NetworkMetadata `json:"conn_metadata"` State string `json:"state"` ReachableAt *NetworkAddress `json:"reachable_at"` Stat NetworkStats `json:"stat"` LastEstablishedConnection *NetworkConnectionTimestamp `json:"last_established_connection"` LastSeen *NetworkConnectionTimestamp `json:"last_seen"` LastFailedConnection *NetworkConnectionTimestamp `json:"last_failed_connection"` LastRejectedConnection *NetworkConnectionTimestamp `json:"last_rejected_connection"` LastDisconnection *NetworkConnectionTimestamp `json:"last_disconnection"` LastMiss *NetworkConnectionTimestamp `json:"last_miss"` }
NetworkPeer represents peer info
type NetworkPeerLogEntry ¶
type NetworkPeerLogEntry struct { NetworkAddress Kind string `json:"kind"` Timestamp time.Time `json:"timestamp"` }
NetworkPeerLogEntry represents peer log entry
type NetworkPoint ¶
type NetworkPoint struct { Address string `json:"-"` Trusted bool `json:"trusted"` GreylistedUntil time.Time `json:"greylisted_until"` State NetworkPointState `json:"state"` P2PPeerID string `json:"p2p_peer_id"` LastFailedConnection time.Time `json:"last_failed_connection"` LastRejectedConnection *IDTimestamp `json:"last_rejected_connection"` LastEstablishedConnection *IDTimestamp `json:"last_established_connection"` LastDisconnection *IDTimestamp `json:"last_disconnection"` LastSeen *IDTimestamp `json:"last_seen"` LastMiss time.Time `json:"last_miss"` }
NetworkPoint represents network point info
type NetworkPointLogEntry ¶
type NetworkPointLogEntry struct { Kind NetworkPointState `json:"kind"` Timestamp time.Time `json:"timestamp"` }
NetworkPointLogEntry represents point's log entry
type NetworkPointState ¶
type NetworkPointState struct { EventKind string `json:"event_kind"` P2PPeerID string `json:"p2p_peer_id"` }
NetworkPointState represents point state
type NetworkStats ¶
type NetworkStats struct { TotalBytesSent int64 `json:"total_sent,string"` TotalBytesRecv int64 `json:"total_recv,string"` CurrentInflow int64 `json:"current_inflow"` CurrentOutflow int64 `json:"current_outflow"` }
NetworkStats models global network bandwidth totals and usage in B/s.
type NetworkVersion ¶
type NetworkVersion struct { Name string `json:"name"` Major uint16 `json:"major"` Minor uint16 `json:"minor"` }
NetworkVersion models a network-layer version of a node.
type NotRunningTestChainStatus ¶
type NotRunningTestChainStatus struct {
GenericTestChainStatus
}
NotRunningTestChainStatus is a TestChainStatus variant for Status=not_running
type Operation ¶
type Operation struct { Protocol string `json:"protocol" yaml:"protocol"` ChainID string `json:"chain_id" yaml:"chain_id"` Hash string `json:"hash" yaml:"hash"` Branch string `json:"branch" yaml:"branch"` Contents OperationElements `json:"contents" yaml:"contents"` Signature string `json:"signature" yaml:"signature"` }
Operation represents an operation included into block
type OperationAlt ¶
type OperationAlt Operation
OperationAlt is a heterogeneously encoded Operation with hash as a first array member, i.e.
[ "...", // hash { "protocol": "...", ... } ]
instead of
{ "protocol": "...", "hash": "...", ... }
func (*OperationAlt) UnmarshalJSON ¶
func (o *OperationAlt) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type OperationElem ¶
type OperationElem interface {
OperationElemKind() string
}
OperationElem must be implemented by all operation elements
type OperationElements ¶
type OperationElements []OperationElem
OperationElements is a slice of OperationElem with custom JSON unmarshaller
func (*OperationElements) UnmarshalJSON ¶
func (e *OperationElements) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type OperationWithError ¶
OperationWithError represents unsuccessful operation
type OperationWithErrorAlt ¶
type OperationWithErrorAlt OperationWithError
OperationWithErrorAlt is a heterogeneously encoded OperationWithError with hash as a first array member. See OperationAlt for details
func (*OperationWithErrorAlt) UnmarshalJSON ¶
func (o *OperationWithErrorAlt) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type OperationWithFee ¶
OperationWithFee is implemented by operations with fees
type OriginationOperationElem ¶
type OriginationOperationElem struct { GenericOperationElem `yaml:",inline"` Source string `json:"source" yaml:"source"` Fee *BigInt `json:"fee" yaml:"fee"` Counter *BigInt `json:"counter" yaml:"counter"` GasLimit *BigInt `json:"gas_limit" yaml:"gas_limit"` StorageLimit *BigInt `json:"storage_limit" yaml:"storage_limit"` ManagerPubKey string `json:"managerPubkey" yaml:"managerPubkey"` Balance *BigInt `json:"balance" yaml:"balance"` Spendable *bool `json:"spendable,omitempty" yaml:"spendable,omitempty"` Delegatable *bool `json:"delegatable,omitempty" yaml:"delegatable,omitempty"` Delegate string `json:"delegate,omitempty" yaml:"delegate,omitempty"` Script *ScriptedContracts `json:"script,omitempty" yaml:"script,omitempty"` Metadata OriginationOperationMetadata `json:"metadata" yaml:"metadata"` }
OriginationOperationElem represents a origination operation
func (*OriginationOperationElem) BalanceUpdates ¶
func (el *OriginationOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
func (*OriginationOperationElem) OperationFee ¶
func (el *OriginationOperationElem) OperationFee() *big.Int
OperationFee implements OperationWithFee
type OriginationOperationMetadata ¶
type OriginationOperationMetadata struct { BalanceUpdates BalanceUpdates `json:"balance_updates" yaml:"balance_updates"` OperationResult OriginationOperationResult `json:"operation_result" yaml:"operation_result"` }
OriginationOperationMetadata represents a origination operation metadata
type OriginationOperationResult ¶
type OriginationOperationResult struct { Status string `json:"status" yaml:"status"` BalanceUpdates BalanceUpdates `json:"balance_updates,omitempty" yaml:"balance_updates,omitempty"` OriginatedContracts []string `json:"originated_contracts,omitempty" yaml:"originated_contracts,omitempty"` ConsumedGas *BigInt `json:"consumed_gas,omitempty" yaml:"consumed_gas,omitempty"` StorageSize *BigInt `json:"storage_size,omitempty" yaml:"storage_size,omitempty"` PaidStorageSizeDiff *BigInt `json:"paid_storage_size_diff,omitempty" yaml:"paid_storage_size_diff,omitempty"` Errors Errors `json:"errors,omitempty" yaml:"errors,omitempty"` }
OriginationOperationResult represents a origination operation result
type PeriodKind ¶
type PeriodKind string
PeriodKind contains information about tezos voting period kind
func (PeriodKind) IsPromotionVote ¶
func (p PeriodKind) IsPromotionVote() bool
IsPromotionVote true if period kind is promotion vote
func (PeriodKind) IsProposal ¶
func (p PeriodKind) IsProposal() bool
IsProposal return true if period kind is proposal
func (PeriodKind) IsTesting ¶
func (p PeriodKind) IsTesting() bool
IsTesting return true if period kind is testing
func (PeriodKind) IsTestingVote ¶
func (p PeriodKind) IsTestingVote() bool
IsTestingVote return true if period kind is testing vote
type ProposalOperationElem ¶
type ProposalOperationElem struct { GenericOperationElem `yaml:",inline"` Source string `json:"source" yaml:"source"` Period int `json:"period" yaml:"period"` Proposals []string `json:"proposals" yaml:"proposals"` Metadata map[string]interface{} `json:"metadata" yaml:"metadata"` }
ProposalOperationElem represents a proposal operation
type RPCClient ¶
type RPCClient struct { // Logger Logger Logger // HTTP transport used to communicate with the Tezos node API. Can be used for side effects. Transport http.RoundTripper // Base URL for API requests. BaseURL *url.URL // User agent name for client. UserAgent string }
RPCClient manages communication with a Tezos RPC server.
func NewRPCClient ¶
NewRPCClient returns a new Tezos RPC client.
type RPCError ¶
type RPCError interface { Error HTTPStatus Errors() []Error // returns all errors as a slice }
RPCError is a Tezos RPC error as documented on http://tezos.gitlab.io/mainnet/api/errors.html.
type RawBlockHeader ¶
type RawBlockHeader struct { Level int `json:"level" yaml:"level"` Proto int `json:"proto" yaml:"proto"` Predecessor string `json:"predecessor" yaml:"predecessor"` Timestamp time.Time `json:"timestamp" yaml:"timestamp"` ValidationPass int `json:"validation_pass" yaml:"validation_pass"` OperationsHash string `json:"operations_hash" yaml:"operations_hash"` Fitness []HexBytes `json:"fitness" yaml:"fitness,flow"` Context string `json:"context" yaml:"context"` Priority int `json:"priority" yaml:"priority"` ProofOfWorkNonce HexBytes `json:"proof_of_work_nonce" yaml:"proof_of_work_nonce,flow"` SeedNonceHash string `json:"seed_nonce_hash" yaml:"seed_nonce_hash"` Signature string `json:"signature" yaml:"signature"` }
RawBlockHeader is a part of the Tezos block data
type RevealOperationElem ¶
type RevealOperationElem struct { GenericOperationElem `yaml:",inline"` Source string `json:"source" yaml:"source"` Fee *BigInt `json:"fee" yaml:"fee"` Counter *BigInt `json:"counter" yaml:"counter"` GasLimit *BigInt `json:"gas_limit" yaml:"gas_limit"` StorageLimit *BigInt `json:"storage_limit" yaml:"storage_limit"` PublicKey string `json:"public_key" yaml:"public_key"` Metadata RevealOperationMetadata `json:"metadata" yaml:"metadata"` }
RevealOperationElem represents a reveal operation
func (*RevealOperationElem) BalanceUpdates ¶
func (el *RevealOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
func (*RevealOperationElem) OperationFee ¶
func (el *RevealOperationElem) OperationFee() *big.Int
OperationFee implements OperationWithFee
type RevealOperationMetadata ¶
type RevealOperationMetadata DelegationOperationMetadata
RevealOperationMetadata represents a reveal operation metadata
type RunningTestChainStatus ¶
type RunningTestChainStatus struct { GenericTestChainStatus ChainID string `json:"chain_id" yaml:"chain_id"` Genesis string `json:"genesis" yaml:"genesis"` Protocol string `json:"protocol" yaml:"protocol"` Expiration string `json:"expiration" yaml:"expiration"` }
RunningTestChainStatus is a TestChainStatus variant for Status=running
type ScriptedContracts ¶
type ScriptedContracts struct { Code map[string]interface{} `json:"code" yaml:"code"` Storage map[string]interface{} `json:"storage" yaml:"storage"` }
ScriptedContracts corresponds to $scripted.contracts
type SeedNonceRevelationOperationElem ¶
type SeedNonceRevelationOperationElem struct { GenericOperationElem `yaml:",inline"` Level int32 `json:"level" yaml:"level"` Nonce string `json:"nonce" yaml:"nonce"` Metadata BalanceUpdatesOperationMetadata `json:"metadata" yaml:"metadata"` }
SeedNonceRevelationOperationElem represents seed_nonce_revelation operation
func (*SeedNonceRevelationOperationElem) BalanceUpdates ¶
func (el *SeedNonceRevelationOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
type Service ¶
type Service struct {
Client *RPCClient
}
Service implements fetching of information from Tezos nodes via JSON.
func (*Service) BanNetworkPeer ¶
BanNetworkPeer blacklists the given peer. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-ban
func (*Service) BanNetworkPoint ¶
BanNetworkPoint blacklists the given address. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points-point-ban
func (*Service) ConnectToNetworkPoint ¶
func (s *Service) ConnectToNetworkPoint(ctx context.Context, address string, timeout time.Duration) error
ConnectToNetworkPoint used to connect to a peer. https://tezos.gitlab.io/mainnet/api/rpc.html#put-network-points-point
func (*Service) GetBallotList ¶
GetBallotList returns ballots casted so far during a voting period. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-ballot-list
func (*Service) GetBallotListings ¶
func (s *Service) GetBallotListings(ctx context.Context, chainID, blockID string) ([]*BallotListing, error)
GetBallotListings returns a list of delegates with their voting weight, in number of rolls. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-listings
func (*Service) GetBallots ¶
GetBallots returns sum of ballots casted so far during a voting period. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-ballots
func (*Service) GetBlock ¶
GetBlock returns information about a Tezos block https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id
func (*Service) GetContractBalance ¶
func (s *Service) GetContractBalance(ctx context.Context, chainID string, blockID string, contractID string) (*big.Int, error)
GetContractBalance returns a contract's balance http://tezos.gitlab.io/mainnet/api/rpc.html#get-block-id-context-contracts-contract-id-balance
func (*Service) GetCurrentPeriodKind ¶
func (s *Service) GetCurrentPeriodKind(ctx context.Context, chainID, blockID string) (PeriodKind, error)
GetCurrentPeriodKind returns the current period kind https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-current-period-kind
func (*Service) GetCurrentProposals ¶
GetCurrentProposals returns the current proposal under evaluation. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-current-proposal
func (*Service) GetCurrentQuorum ¶
GetCurrentQuorum returns the current expected quorum. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-current-quorum
func (*Service) GetDelegateBalance ¶
func (s *Service) GetDelegateBalance(ctx context.Context, chainID string, blockID string, pkh string) (*big.Int, error)
GetDelegateBalance returns a delegate's balance http://tezos.gitlab.io/mainnet/api/rpc.html#get-block-id-context-delegates-pkh-balance
func (*Service) GetInvalidBlocks ¶
GetInvalidBlocks lists blocks that have been declared invalid along with the errors that led to them being declared invalid. https://tezos.gitlab.io/alphanet/api/rpc.html#get-chains-chain-id-invalid-blocks
func (*Service) GetMempoolPendingOperations ¶
func (s *Service) GetMempoolPendingOperations(ctx context.Context, chainID string) (*MempoolOperations, error)
GetMempoolPendingOperations returns mempool pending operations
func (*Service) GetNetworkConnections ¶
func (s *Service) GetNetworkConnections(ctx context.Context) ([]*NetworkConnection, error)
GetNetworkConnections returns all network connections http://tezos.gitlab.io/mainnet/api/rpc.html#get-network-connections
func (*Service) GetNetworkPeer ¶
GetNetworkPeer returns details about a given peer. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id
func (*Service) GetNetworkPeerBanned ¶
GetNetworkPeerBanned checks if a given peer is blacklisted or greylisted. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-banned
func (*Service) GetNetworkPeerLog ¶
func (s *Service) GetNetworkPeerLog(ctx context.Context, peerID string) ([]*NetworkPeerLogEntry, error)
GetNetworkPeerLog monitors network events related to a given peer. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-log
func (*Service) GetNetworkPeers ¶
GetNetworkPeers returns the list the peers the node ever met. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers
func (*Service) GetNetworkPoint ¶
GetNetworkPoint returns details about a given `IP:addr`. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points-point
func (*Service) GetNetworkPointBanned ¶
GetNetworkPointBanned check is a given address is blacklisted or greylisted. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points-point-banned
func (*Service) GetNetworkPointLog ¶
func (s *Service) GetNetworkPointLog(ctx context.Context, address string) ([]*NetworkPointLogEntry, error)
GetNetworkPointLog monitors network events related to an `IP:addr`. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-log
func (*Service) GetNetworkPoints ¶
GetNetworkPoints returns list the pool of known `IP:port` used for establishing P2P connections. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points
func (*Service) GetNetworkStats ¶
func (s *Service) GetNetworkStats(ctx context.Context) (*NetworkStats, error)
GetNetworkStats returns current network stats https://tezos.gitlab.io/betanet/api/rpc.html#get-network-stat
func (*Service) GetProposals ¶
GetProposals returns a list of proposals with number of supporters. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-proposals
func (*Service) MonitorBootstrapped ¶
func (s *Service) MonitorBootstrapped(ctx context.Context, results chan<- *BootstrappedBlock) error
MonitorBootstrapped reads from the bootstrapped blocks stream http://tezos.gitlab.io/mainnet/api/rpc.html#get-monitor-bootstrapped
func (*Service) MonitorHeads ¶
func (s *Service) MonitorHeads(ctx context.Context, chainID string, results chan<- *BlockInfo) error
MonitorHeads reads from the heads blocks stream https://tezos.gitlab.io/mainnet/api/rpc.html#get-monitor-heads-chain-id
func (*Service) MonitorMempoolOperations ¶
func (s *Service) MonitorMempoolOperations(ctx context.Context, chainID, filter string, results chan<- []*Operation) error
MonitorMempoolOperations monitors mempool pending operations. The connection is closed after every new block.
func (*Service) MonitorNetworkPeerLog ¶
func (s *Service) MonitorNetworkPeerLog(ctx context.Context, peerID string, results chan<- []*NetworkPeerLogEntry) error
MonitorNetworkPeerLog monitors network events related to a given peer. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-log
func (*Service) MonitorNetworkPointLog ¶
func (s *Service) MonitorNetworkPointLog(ctx context.Context, address string, results chan<- []*NetworkPointLogEntry) error
MonitorNetworkPointLog monitors network events related to an `IP:addr`. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-log
func (*Service) TrustNetworkPeer ¶
TrustNetworkPeer used to trust a given peer permanently: the peer cannot be blocked (but its host IP still can). https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-trust
func (*Service) TrustNetworkPoint ¶
TrustNetworkPoint used to trust a given address permanently. Connections from this address can still be closed on authentication if the peer is blacklisted or greylisted. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points-point-trust
type TestChainStatus ¶
type TestChainStatus interface {
TestChainStatus() string
}
TestChainStatus is a variable structure depending on the Status field
type TransactionOperationElem ¶
type TransactionOperationElem struct { GenericOperationElem `yaml:",inline"` Source string `json:"source" yaml:"source"` Fee *BigInt `json:"fee" yaml:"fee"` Counter *BigInt `json:"counter" yaml:"counter"` GasLimit *BigInt `json:"gas_limit" yaml:"gas_limit"` StorageLimit *BigInt `json:"storage_limit" yaml:"storage_limit"` Amount *BigInt `json:"amount" yaml:"amount"` Destination string `json:"destination" yaml:"destination"` Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"` Metadata TransactionOperationMetadata `json:"metadata" yaml:"metadata"` }
TransactionOperationElem represents a transaction operation
func (*TransactionOperationElem) BalanceUpdates ¶
func (el *TransactionOperationElem) BalanceUpdates() BalanceUpdates
BalanceUpdates implements BalanceUpdateOperation
func (*TransactionOperationElem) OperationFee ¶
func (el *TransactionOperationElem) OperationFee() *big.Int
OperationFee implements OperationWithFee
type TransactionOperationMetadata ¶
type TransactionOperationMetadata struct { BalanceUpdates BalanceUpdates `json:"balance_updates" yaml:"balance_updates"` OperationResult TransactionOperationResult `json:"operation_result" yaml:"operation_result"` }
TransactionOperationMetadata represents a transaction operation metadata
type TransactionOperationResult ¶
type TransactionOperationResult struct { Status string `json:"status" yaml:"status"` Storage map[string]interface{} `json:"storage,omitempty" yaml:"storage,omitempty"` BalanceUpdates BalanceUpdates `json:"balance_updates,omitempty" yaml:"balance_updates,omitempty"` OriginatedContracts []string `json:"originated_contracts,omitempty" yaml:"originated_contracts,omitempty"` ConsumedGas *BigInt `json:"consumed_gas,omitempty" yaml:"consumed_gas,omitempty"` StorageSize *BigInt `json:"storage_size,omitempty" yaml:"storage_size,omitempty"` PaidStorageSizeDiff *BigInt `json:"paid_storage_size_diff,omitempty" yaml:"paid_storage_size_diff,omitempty"` Errors Errors `json:"errors,omitempty" yaml:"errors,omitempty"` }
TransactionOperationResult represents a transaction operation result