go-tezos: github.com/DefinitelyNotAGoat/go-tezos/network Index | Files

package network

import "github.com/DefinitelyNotAGoat/go-tezos/network"

Index

Package Files

interfaces.go mocks.go network.go

type Connections Uses

type Connections []struct {
    Incoming bool   `json:"incoming"`
    PeerID   string `json:"peer_id"`
    IDPoint  struct {
        Addr string `json:"addr"`
        Port int    `json:"port"`
    }   `json:"id_point"`
    RemoteSocketPort int `json:"remote_socket_port"`
    Versions         []struct {
        Name  string `json:"name"`
        Major int    `json:"major"`
        Minor int    `json:"minor"`
    }   `json:"versions"`
    Private       bool `json:"private"`
    LocalMetadata struct {
        DisableMempool bool `json:"disable_mempool"`
        PrivateNode    bool `json:"private_node"`
    }   `json:"local_metadata"`
    RemoteMetadata struct {
        DisableMempool bool `json:"disable_mempool"`
        PrivateNode    bool `json:"private_node"`
    }   `json:"remote_metadata"`
}

Connections represents network connections

type Constants Uses

type Constants struct {
    ProofOfWorkNonceSize         int      `json:"proof_of_work_nonce_size"`
    NonceLength                  int      `json:"nonce_length"`
    MaxRevelationsPerBlock       int      `json:"max_revelations_per_block"`
    MaxOperationDataLength       int      `json:"max_operation_data_length"`
    MaxProposalsPerDelegate      int      `json:"max_proposals_per_delegate"`
    PreservedCycles              int      `json:"preserved_cycles"`
    BlocksPerCycle               int      `json:"blocks_per_cycle"`
    BlocksPerCommitment          int      `json:"blocks_per_commitment"`
    BlocksPerRollSnapshot        int      `json:"blocks_per_roll_snapshot"`
    BlocksPerVotingPeriod        int      `json:"blocks_per_voting_period"`
    TimeBetweenBlocks            []string `json:"time_between_blocks"`
    EndorsersPerBlock            int      `json:"endorsers_per_block"`
    HardGasLimitPerOperation     string   `json:"hard_gas_limit_per_operation"`
    HardGasLimitPerBlock         string   `json:"hard_gas_limit_per_block"`
    ProofOfWorkThreshold         string   `json:"proof_of_work_threshold"`
    TokensPerRoll                string   `json:"tokens_per_roll"`
    MichelsonMaximumTypeSize     int      `json:"michelson_maximum_type_size"`
    SeedNonceRevelationTip       string   `json:"seed_nonce_revelation_tip"`
    OriginationSize              int      `json:"origination_size"`
    BlockSecurityDeposit         string   `json:"block_security_deposit"`
    EndorsementSecurityDeposit   string   `json:"endorsement_security_deposit"`
    BlockReward                  string   `json:"block_reward"`
    EndorsementReward            string   `json:"endorsement_reward"`
    CostPerByte                  string   `json:"cost_per_byte"`
    HardStorageLimitPerOperation string   `json:"hard_storage_limit_per_operation"`
}

Constants represents the network constants returned by the Tezos network.

type NetworkService Uses

type NetworkService struct {
    // contains filtered or unexported fields
}

NetworkService is wrapper representing network functions

func NewNetworkService Uses

func NewNetworkService(tzclient tzc.TezosClient) *NetworkService

NewNetworkService returns a new NetworkService

func (*NetworkService) GetChainID Uses

func (n *NetworkService) GetChainID() (string, error)

GetChainID gets the id of the chain with the most fitness

func (*NetworkService) GetConnections Uses

func (n *NetworkService) GetConnections() (Connections, error)

GetConnections gets the network connections

func (*NetworkService) GetConstants Uses

func (n *NetworkService) GetConstants() (Constants, error)

GetConstants gets the network constants for the Tezos network the client is using.

func (*NetworkService) GetVersions Uses

func (n *NetworkService) GetVersions() ([]Version, error)

GetVersions gets the network versions of Tezos network the client is using.

type TezosNetworkService Uses

type TezosNetworkService interface {
    GetVersions() ([]Version, error)
    GetConstants() (Constants, error)
    GetChainID() (string, error)
    GetConnections() (Connections, error)
}

type Version Uses

type Version struct {
    Name    string `json:"name"`
    Major   int    `json:"major"`
    Minor   int    `json:"minor"`
    Network string // Human readable network name
}

Version represents the network version returned by the Tezos network.

type Versions Uses

type Versions []Version

Versions is an array of Version

Package network imports 4 packages (graph) and is imported by 9 packages. Updated 2019-08-01. Refresh now. Tools for package owners.