go-tezos: github.com/ecadlabs/go-tezos Index | Files

package tezos

import "github.com/ecadlabs/go-tezos"

Index

Package Files

block.go client.go errors.go operations.go service.go utils.go votes.go

Constants

const (
    // ErrorKindPermanent Tezos RPC error kind.
    ErrorKindPermanent = "permanent"
    // ErrorKindTemporary Tezos RPC error kind.
    ErrorKindTemporary = "temporary"
    // ErrorKindBranch Tezos RPC error kind.
    ErrorKindBranch = "branch"
)

type BalanceChange Uses

type BalanceChange int64

BalanceChange is a string encoded int64

func (*BalanceChange) UnmarshalJSON Uses

func (b *BalanceChange) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements json.Unmarshaler

type BalanceUpdate Uses

type BalanceUpdate interface {
    BalanceUpdateKind() string
}

BalanceUpdate is a variable structure depending on the Kind field

type BalanceUpdates Uses

type BalanceUpdates []BalanceUpdate

BalanceUpdates is a list of balance update operations

func (*BalanceUpdates) UnmarshalJSON Uses

func (b *BalanceUpdates) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type Ballot Uses

type Ballot struct {
    PKH    string `json:"pkh"`
    Ballot string `json:"ballot"`
}

Ballot holds information about a Tezos ballot

type BallotListing Uses

type BallotListing struct {
    PKH   string `json:"pkh"`
    Rolls int64  `json:"rolls"`
}

BallotListing holds information about a Tezos delegate and his voting weight in rolls

type BallotOperationElem Uses

type BallotOperationElem struct {
    GenericOperationElem
    Source   string                 `json:"source"`
    Period   int                    `json:"period"`
    Proposal string                 `json:"proposal"`
    Metadata map[string]interface{} `json:"metadata"`
    Ballot   string                 `json:"ballot"`
}

BallotOperationElem represents a ballot operation

func FilterBallotOps Uses

func FilterBallotOps(ops []OperationElem) []*BallotOperationElem

FilterBallotOps filter all BallotOperationElem from a slice of OperationElem

type Ballots Uses

type Ballots struct {
    Yay  int64 `json:"yay"`
    Nay  int64 `json:"nay"`
    Pass int64 `json:"pass"`
}

Ballots holds summary data about a voting period

type Block Uses

type Block struct {
    Protocol   string              `json:"protocol"`
    ChainID    string              `json:"chain_id"`
    Hash       string              `json:"hash"`
    Header     RawBlockHeader      `json:"header"`
    Metadata   BlockHeaderMetadata `json:"metadata"`
    Operations [][]*Operation      `json:"operations"`
}

Block holds information about a Tezos block

type BlockHeaderMetadata Uses

type BlockHeaderMetadata struct {
    Protocol               string                    `json:"protocol"`
    NextProtocol           string                    `json:"next_protocol"`
    TestChainStatus        TestChainStatus           `json:"-"`
    MaxOperationsTTL       int                       `json:"max_operations_ttl"`
    MaxOperationDataLength int                       `json:"max_operation_data_length"`
    MaxBlockHeaderLength   int                       `json:"max_block_header_length"`
    MaxOperationListLength []*MaxOperationListLength `json:"max_operation_list_length"`
    Baker                  string                    `json:"baker"`
    Level                  BlockHeaderMetadataLevel  `json:"level"`
    VotingPeriodKind       string                    `json:"voting_period_kind"`
    NonceHash              string                    `json:"nonce_hash"`
    ConsumedGas            big.Int                   `json:"-"`
    Deactivated            []string                  `json:"deactivated"`
    BalanceUpdates         BalanceUpdates            `json:"balance_updates"`
}

BlockHeaderMetadata is a part of the Tezos block data

func (*BlockHeaderMetadata) UnmarshalJSON Uses

