github.com/reapchain/go-reapchain@v0.2.15-0.20210609012950-9735c110c705/qmanager/global/variables.go (about)

     1  package global
     2  
     3  import (
     4  	"crypto/ecdsa"
     5  	"github.com/ethereum/go-ethereum/common"
     6  	"github.com/syndtr/goleveldb/leveldb"
     7  	"net"
     8  )
     9  
    10  var (
    11  
    12  	QManagerStorage *leveldb.DB
    13  	QManConnected bool  //If I'm Qmanager, this is true. when start p2p node, check whether Qman or not.
    14  	QManagerAddress *net.UDPAddr
    15  	BootNodeReady bool
    16  	QRNGDeviceStat bool
    17  	QRNGFilePrefix string
    18  	RandomNumbers []uint64
    19  	BootNodePort int
    20  	BootNodeID string
    21  	IsBootNode bool
    22  	QManPubKey *ecdsa.PublicKey
    23  	GovernanceList []GovStruct
    24  	DBDataList []QManDBStruct
    25  )
    26  type (
    27  	QManDBStruct struct {
    28  		ID      string
    29  		Address  string
    30  		Timestamp	string
    31  		Tag string
    32  	}
    33  )
    34  type Message struct {
    35  	Message string
    36  	Code int
    37  }
    38  type GovStruct struct {
    39  	Validator string
    40  	Tag common.Tag
    41  }
    42  type RequestStruct struct {
    43  	Proposer string
    44  }
    45  type RequestCoordiStruct struct {
    46  	QRND uint64
    47  }
    48  type CoordiDecideStruct struct {
    49  	Status bool
    50  }
    51  func CheckBootNodePortAndID(NodeID string, Port int) bool{
    52  	 if NodeID == BootNodeID && Port == BootNodePort {
    53  	 	return true
    54  	 }
    55  	 return false
    56  }