roles

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsString

func AsString() []string

AsString returns the roles for the peer

func HasRole

func HasRole(role Role) bool

HasRole returns true if the peer has the given role

func IsClustered added in v0.1.4

func IsClustered() bool

IsClustered returns true if we're running in clustered mode

func IsCommitter

func IsCommitter() bool

IsCommitter returns true if the peer is a committer, otherwise the peer does not commit to the DB

func IsEndorser

func IsEndorser() bool

IsEndorser returns true if the peer is an endorser

func IsValidator

func IsValidator() bool

IsValidator returns true if the peer is a validator

Types

type Role

type Role = string

Role is the role of the peer

const (
	// CommitterRole indicates that the peer commits data to the ledger
	CommitterRole Role = "committer"
	// EndorserRole indicates that the peer endorses transaction proposals
	EndorserRole Role = "endorser"
	// ValidatorRole indicates that the peer validates the block
	ValidatorRole Role = "validator"
)

func GetRoles

func GetRoles() []Role

GetRoles returns the roles for the peer

type Roles

type Roles []Role

Roles is a set of peer roles

func FromStrings

func FromStrings(r ...string) Roles

FromStrings creates Roles from the given slice of strings

func (Roles) Contains

func (r Roles) Contains(role Role) bool

Contains return true if the given role is included in the set

Jump to

Keyboard shortcuts

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