func (bhm *BlockHeaderMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the BlockHeaderMetadata JSON

type BlockHeaderMetadataLevel Uses

type BlockHeaderMetadataLevel struct {
    Level                int  `json:"level"`
    LevelPosition        int  `json:"level_position"`
    Cycle                int  `json:"cycle"`
    CyclePosition        int  `json:"cycle_position"`
    VotingPeriod         int  `json:"voting_period"`
    VotingPeriodPosition int  `json:"voting_period_position"`
    ExpectedCommitment   bool `json:"expected_commitment"`
}

BlockHeaderMetadataLevel is a part of BlockHeaderMetadata

type BootstrappedBlock Uses

type BootstrappedBlock struct {
    Block     string    `json:"block"`
    Timestamp time.Time `json:"timestamp"`
}

BootstrappedBlock represents bootstrapped block stream message

type ContractBalanceUpdate Uses

type ContractBalanceUpdate struct {
    GenericBalanceUpdate
    Contract string `json:"contract"`
}

ContractBalanceUpdate is a BalanceUpdatesType variant for Kind=contract

type EndorsementOperationElem Uses

type EndorsementOperationElem struct {
    GenericOperationElem
    Level    int                           `json:"level"`
    Metadata *EndorsementOperationMetadata `json:"metadata"`
}

EndorsementOperationElem represents an endorsement operation

func FilterEndorsmentOps Uses

func FilterEndorsmentOps(ops []OperationElem) []*EndorsementOperationElem

FilterEndorsmentOps filter all EndorsementOperationElem from a slice of OperationElem

type EndorsementOperationMetadata Uses

type EndorsementOperationMetadata struct {
    BalanceUpdates BalanceUpdates `json:"balance_updates"`
    Delegate       string         `json:"delegate"`
    Slots          []int          `json:"slots"`
}

EndorsementOperationMetadata represents an endorsement operation metadata

type Error Uses

type Error interface {
    error
    ErrorID() string
    ErrorKind() string
}

Error is a Tezos error as documented on http://tezos.gitlab.io/mainnet/api/errors.html.

type Errors Uses

type Errors []Error

Errors is a slice of Error with custom JSON unmarshaller

func (Errors) Error Uses

func (e Errors) Error() string

func (Errors) ErrorID Uses

func (e Errors) ErrorID() string

ErrorID returns Tezos error id

func (Errors) ErrorKind Uses

func (e Errors) ErrorKind() string

ErrorKind returns Tezos error kind

func (*Errors) UnmarshalJSON Uses

func (e *Errors) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type ForkingTestChainStatus Uses

type ForkingTestChainStatus struct {
    GenericTestChainStatus
    Protocol   string `json:"protocol"`
    Expiration string `json:"expiration"`
}

ForkingTestChainStatus is a TestChainStatus variant for Status=forking

type FreezerBalanceUpdate Uses

type FreezerBalanceUpdate struct {
    GenericBalanceUpdate
    Category string `json:"category"`
    Delegate string `json:"delegate"`
    Level    int    `json:"level"`
}

FreezerBalanceUpdate is a BalanceUpdatesType variant for Kind=freezer

type GenericBalanceUpdate Uses

type GenericBalanceUpdate struct {
    Kind   string        `json:"kind"`
    Change BalanceChange `json:"change"`
}

GenericBalanceUpdate holds the common values among all BalanceUpdatesType variants

func (*GenericBalanceUpdate) BalanceUpdateKind Uses

func (g *GenericBalanceUpdate) BalanceUpdateKind() string

BalanceUpdateKind returns the BalanceUpdateType's Kind field

type GenericError Uses

type GenericError struct {
    ID   string `json:"id"`
    Kind string `json:"kind"`
}

GenericError is a basic error type

func (*GenericError) Error Uses

func (e *GenericError) Error() string

func (*GenericError) ErrorID Uses

func (e *GenericError) ErrorID() string

ErrorID returns Tezos error id

func (*GenericError) ErrorKind Uses

func (e *GenericError) ErrorKind() string

ErrorKind returns Tezos error kind

type GenericOperationElem Uses

type GenericOperationElem struct {
    Kind string `json:"kind"`
}

GenericOperationElem is a most generic element type

func (*GenericOperationElem) OperationElemKind Uses

func (e *GenericOperationElem) OperationElemKind() string

OperationElemKind implements OperationElem

type GenericTestChainStatus Uses

type GenericTestChainStatus struct {
    Status string `json:"status"`
}

GenericTestChainStatus holds the common values among all TestChainStatus variants

func (*GenericTestChainStatus) TestChainStatus Uses

func (t *GenericTestChainStatus) TestChainStatus() string

TestChainStatus gets the TestChainStatus's Status field

type HTTPError Uses

type HTTPError interface {
    error
    HTTPStatus
}

HTTPError retains HTTP status

type HTTPStatus Uses

type HTTPStatus interface {
    Status() string  // e.g. "200 OK"
    StatusCode() int // e.g. 200
    Body() []byte
}

HTTPStatus interface represents an unprocessed HTTP reply

type HexBytes Uses

type HexBytes []byte

HexBytes represents bytes as a JSON string of hexadecimal digits

func (*HexBytes) UnmarshalText Uses

func (hb *HexBytes) UnmarshalText(data []byte) error

UnmarshalText umarshalls a hex string to bytes

type IDTimestamp Uses

type IDTimestamp struct {
    ID        string
    Timestamp time.Time
}

IDTimestamp represents peer id with timestamp

func (*IDTimestamp) UnmarshalJSON Uses

func (i *IDTimestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type InvalidBlock Uses

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 MaxOperationListLength Uses

type MaxOperationListLength struct {
    MaxSize int `json:"max_size"`
    MaxOp   int `json:"max_op"`
}

MaxOperationListLength is a part of the BlockHeaderMetadata

type MempoolOperations Uses

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 MonitorBlock Uses

type MonitorBlock struct {
    Level          int        `json:"level"`
    Proto          int        `json:"proto"`
    Predecessor    string     `json:"predecessor"`
    Timestamp      time.Time  `json:"timestamp"`
    ValidationPass int        `json:"validation_pass"`
    OperationsHash string     `json:"operations_hash"`
    Fitness        []HexBytes `json:"fitness"`
    Context        string     `json:"context"`
    Priority       int        `json:"priority"`
    Hash           string     `json:"hash"`
    ProtocolData   string     `json:"protocol_data"`
}

MonitorBlock holds information about block returned by monitor heads endpoint

type NetworkAddress Uses

type NetworkAddress struct {
    Addr string `json:"addr"`
    Port uint16 `json:"port"`
}

NetworkAddress models a point's address and port.

type NetworkConnection Uses

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 Uses

type NetworkConnectionTimestamp struct {
    NetworkAddress
    Timestamp time.Time
}

NetworkConnectionTimestamp represents peer address with timestamp added

func (*NetworkConnectionTimestamp) UnmarshalJSON Uses

func (n *NetworkConnectionTimestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type NetworkMetadata Uses

type NetworkMetadata struct {
    DisableMempool bool `json:"disable_mempool"`
    PrivateNode    bool `json:"private_node"`
}

NetworkMetadata models metadata of a node.

type NetworkPeer Uses

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 Uses

type NetworkPeerLogEntry struct {
    NetworkAddress
    Kind      string    `json:"kind"`
    Timestamp time.Time `json:"timestamp"`
}

NetworkPeerLogEntry represents peer log entry

type NetworkPoint Uses

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 Uses

type NetworkPointLogEntry struct {
    Kind      NetworkPointState `json:"kind"`
    Timestamp time.Time         `json:"timestamp"`
}

NetworkPointLogEntry represents point's log entry

type NetworkPointState Uses

type NetworkPointState struct {
    EventKind string `json:"event_kind"`
    P2PPeerID string `json:"p2p_peer_id"`
}

NetworkPointState represents point state

type NetworkStats Uses

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 Uses

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 Uses

type NotRunningTestChainStatus struct {
    GenericTestChainStatus
}

NotRunningTestChainStatus is a TestChainStatus variant for Status=not_running

type Operation Uses

type Operation struct {
    Protocol  string            `json:"protocol"`
    ChainID   string            `json:"chain_id"`
    Hash      string            `json:"hash"`
    Branch    string            `json:"branch"`
    Contents  OperationElements `json:"contents"`
    Signature string            `json:"signature"`
}

Operation represents an operation included into block

type OperationAlt Uses

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 Uses

func (o *OperationAlt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type OperationElem Uses

type OperationElem interface {
    OperationElemKind() string
}

OperationElem must be implemented by all operation elements

type OperationElements Uses

type OperationElements []OperationElem

OperationElements is a slice of OperationElem with custom JSON unmarshaller

func (*OperationElements) UnmarshalJSON Uses

func (e *OperationElements) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type OperationWithError Uses

type OperationWithError struct {
    Operation
    Error Errors `json:"error"`
}

OperationWithError represents unsuccessful operation

type OperationWithErrorAlt Uses

type OperationWithErrorAlt OperationWithError

OperationWithErrorAlt is a heterogeneously encoded OperationWithError with hash as a first array member. See OperationAlt for details

func (*OperationWithErrorAlt) UnmarshalJSON Uses

func (o *OperationWithErrorAlt) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type PeriodKind Uses

type PeriodKind string

PeriodKind contains information about tezos voting period kind

func (PeriodKind) IsPromotionVote Uses

func (p PeriodKind) IsPromotionVote() bool

IsPromotionVote true if period kind is promotion vote

func (PeriodKind) IsProposal Uses

func (p PeriodKind) IsProposal() bool

IsProposal return true if period kind is proposal

func (PeriodKind) IsTesting Uses

func (p PeriodKind) IsTesting() bool

IsTesting return true if period kind is testing

func (PeriodKind) IsTestingVote Uses

func (p PeriodKind) IsTestingVote() bool

IsTestingVote return true if period kind is testing vote

type Proposal Uses

type Proposal struct {
    ProposalHash   string
    SupporterCount int
}

Proposal holds summary data about a proposal and his number of supporter

type ProposalOperationElem Uses

type ProposalOperationElem struct {
    GenericOperationElem
    Source    string                 `json:"source"`
    Period    int                    `json:"period"`
    Proposals []string               `json:"proposals"`
    Metadata  map[string]interface{} `json:"metadata"`
}

ProposalOperationElem represents a proposal operation

func FilterProposalOps Uses

func FilterProposalOps(ops []OperationElem) []*ProposalOperationElem

FilterProposalOps filter all ProposalOperationElem from a slice of OperationElem

type RPCClient Uses

type RPCClient struct {
    // HTTP client used to communicate with the Tezos node API.
    Client *http.Client
    // Base URL for API requests.
    BaseURL *url.URL
    // User agent name for client.
    UserAgent string
    // Optional callback for metrics.
    RPCStatusCallback func(req *http.Request, status int, duration time.Duration, err error)
    // Optional callback for metrics.
    RPCHeaderCallback func(req *http.Request, resp *http.Response, duration time.Duration)
}

RPCClient manages communication with a Tezos RPC server.

func NewRPCClient Uses

func NewRPCClient(httpClient *http.Client, baseURL string) (*RPCClient, error)

NewRPCClient returns a new Tezos RPC client.

func (*RPCClient) Do Uses

func (c *RPCClient) Do(req *http.Request, v interface{}) (err error)

Do retrieves values from the API and marshals them into the provided interface.

func (*RPCClient) NewRequest Uses

func (c *RPCClient) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates a Tezos RPC request.

type RPCError Uses

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 Uses

type RawBlockHeader struct {
    Level            int        `json:"level"`
    Proto            int        `json:"proto"`
    Predecessor      string     `json:"predecessor"`
    Timestamp        time.Time  `json:"timestamp"`
    ValidationPass   int        `json:"validation_pass"`
    OperationsHash   string     `json:"operations_hash"`
    Fitness          []HexBytes `json:"fitness"`
    Context          string     `json:"context"`
    Priority         int        `json:"priority"`
    ProofOfWorkNonce HexBytes   `json:"proof_of_work_nonce"`
    SeedNonceHash    string     `json:"seed_nonce_hash"`
    Signature        string     `json:"signature"`
}

RawBlockHeader is a part of the Tezos block data

type RunningTestChainStatus Uses

type RunningTestChainStatus struct {
    GenericTestChainStatus
    ChainID    string `json:"chain_id"`
    Genesis    string `json:"genesis"`
    Protocol   string `json:"protocol"`
    Expiration string `json:"expiration"`
}

RunningTestChainStatus is a TestChainStatus variant for Status=running

type Service Uses

type Service struct {
    Client *RPCClient
}

Service implements fetching of information from Tezos nodes via JSON.

func (*Service) BanNetworkPeer Uses

func (s *Service) BanNetworkPeer(ctx context.Context, peerID string) error

BanNetworkPeer blacklists the given peer. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id-ban

func (*Service) BanNetworkPoint Uses

func (s *Service) BanNetworkPoint(ctx context.Context, address string) error

BanNetworkPoint blacklists the given address. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points-point-ban

func (*Service) ConnectToNetworkPoint Uses

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 Uses

func (s *Service) GetBallotList(ctx context.Context, chainID, blockID string) ([]*Ballot, error)

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 Uses

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 Uses

func (s *Service) GetBallots(ctx context.Context, chainID, blockID string) (*Ballots, error)

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 Uses

func (s *Service) GetBlock(ctx context.Context, chainID, blockID string) (*Block, error)

GetBlock returns information about a Tezos block https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id

func (*Service) GetBootstrapped Uses

func (s *Service) GetBootstrapped(ctx context.Context, results chan<- *BootstrappedBlock) error

GetBootstrapped reads from the bootstrapped blocks stream http://tezos.gitlab.io/mainnet/api/rpc.html#get-monitor-bootstrapped

func (*Service) GetContractBalance Uses

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 Uses

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 Uses

func (s *Service) GetCurrentProposals(ctx context.Context, chainID, blockID string) (string, error)

GetCurrentProposals returns the current proposal under evaluation. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-current-proposal

func (*Service) GetCurrentQuorum Uses

func (s *Service) GetCurrentQuorum(ctx context.Context, chainID, blockID string) (int, error)

GetCurrentQuorum returns the current expected quorum. https://tezos.gitlab.io/alphanet/api/rpc.html#get-block-id-votes-current-quorum

func (*Service) GetDelegateBalance Uses

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 Uses

func (s *Service) GetInvalidBlocks(ctx context.Context, chainID string) ([]*InvalidBlock, error)

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 Uses

func (s *Service) GetMempoolPendingOperations(ctx context.Context, chainID string) (*MempoolOperations, error)

GetMempoolPendingOperations returns mempool pending operations

func (*Service) GetMonitorHeads Uses

func (s *Service) GetMonitorHeads(ctx context.Context, chainID string, results chan<- *MonitorBlock) error

GetMonitorHeads reads from the heads blocks stream https://tezos.gitlab.io/mainnet/api/rpc.html#get-monitor-heads-chain-id

func (*Service) GetNetworkConnections Uses

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 Uses

func (s *Service) GetNetworkPeer(ctx context.Context, peerID string) (*NetworkPeer, error)

GetNetworkPeer returns details about a given peer. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers-peer-id

func (*Service) GetNetworkPeerBanned Uses

func (s *Service) GetNetworkPeerBanned(ctx context.Context, peerID string) (bool, error)

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 Uses

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 Uses

func (s *Service) GetNetworkPeers(ctx context.Context, filter string) ([]*NetworkPeer, error)

GetNetworkPeers returns the list the peers the node ever met. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-peers

func (*Service) GetNetworkPoint Uses

func (s *Service) GetNetworkPoint(ctx context.Context, address string) (*NetworkPoint, error)

GetNetworkPoint returns details about a given `IP:addr`. https://tezos.gitlab.io/mainnet/api/rpc.html#get-network-points-point

func (*Service) GetNetworkPointBanned Uses

func (s *Service) GetNetworkPointBanned(ctx context.Context, address string) (bool, error)

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 Uses

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 Uses

func (s *Service) GetNetworkPoints(ctx context.Context, filter string) ([]*NetworkPoint, error)

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 Uses

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 Uses

func (s *Service) GetProposals(ctx context.Context, chainID, blockID string) ([]*Proposal, error)

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) MonitorMempoolOperations Uses

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 Uses

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 Uses

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 Uses

func (s *Service) TrustNetworkPeer(ctx context.Context, peerID string) error

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 Uses

func (s *Service) TrustNetworkPoint(ctx context.Context, address string) error

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 Uses

type TestChainStatus interface {
    TestChainStatus() string
}

TestChainStatus is a variable structure depending on the Status field

type TransactionOperationElem Uses

type TransactionOperationElem struct {
    GenericOperationElem
    Source       string                        `json:"source"`
    Fee          bigIntStr                     `json:"fee"`
    Counter      bigIntStr                     `json:"counter"`
    GasLimit     bigIntStr                     `json:"gas_limit"`
    StorageLimit bigIntStr                     `json:"storage_limit"`
    Amount       bigIntStr                     `json:"amount"`
    Destination  string                        `json:"destination"`
    Parameters   map[string]interface{}        `json:"parameters"`
    Metadata     *EndorsementOperationMetadata `json:"metadata"`
}

TransactionOperationElem represents a transaction operation

func FilterTransactionOps Uses

func FilterTransactionOps(ops []OperationElem) []*TransactionOperationElem

FilterTransactionOps filter all TransactionOperationElem from a slice of OperationElem

Package tezos imports 14 packages (graph). Updated 2019-07-10. Refresh now. Tools for package owners.