enterprise

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdMembershipAdd    = "add"
	CmdMembershipRemove = "remove"

	CCCommand         = "command"
	MemberAttrName    = "name"
	MemberAttrAddress = "address"
	MemberAttrPeerID  = "peerid"
	MemberAttrID      = "id"
)
View Source
const (
	RPCPermissions = "RPCPERMISSIONS"
	P2PWhite       = "P2PWHITE"
	P2PBlack       = "P2PBLACK"
	AccountWhite   = "ACCOUNTWHITE"
)
View Source
const AdminsKey = "ADMINS"
View Source
const AppendAdmin = "appendAdmin"
View Source
const AppendConf = "appendConf"
View Source
const ChangeCluster = "changeCluster"
View Source
const DisableConf = "disableConf"
View Source
const EnableConf = "enableConf"
View Source
const NotSpecifiedID = types.PeerID("")
View Source
const RemoveAdmin = "removeAdmin"
View Source
const RemoveConf = "removeConf"
View Source
const SetConf = "setConf"

Variables

View Source
var (
	ErrNotSupportedMethod                      = errors.New("Not supported Enterprise Tx")
	ErrTxEnterpriseAlreadyIncludeChangeCluster = errors.New("Enterprise Tx of Change cluster type already included in the block")
)
View Source
var (
	InvalidEntryErr     = errors.New("invalid entry format")
	InvalidPeerIDErr    = errors.New("invalid peerID format")
	InvalidAddrRangeErr = errors.New("invalid address format")
	InvalidStateErr     = errors.New("either one of address or cidr is allowed")
)
View Source
var ErrTxEnterpriseAdminIsNotSet = errors.New("admin is not set")

Functions

func ExecuteEnterpriseTx

func ExecuteEnterpriseTx(bs *state.BlockState, ccc consensus.ChainConsensusCluster, scs *state.ContractState, txBody *types.TxBody,
	sender, receiver *state.V, blockNo types.BlockNo) ([]*types.Event, error)

func ValidateChangeCluster

func ValidateChangeCluster(ci types.CallInfo, blockNo types.BlockNo) (interface{}, error)

Types

type AccountStateReader

type AccountStateReader interface {
	GetEnterpriseAccountState() (*state.ContractState, error)
}

AccountStateReader is an interface for getting a enterprise account state.

type CcArgument

type CcArgument map[string]interface{}

type Conf

type Conf struct {
	On     bool
	Values []string
}

func (*Conf) AppendValue

func (c *Conf) AppendValue(r string)

func (*Conf) RemoveValue

func (c *Conf) RemoveValue(r string)

func (*Conf) Validate

func (c *Conf) Validate(key []byte, context *EnterpriseContext) error

type EnterpriseContext

type EnterpriseContext struct {
	Call    *types.CallInfo
	Args    []string
	ArgsAny []interface{}
	Admins  [][]byte
	Conf    *Conf
}

func ValidateEnterpriseTx

func ValidateEnterpriseTx(tx *types.TxBody, sender *state.V,
	scs *state.ContractState, blockNo types.BlockNo) (*EnterpriseContext, error)

func (*EnterpriseContext) HasConfValue

func (e *EnterpriseContext) HasConfValue(value string) bool

func (*EnterpriseContext) IsAdminExist

func (e *EnterpriseContext) IsAdminExist(addr []byte) bool

type WhiteListEntry

type WhiteListEntry struct {
	IpNet  *net.IPNet
	PeerID types.PeerID
	// contains filtered or unexported fields
}

func NewWhiteListEntry

func NewWhiteListEntry(str string) (WhiteListEntry, error)

func (WhiteListEntry) Contains

func (e WhiteListEntry) Contains(addr net.IP, pid types.PeerID) bool

func (WhiteListEntry) String

func (e WhiteListEntry) String() string

Jump to

Keyboard shortcuts

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