vnode

package
v0.0.0-...-1df7544 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Server     = &VnodeServer{}
	Grequestid uint32
)

Functions

func VnodeServiceStart

func VnodeServiceStart(inconfigfile string)

VnodeServiceStart -- run grpc server

Types

type Backend

type Backend interface {
	BlockChain() *core.BlockChain
	TxPool() *core.TxPool
	ChainDb() mcdb.Database
	IsSubnetP2PEnabled(contractAddress common.Address, where string) bool
}

type DecodedScsRegisterMsg

type DecodedScsRegisterMsg struct {
	ScsId      string
	RequestId  string
	Operation  string
	PublicKey  string
	Capability uint32
	ChainId    *big.Int
}

type VnodeServer

type VnodeServer struct {
	Config *config.Configuration

	ScsPushMsgChan chan pb.ScsPushMsg
	ScsPushResChan chan pb.ScsPushMsg
	ScsRegChan     chan pb.ScsPushMsg
	ScsServerList  *map[string]*types.ScsServerConnection
	PingTickers    map[string]*time.Ticker
	// contains filtered or unexported fields
}

VNODE server data structure

func GetInstance

func GetInstance() *VnodeServer

Singleton

func NewScsService

func NewScsService(db mcdb.Database, syncdb mcdb.Database, bc *core.BlockChain, mn Backend, ctx *node.ServiceContext) *VnodeServer

func (*VnodeServer) AccountInfo

AccountInfo:

func (*VnodeServer) Address

func (s *VnodeServer) Address() common.Address

Address, RPC API, returns the VNODE beneficial address

func (*VnodeServer) ChainInfo

func (s *VnodeServer) ChainInfo(ctx context.Context, in *pb.ChainInfoRequest) (*pb.ChainInfoReply, error)

ChainInfo: MicroChain info?

func (*VnodeServer) Close

func (s *VnodeServer) Close()

Close close the VNODE scs service

func (*VnodeServer) CloseScsServer

func (s *VnodeServer) CloseScsServer(scsId string)

func (*VnodeServer) DownloadBlock

DownloadBlock - Download the block from vnode so that the SCS are able to retrieve the missing block data

func (*VnodeServer) GetBlockNumber

func (s *VnodeServer) GetBlockNumber() uint64

func (*VnodeServer) GetSCSRole

func (s *VnodeServer) GetSCSRole(contractAddress common.Address, nodeAddress common.Address) params.ScsKind

GetSCSRole: return the connected SCS info.

func (*VnodeServer) GetScsPushMsgChan

func (s *VnodeServer) GetScsPushMsgChan() chan pb.ScsPushMsg

func (*VnodeServer) GetScsPushResChan

func (s *VnodeServer) GetScsPushResChan() chan pb.ScsPushMsg

func (*VnodeServer) GetScsRegChan

func (s *VnodeServer) GetScsRegChan() chan pb.ScsPushMsg

func (*VnodeServer) NotifyMsgRunState

func (s *VnodeServer) NotifyMsgRunState(hash common.Hash) bool

func (*VnodeServer) PingScsServers

func (s *VnodeServer) PingScsServers(scsid string, blknum *big.Int) error

func (*VnodeServer) RemoteCall

func (s *VnodeServer) RemoteCall(ctx context.Context, in *pb.RemoteCallRequest) (*pb.RemoteCallReply, error)

func (*VnodeServer) ScbPublicCall

func (*VnodeServer) ScsPush

func (s *VnodeServer) ScsPush(stream pb.Vnode_ScsPushServer) error

func (*VnodeServer) ScsService

func (s *VnodeServer) ScsService() bool

SCSService, API functions, returns if the SCSService is open (= true) or not (=false), indication if the Vnode is providing SCS service or not.

func (*VnodeServer) ServiceCfg

func (s *VnodeServer) ServiceCfg() string

ServiceCfg, RPC API, returns the service info "localhost:50062",

func (*VnodeServer) ShowToPublic

func (s *VnodeServer) ShowToPublic() bool

ShowToPublic, RPC API, returns: true - the VNODE can be listed on the net scan, false - the VNODE won't be listed.

func (*VnodeServer) UpdateScsServerList

func (s *VnodeServer) UpdateScsServerList(shakeInfo *types.ShakeInfo) error

func (*VnodeServer) UploadBlock

UploadBlock - upload receiving the block from SCS, save it to local disk for persistency

func (*VnodeServer) VnodeIP

func (s *VnodeServer) VnodeIP() string

VnodeIP: RPC API, returns the VNODEIP from the input vnodeconfig.json

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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