From 876933341843196b95fad8f9ff3599c9b5783596 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Fri, 7 Dec 2018 12:21:58 -0800 Subject: [PATCH] refactor idc to bc (beacon chain) --- benchmark.go | 6 +++--- client/txgen/main.go | 6 +++--- discovery/discovery.go | 8 ++++---- newnode/newnode.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/benchmark.go b/benchmark.go index 9d591dc92..cbc75c4c4 100644 --- a/benchmark.go +++ b/benchmark.go @@ -91,8 +91,8 @@ func main() { onlyLogTps := flag.Bool("only_log_tps", false, "Only log TPS if true") //This IP belongs to jenkins.harmony.one - idcIP := flag.String("idc", "127.0.0.1", "IP of the identity chain") - idcPort := flag.String("idc_port", "8081", "port of the identity chain") + bcIP := flag.String("bc", "127.0.0.1", "IP of the identity chain") + bcPort := flag.String("bc_port", "8081", "port of the identity chain") peerDiscovery := flag.Bool("peer_discovery", false, "Enable Peer Discovery") //Leader needs to have a minimal number of peers to start consensus @@ -118,7 +118,7 @@ func main() { //Use Peer Discovery to get shard/leader/peer/... if *peerDiscovery { candidateNode := pkg_newnode.New(*ip, *port) - BCPeer := p2p.Peer{IP: *idcIP, Port: *idcPort} + BCPeer := p2p.Peer{IP: *bcIP, Port: *bcPort} candidateNode.ContactBeaconChain(BCPeer) shardID = candidateNode.GetShardID() leader = candidateNode.GetLeader() diff --git a/client/txgen/main.go b/client/txgen/main.go index 6ef0ace6e..697931ade 100644 --- a/client/txgen/main.go +++ b/client/txgen/main.go @@ -52,8 +52,8 @@ func main() { versionFlag := flag.Bool("version", false, "Output version info") crossShardRatio := flag.Int("cross_shard_ratio", 30, "The percentage of cross shard transactions.") - idcIP := flag.String("idc", "127.0.0.1", "IP of the identity chain") - idcPort := flag.String("idc_port", "8081", "port of the identity chain") + bcIP := flag.String("bc", "127.0.0.1", "IP of the identity chain") + bcPort := flag.String("bc_port", "8081", "port of the identity chain") peerDiscovery := flag.Bool("peer_discovery", false, "Enable Peer Discovery") flag.Parse() @@ -72,7 +72,7 @@ func main() { if *peerDiscovery { candidateNode := newnode.New(*ip, *port) - BCPeer := p2p.Peer{IP: *idcIP, Port: *idcPort} + BCPeer := p2p.Peer{IP: *bcIP, Port: *bcPort} candidateNode.ContactBeaconChain(BCPeer) peers = nil clientPeer = &p2p.Peer{IP: *ip, Port: *port} diff --git a/discovery/discovery.go b/discovery/discovery.go index 1ad881454..5fdffea82 100644 --- a/discovery/discovery.go +++ b/discovery/discovery.go @@ -22,7 +22,7 @@ type ConfigEntry struct { } func (config ConfigEntry) String() string { - return fmt.Sprintf("idc: %v:%v", config.IP, config.Port) + return fmt.Sprintf("bc: %v:%v", config.IP, config.Port) } // New return new ConfigEntry. @@ -38,14 +38,14 @@ func New(priK kyber.Scalar, pubK kyber.Point) *ConfigEntry { } // StartClientMode starts client mode. -func (config *ConfigEntry) StartClientMode(idcIP, idcPort string) error { +func (config *ConfigEntry) StartClientMode(bcIP, bcPort string) error { config.IP = "myip" config.Port = "myport" - fmt.Printf("idc ip/port: %v/%v\n", idcIP, idcPort) + fmt.Printf("bc ip/port: %v/%v\n", bcIP, bcPort) // ... - // TODO: connect to idc, and wait unless acknowledge + // TODO: connect to bc, and wait unless acknowledge return nil } diff --git a/newnode/newnode.go b/newnode/newnode.go index b584544fd..ace735fd9 100644 --- a/newnode/newnode.go +++ b/newnode/newnode.go @@ -61,7 +61,7 @@ func (node *NewNode) ContactBeaconChain(BCPeer p2p.Peer) { } func (node NewNode) String() string { - return fmt.Sprintf("idc: %v:%v and node info %v", node.Self.IP, node.Self.Port, node.SetInfo) + return fmt.Sprintf("bc: %v:%v and node info %v", node.Self.IP, node.Self.Port, node.SetInfo) } // RequestBeaconChain requests beacon chain for identity data