channelparticipation

package
v1.4.0-rc1.0...-bb6b5b7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URLBaseV1              = "/participation/v1/"
	URLBaseV1Channels      = URLBaseV1 + "channels"
	FormDataConfigBlockKey = "config-block"
)

Variables

This section is empty.

Functions

func ValidateJoinBlock

func ValidateJoinBlock(configBlock *cb.Block) (channelID string, err error)

ValidateJoinBlock checks whether this block can be used as a join block for the channel participation API. It returns the channel ID. It verifies that it is not a system channel by checking that consortiums config does not exist. It verifies it is an application channel by checking that the application group exists. It returns an error when it cannot be used as a join-block.

Types

type ChannelManagement

type ChannelManagement interface {
	// ChannelList returns a slice of ChannelInfoShort containing all application channels (excluding the system
	// channel), and ChannelInfoShort of the system channel (nil if does not exist).
	// The URL fields are empty, and are to be completed by the caller.
	ChannelList() types.ChannelList

	// ChannelInfo provides extended status information about a channel.
	// The URL field is empty, and is to be completed by the caller.
	ChannelInfo(channelID string) (types.ChannelInfo, error)

	// JoinChannel instructs the orderer to create a channel and join it with the provided config block.
	// The URL field is empty, and is to be completed by the caller.
	JoinChannel(channelID string, configBlock *cb.Block) (types.ChannelInfo, error)

	// RemoveChannel instructs the orderer to remove a channel.
	RemoveChannel(channelID string) error
}

type HTTPHandler

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

HTTPHandler handles all the HTTP requests to the channel participation API.

func NewHTTPHandler

func NewHTTPHandler(config localconfig.ChannelParticipation, registrar ChannelManagement) *HTTPHandler

func (*HTTPHandler) ServeHTTP

func (h *HTTPHandler) ServeHTTP(resp http.ResponseWriter, req *http.Request)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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