From c7eb46444a465f197ce3fce9ffaf5301e675e721 Mon Sep 17 00:00:00 2001 From: Alok Kothari Date: Sat, 18 Aug 2018 15:41:08 -0700 Subject: [PATCH] building identity chain --- identitychain/identitychain.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/identitychain/identitychain.go b/identitychain/identitychain.go index 38a7f7253..ca3fc40b5 100644 --- a/identitychain/identitychain.go +++ b/identitychain/identitychain.go @@ -7,6 +7,7 @@ import ( "sync" "github.com/simple-rules/harmony-benchmark/log" + "github.com/simple-rules/harmony-benchmark/p2p" "github.com/simple-rules/harmony-benchmark/waitnode" ) @@ -19,18 +20,6 @@ type IdentityChain struct { log log.Logger } -func main() { - var IDC IdentityChain - - go func() { - genesisBlock := &IdentityBlock{0, "127.0.0.1", "8080", 0} - mutex.Lock() - IDC.Identities = append(IDC.Identities, genesisBlock) - mutex.Unlock() - - }() -} - //IdentityChainHandler handles transactions func (IDC *IdentityChain) IdentityChainHandler(conn net.Conn) { fmt.Println("yay") @@ -51,3 +40,15 @@ func (IDC *IdentityChain) listenOnPort(port string) { go IDC.IdentityChainHandler(conn) } } + +func main() { + var IDC IdentityChain + var nullPeer p2p.Peer + go func() { + genesisBlock := &IdentityBlock{nullPeer, 0} + mutex.Lock() + IDC.Identities = append(IDC.Identities, genesisBlock) + mutex.Unlock() + + }() +}