types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAppChannelsAlreadyExists = errors.New("application channels already exist")

This error is returned when trying to join a system channel (that does not exist) when application channels already exist.

View Source
var ErrChannelAlreadyExists = errors.New("channel already exists")

This error is returned when trying to join a app channel that already exists (when the system channel does not exist), or when trying to join the system channel when it already exists.

View Source
var ErrChannelNotExist = errors.New("channel does not exist")

This error is returned when trying to remove or list a channel that does not exist

View Source
var ErrSystemChannelExists = errors.New("system channel exists")

This error is returned when trying to join or remove an application channel when the system channel exists.

Functions

This section is empty.

Types

type ChannelInfo

type ChannelInfo struct {
	// The channel name.
	Name string `json:"name"`
	// The channel relative URL (no Host:Port, only path), e.g.: "/participation/v1/channels/my-channel".
	URL string `json:"url"`
	// Whether the orderer is a “member” or ”follower” of the cluster, or "config-tracker" of the cluster, for this channel.
	// For non cluster consensus types (solo, kafka) it is "none".
	// Possible values:  “member”, ”follower”, "config-tracker", "none".
	ClusterRelation ClusterRelation `json:"clusterRelation"`
	// Whether the orderer is ”onboarding”, ”active”, or "inactive", for this channel.
	// For non cluster consensus types (solo, kafka) it is "active".
	// Possible values:  “onboarding”, ”active”, "inactive".
	Status Status `json:"status"`
	// Current block height.
	Height uint64 `json:"height"`
}

ChannelInfo carries the response to an HTTP request to List a single channel. This is marshaled into the body of the HTTP response.

type ChannelInfoShort

type ChannelInfoShort struct {
	// The channel name.
	Name string `json:"name"`
	// The channel relative URL (no Host:Port, only path), e.g.: "/participation/v1/channels/my-channel".
	URL string `json:"url"`
}

ChannelInfoShort carries a short info of a single channel.

type ChannelList

type ChannelList struct {
	// The system channel info, nil if it doesn't exist.
	SystemChannel *ChannelInfoShort `json:"systemChannel"`
	// Application channels only, nil or empty if no channels defined.
	Channels []ChannelInfoShort `json:"channels"`
}

ChannelList carries the response to an HTTP request to List all the channels. This is marshaled into the body of the HTTP response.

type ClusterRelation

type ClusterRelation string

ClusterRelation represents the relationship between the orderer and the channel's consensus cluster.

const (
	// The orderer is a cluster member of a cluster consensus protocol (e.g. etcdraft) for a specific channel.
	// That is, the orderer is in the consenters set of the channel.
	ClusterRelationMember ClusterRelation = "member"
	// The orderer is following a cluster consensus protocol by pulling blocks from other orderers.
	// The orderer is NOT in the consenters set of the channel.
	ClusterRelationFollower ClusterRelation = "follower"
	// The orderer is NOT in the consenters set of the channel, and is just tracking (polling) the last config block
	// of the channel in order to detect when it is added to the channel.
	ClusterRelationConfigTracker ClusterRelation = "config-tracker"
	// The orderer runs a non-cluster consensus type, solo or kafka.
	ClusterRelationNone ClusterRelation = "none"
)

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse carries the error response an HTTP request. This is marshaled into the body of the HTTP response.

type Status

type Status string

Status represents the degree by which the orderer had caught up with the rest of the cluster after joining the channel (either as a member or a follower).

const (
	// The orderer is active in the channel's consensus protocol, or following the cluster,
	// with block height > the join-block number. (Height is last block number +1).
	StatusActive Status = "active"
	// The orderer is catching up with the cluster by pulling blocks from other orderers,
	// with block height <= the join-block number.
	StatusOnBoarding Status = "onboarding"
	// The orderer is not storing any blocks for this channel.
	StatusInactive Status = "inactive"
)

Jump to

Keyboard shortcuts

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