util

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildChannelHeader

func BuildChannelHeader(channelName string, headerType common.HeaderType, txID string, epoch uint64) (*common.ChannelHeader, error)

BuildChannelHeader builds a ChannelHeader with the given parameters

func ComputeTxID

func ComputeTxID(nonce []byte, creatorID []byte) (string, error)

ComputeTxID computes a transaction ID from a given nonce and creator ID

func CreateGenesisBlockRequest

func CreateGenesisBlockRequest(channelName string, creator []byte) []byte

CreateGenesisBlockRequest creates a seek request for block 0 on the specified channel. This request is sent to the ordering service to request blocks

func GenerateRandomNonce

func GenerateRandomNonce() ([]byte, error)

GenerateRandomNonce generates a random nonce

func GetLastConfigFromBlock

func GetLastConfigFromBlock(block *common.Block) (*common.LastConfig, error)

GetLastConfigFromBlock returns the LastConfig data from the given block

func MarshalOrPanic

func MarshalOrPanic(pb proto.Message) []byte

MarshalOrPanic serializes a protobuf message and panics if this operation fails.

func NewNewestSeekPosition

func NewNewestSeekPosition() *ab.SeekPosition

NewNewestSeekPosition returns a SeekPosition that requests the newest block

func NewSpecificSeekPosition

func NewSpecificSeekPosition(index uint64) *ab.SeekPosition

NewSpecificSeekPosition returns a SeekPosition that requests the block at the given index

Types

This section is empty.

Jump to

Keyboard shortcuts

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