Documentation
¶
Index ¶
- type AccountRef
- type ContractRef
- type DecodedPayload
- type DecodedScsPushMsg
- type DecodedScsRegisterMsg
- type DecodedVnodePushMsg
- type NetworkRelay
- func (self *NetworkRelay) BroadcastMsg(scsmsg *pb.ScsPushMsg, forceToMainnet bool)
- func (self *NetworkRelay) BroadcastRes(msg *pb.ScsPushMsg, forceToMainnet bool)
- func (self *NetworkRelay) DelScsRoleCache(scsId common.Address, subchainId common.Address)
- func (self *NetworkRelay) GetBlockNumber() uint64
- func (self *NetworkRelay) GetNewRequestId() uint32
- func (self *NetworkRelay) GetSCSRole(subchainId, scsId common.Address) params.ScsKind
- func (self *NetworkRelay) GetScsRoleCache(scsId common.Address, subchainId common.Address) *RoleCache
- func (self *NetworkRelay) MarkMsg(scsId string, msg *pb.ScsPushMsg)
- func (self *NetworkRelay) NotifyMsgRunState(hash common.Hash) bool
- func (self *NetworkRelay) NotifyScs(address common.Address, msg []byte, hash common.Hash, blocknumber *big.Int)
- func (self *NetworkRelay) NotifyScsFinalize(curblock *big.Int, liveFlag bool)
- func (self *NetworkRelay) OnReceiveMsg(msg *pb.ScsPushMsg)
- func (self *NetworkRelay) OnReceiveRegisterMsg(msg *pb.ScsPushMsg)
- func (self *NetworkRelay) OnReceiveRes(res *pb.ScsPushMsg)
- func (self *NetworkRelay) Priority(contractAddr, scsId common.Address, code []byte) bool
- func (self *NetworkRelay) ScsMsgCheck(role params.ScsKind, scs common.Address, conReq *pb.ScsPushMsg) bool
- func (self *NetworkRelay) ServerWithoutMsg(msg *pb.ScsPushMsg) []*libtypes.ScsServerConnection
- func (self *NetworkRelay) SetBlockNumber(bn uint64)
- func (self *NetworkRelay) SetScsRoleCacheOld(subchainId common.Address)
- func (self *NetworkRelay) SetScsServerList(scsServerList *map[string]*libtypes.ScsServerConnection)
- func (self *NetworkRelay) SetupMsgSender(scsId string)
- func (self *NetworkRelay) ShouldBroadcast(msg *pb.ScsPushMsg) bool
- func (self *NetworkRelay) UpdateScsRoleCache(scsId common.Address, subchainId common.Address, role params.ScsKind)
- func (self *NetworkRelay) UpdateWhiteState(bn uint64)
- func (self *NetworkRelay) VnodePushMsg(conReq *pb.ScsPushMsg) (map[int]*pb.ScsPushMsg, error)
- type NotifyScsMsg
- type RoleCache
- type ScsServerConfig
- type VmInterface
- type VnodeServerInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRef ¶
func (AccountRef) Address ¶
func (ar AccountRef) Address() common.Address
Address casts AccountRef to a Address
type ContractRef ¶
type DecodedPayload ¶
type DecodedScsPushMsg ¶
type DecodedScsRegisterMsg ¶
type DecodedVnodePushMsg ¶
type NetworkRelay ¶
type NetworkRelay struct {
ChainId uint64
ScsServers map[string]*ScsServerConfig
NotifyScsCache map[string]*NotifyScsMsg
ScsServerList *map[string]*libtypes.ScsServerConnection
ScsRoleCache map[common.Address]map[common.Address]*RoleCache
WhiteFlag uint64
WhiteList []common.Hash
WhiteFunc []common.Hash
// contains filtered or unexported fields
}
func GetInstance ¶
func GetInstance() *NetworkRelay
func NewNetworkRelay ¶
func NewNetworkRelay( scsMsgChan chan *pb.ScsPushMsg, scsResChan chan *pb.ScsPushMsg, scsMsgChanMainnet chan *pb.ScsPushMsg, scsResChanMainnet chan *pb.ScsPushMsg, scsHandler VnodeServerInterface, chainId uint64, ) *NetworkRelay
func (*NetworkRelay) BroadcastMsg ¶
func (self *NetworkRelay) BroadcastMsg(scsmsg *pb.ScsPushMsg, forceToMainnet bool)
BroadcastMsg will 1) forward the msg to other vnode 2) forward the msg to local scs node
func (*NetworkRelay) BroadcastRes ¶
func (self *NetworkRelay) BroadcastRes(msg *pb.ScsPushMsg, forceToMainnet bool)
func (*NetworkRelay) DelScsRoleCache ¶
func (self *NetworkRelay) DelScsRoleCache(scsId common.Address, subchainId common.Address)
func (*NetworkRelay) GetBlockNumber ¶
func (self *NetworkRelay) GetBlockNumber() uint64
func (*NetworkRelay) GetNewRequestId ¶
func (self *NetworkRelay) GetNewRequestId() uint32
func (*NetworkRelay) GetSCSRole ¶
func (self *NetworkRelay) GetSCSRole(subchainId, scsId common.Address) params.ScsKind
func (*NetworkRelay) GetScsRoleCache ¶
func (*NetworkRelay) MarkMsg ¶
func (self *NetworkRelay) MarkMsg(scsId string, msg *pb.ScsPushMsg)
func (*NetworkRelay) NotifyMsgRunState ¶
func (self *NetworkRelay) NotifyMsgRunState(hash common.Hash) bool
func (*NetworkRelay) NotifyScsFinalize ¶
func (self *NetworkRelay) NotifyScsFinalize(curblock *big.Int, liveFlag bool)
func (*NetworkRelay) OnReceiveMsg ¶
func (self *NetworkRelay) OnReceiveMsg(msg *pb.ScsPushMsg)
func (*NetworkRelay) OnReceiveRegisterMsg ¶
func (self *NetworkRelay) OnReceiveRegisterMsg(msg *pb.ScsPushMsg)
func (*NetworkRelay) OnReceiveRes ¶
func (self *NetworkRelay) OnReceiveRes(res *pb.ScsPushMsg)
func (*NetworkRelay) Priority ¶
func (self *NetworkRelay) Priority(contractAddr, scsId common.Address, code []byte) bool
func (*NetworkRelay) ScsMsgCheck ¶
func (self *NetworkRelay) ScsMsgCheck(role params.ScsKind, scs common.Address, conReq *pb.ScsPushMsg) bool
func (*NetworkRelay) ServerWithoutMsg ¶
func (self *NetworkRelay) ServerWithoutMsg(msg *pb.ScsPushMsg) []*libtypes.ScsServerConnection
func (*NetworkRelay) SetBlockNumber ¶
func (self *NetworkRelay) SetBlockNumber(bn uint64)
func (*NetworkRelay) SetScsRoleCacheOld ¶
func (self *NetworkRelay) SetScsRoleCacheOld(subchainId common.Address)
func (*NetworkRelay) SetScsServerList ¶
func (self *NetworkRelay) SetScsServerList(scsServerList *map[string]*libtypes.ScsServerConnection)
func (*NetworkRelay) SetupMsgSender ¶
func (self *NetworkRelay) SetupMsgSender(scsId string)
func (*NetworkRelay) ShouldBroadcast ¶
func (self *NetworkRelay) ShouldBroadcast(msg *pb.ScsPushMsg) bool
func (*NetworkRelay) UpdateScsRoleCache ¶
func (*NetworkRelay) UpdateWhiteState ¶
func (self *NetworkRelay) UpdateWhiteState(bn uint64)
func (*NetworkRelay) VnodePushMsg ¶
func (self *NetworkRelay) VnodePushMsg(conReq *pb.ScsPushMsg) (map[int]*pb.ScsPushMsg, error)
send push msg to all connected scs servers
type NotifyScsMsg ¶
type ScsServerConfig ¶
type ScsServerConfig struct {
Stream pb.Vnode_ScsPushServer
PublicKey string
ScsId string
}
type VmInterface ¶
type VnodeServerInterface ¶
type VnodeServerInterface interface {
ScsPush(stream pb.Vnode_ScsPushServer) error
AccountInfo(ctx context.Context, in *pb.AccountInfoRequest) (*pb.AccountInfoReply, error)
ChainInfo(ctx context.Context, in *pb.ChainInfoRequest) (*pb.ChainInfoReply, error)
RemoteCall(ctx context.Context, in *pb.RemoteCallRequest) (*pb.RemoteCallReply, error)
GetBlockNumber() uint64
NotifyMsgRunState(hash common.Hash) bool
GetSCSRole(contractAddress common.Address, nodeAddress common.Address) params.ScsKind
GetScsPushMsgChan() chan pb.ScsPushMsg
GetScsRegChan() chan pb.ScsPushMsg
GetScsPushResChan() chan pb.ScsPushMsg
}
Click to show internal directories.
Click to hide internal directories.