node

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2021 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	KindActivation          = "activate_account"
	KindBallot              = "ballot"
	KindDelegation          = "delegation"
	KindDoubleBaking        = "double_baking_evidence"
	KindDoubleEndorsing     = "double_endorsement_evidence"
	KindEndorsement         = "endorsement"
	KindEndorsementWithSlot = "endorsement_with_slot"
	KindOrigination         = "origination"
	KindProposal            = "proposals"
	KindReveal              = "reveal"
	KindNonceRevelation     = "seed_nonce_revelation"
	KindTransaction         = "transaction"
)

Variables

View Source
var (
	ErrUnknownKind = errors.New("Unknown operation kind")
)

Errors

Functions

This section is empty.

Types

type Applied

type Applied struct {
	Hash      string    `json:"hash"`
	Branch    string    `json:"branch"`
	Signature string    `json:"signature"`
	Contents  []Content `json:"contents"`
}

Applied -

type Constants

type Constants struct {
	ProofOfWorkNonceSize         int64            `json:"proof_of_work_nonce_size"`
	NonceLength                  int64            `json:"nonce_length"`
	MaxAnonOpsPerBlock           int64            `json:"max_anon_ops_per_block"`
	MaxOperationDataLength       int64            `json:"max_operation_data_length"`
	MaxProposalsPerDelegate      int64            `json:"max_proposals_per_delegate"`
	PreservedCycles              uint64           `json:"preserved_cycles"`
	BlocksPerCycle               uint64           `json:"blocks_per_cycle"`
	BlocksPerCommitment          int64            `json:"blocks_per_commitment"`
	BlocksPerRollSnapshot        int64            `json:"blocks_per_roll_snapshot"`
	BlocksPerVotingPeriod        int64            `json:"blocks_per_voting_period"`
	TimeBetweenBlocks            Int64StringSlice `json:"time_between_blocks"`
	EndorsersPerBlock            int64            `json:"endorsers_per_block"`
	HardGasLimitPerOperation     int64            `json:"hard_gas_limit_per_operation,string"`
	HardGasLimitPerBlock         int64            `json:"hard_gas_limit_per_block,string"`
	ProofOfWorkThreshold         int64            `json:"proof_of_work_threshold,string"`
	TokensPerRoll                int64            `json:"tokens_per_roll,string"`
	MichelsonMaximumTypeSize     int64            `json:"michelson_maximum_type_size"`
	SeedNonceRevelationTip       int64            `json:"seed_nonce_revelation_tip,string"`
	OriginationSize              int64            `json:"origination_size"`
	BlockSecurityDeposit         int64            `json:"block_security_deposit,string"`
	EndorsementSecurityDeposit   int64            `json:"endorsement_security_deposit,string"`
	BakingRewardPerEndorsement   Int64StringSlice `json:"baking_reward_per_endorsement"`
	EndorsementReward            Int64StringSlice `json:"endorsement_reward"`
	CostPerByte                  int64            `json:"cost_per_byte,string"`
	HardStorageLimitPerOperation int64            `json:"hard_storage_limit_per_operation,string"`
	TestChainDuration            int64            `json:"test_chain_duration,string"`
	QuorumMin                    int64            `json:"quorum_min"`
	QuorumMax                    int64            `json:"quorum_max"`
	MinProposalQuorum            int64            `json:"min_proposal_quorum"`
	InitialEndorsers             int64            `json:"initial_endorsers"`
	DelayPerMissingEndorsement   int64            `json:"delay_per_missing_endorsement,string"`
}

Constants -

type Content

type Content struct {
	Kind string             `json:"kind"`
	Body stdJSON.RawMessage `json:"-"`
}

Contents -

func (*Content) UnmarshalJSON

func (c *Content) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type Endorsement added in v0.1.1

type Endorsement struct {
	Branch    string               `json:"branch"`
	Operation EndorsementOperation `json:"operations"`
	Signature string               `json:"signature"`
}

Endorsement -

type EndorsementOperation added in v0.1.1

type EndorsementOperation struct {
	Level uint64 `json:"level"`
}

EndorsementOperation -

type EndorsementWithSlot added in v0.1.1

type EndorsementWithSlot struct {
	Endorsement Endorsement `json:"endorsement"`
	Slot        uint64      `json:"slot"`
}

EndorsementWithSlot -

type Failed

type Failed struct {
	Hash      string
	Protocol  string             `json:"protocol"`
	Branch    string             `json:"branch"`
	Contents  []Content          `json:"contents"`
	Signature string             `json:"signature"`
	Error     stdJSON.RawMessage `json:"error,omitempty"`
}

Failed -

func (*Failed) UnmarshalJSON

func (f *Failed) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type Header struct {
	Protocol         string    `json:"protocol"`
	ChainID          string    `json:"chain_id"`
	Hash             string    `json:"hash"`
	Level            uint64    `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          []string  `json:"fitness"`
	Context          string    `json:"context"`
	Priority         int       `json:"priority"`
	ProofOfWorkNonce string    `json:"proof_of_work_nonce"`
	Signature        string    `json:"signature"`
}

Header -

type Int64StringSlice

type Int64StringSlice []int64

Int64StringSlice -

func (*Int64StringSlice) UnmarshalJSON

func (slice *Int64StringSlice) UnmarshalJSON(data []byte) error

UnmarshalJSON -

type MempoolResponse

type MempoolResponse struct {
	Applied       []Applied `json:"applied"`
	Refused       []Failed  `json:"refused"`
	BranchRefused []Failed  `json:"branch_refused"`
	BranchDelayed []Failed  `json:"branch_delayed"`
}

MempoolResponse -

type NodeOption

type NodeOption func(*NodeRPC)

NodeOption -

func WithTimeout

func WithTimeout(seconds uint64) NodeOption

WithTimeout -

type NodeRPC

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

NodeRPC -

func NewNodeRPC

func NewNodeRPC(baseURL string, opts ...NodeOption) *NodeRPC

NewNodeRPC -

func (*NodeRPC) Constants

func (rpc *NodeRPC) Constants() (constants Constants, err error)

Constants -

func (*NodeRPC) Head

func (rpc *NodeRPC) Head() (head Header, err error)

Head -

func (*NodeRPC) PendingOperations

func (rpc *NodeRPC) PendingOperations() (res MempoolResponse, err error)

PendingOperations -

func (*NodeRPC) URL

func (rpc *NodeRPC) URL() string

URL -

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL