Documentation ¶
Index ¶
- Constants
- Variables
- func ExecuteEnterpriseTx(bs *state.BlockState, ccc consensus.ChainConsensusCluster, ...) ([]*types.Event, error)
- func GetAdmin(r AccountStateReader) (*types.EnterpriseConfig, error)
- func GetConf(r AccountStateReader, key string) (*types.EnterpriseConfig, error)
- func ValidateChangeCluster(ci types.CallInfo, blockNo types.BlockNo) (interface{}, error)
- type AccountStateReader
- type CcArgument
- type Conf
- type EnterpriseContext
- type WhiteListEntry
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 GetAdmin ¶
func GetAdmin(r AccountStateReader) (*types.EnterpriseConfig, error)
func GetConf ¶
func GetConf(r AccountStateReader, key string) (*types.EnterpriseConfig, 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 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) String ¶
func (e WhiteListEntry) String() string
Click to show internal directories.
Click to hide internal directories.