Merge branch 'master' of github.com:harmony-one/harmony into rj_branch

pull/542/head
Rongjian Lan 6 years ago
commit fcac118917
  1. 15
      api/client/client.go
  2. 18
      api/client/client_test.go
  3. 1
      api/service/config.go
  4. 28
      api/service/discovery/service.go
  5. 26
      cmd/client/txgen/main.go
  6. 60
      cmd/client/wallet/lib/lib.go
  7. 14
      cmd/client/wallet/lib/lib_test.go
  8. 36
      cmd/client/wallet/main.go
  9. 280
      go.sum
  10. 3
      internal/configs/node/config.go
  11. 24
      node/node.go
  12. 2
      node/node_handler.go
  13. 14
      node/service_setup.go
  14. 2
      scripts/go_executable_build.sh

@ -8,7 +8,7 @@ import (
// Client represents a node (e.g. a wallet) which sends transactions and receives responses from the harmony network // Client represents a node (e.g. a wallet) which sends transactions and receives responses from the harmony network
type Client struct { type Client struct {
Leaders map[uint32]p2p.Peer // Map of shard Id and corresponding leader ShardIDs []uint32 // list of ShardID
UpdateBlocks func([]*types.Block) // Closure function used to sync new block with the leader. Once the leader finishes the consensus on a new block, it will send it to the clients. Clients use this method to update their blockchain UpdateBlocks func([]*types.Block) // Closure function used to sync new block with the leader. Once the leader finishes the consensus on a new block, it will send it to the clients. Clients use this method to update their blockchain
log log.Logger // Log utility log log.Logger // Log utility
@ -18,20 +18,11 @@ type Client struct {
} }
// NewClient creates a new Client // NewClient creates a new Client
func NewClient(host p2p.Host, leaders map[uint32]p2p.Peer) *Client { func NewClient(host p2p.Host, shardIDs []uint32) *Client {
client := Client{} client := Client{}
client.Leaders = leaders
client.host = host client.host = host
client.ShardIDs = shardIDs
// Logger // Logger
client.log = log.New() client.log = log.New()
return &client return &client
} }
// GetLeaders returns leader peers.
func (client *Client) GetLeaders() []p2p.Peer {
leaders := []p2p.Peer{}
for _, leader := range client.Leaders {
leaders = append(leaders, leader)
}
return leaders
}

@ -1,24 +1,14 @@
package client package client
import ( import (
"reflect"
"testing" "testing"
"github.com/harmony-one/harmony/p2p"
) )
func TestClient(t *testing.T) { func TestClient(t *testing.T) {
leaders := map[uint32]p2p.Peer{ shardIDs := []uint32{0}
0: p2p.Peer{ client := NewClient(nil, shardIDs)
IP: "127.0.0.1",
Port: "90",
},
}
client := NewClient(nil, leaders)
leadersGot := client.GetLeaders()
if len(leadersGot) != 1 || !reflect.DeepEqual(leaders[0], leadersGot[0]) { if len(client.ShardIDs) != 1 || client.ShardIDs[0] != 0 {
t.Errorf("expected: %v, got: %v\n", leaders[0], leadersGot[0]) t.Errorf("client initiate incorrect")
} }
} }

@ -18,6 +18,7 @@ type NodeConfig struct {
Client p2p.GroupID // the client group ID of the shard Client p2p.GroupID // the client group ID of the shard
IsClient bool // whether this node is a client node, such as wallet/txgen IsClient bool // whether this node is a client node, such as wallet/txgen
IsBeacon bool // whether this node is a beacon node or not IsBeacon bool // whether this node is a beacon node or not
IsWallet bool // whether this node is a wallet or not
IsLeader bool // whether this node is a leader or not IsLeader bool // whether this node is a leader or not
ShardID uint32 // shardID of this node ShardID uint32 // shardID of this node
Actions map[p2p.GroupID]p2p.ActionType // actions on the groups Actions map[p2p.GroupID]p2p.ActionType // actions on the groups

@ -69,9 +69,37 @@ func (s *Service) NotifyService(params map[string]interface{}) {
// Run is the main function of the service // Run is the main function of the service
func (s *Service) Run() { func (s *Service) Run() {
if s.config.IsWallet {
go s.addP2pPeers()
return
}
go s.contactP2pPeers() go s.contactP2pPeers()
} }
func (s *Service) addP2pPeers() {
count := 0
for {
select {
case peer, ok := <-s.peerChan:
if !ok {
utils.GetLogInstance().Debug("[Wallet] No More Peer")
break
}
if s.addBeaconPeerFunc != nil {
s.addBeaconPeerFunc(&peer)
count++
if count > 0 { // TODO currently we use 1 peer for walletNode
return
}
}
case <-s.stopChan:
utils.GetLogInstance().Debug("wallet: stop discovery")
return
}
}
}
func (s *Service) contactP2pPeers() { func (s *Service) contactP2pPeers() {
tick := time.NewTicker(5 * time.Second) tick := time.NewTicker(5 * time.Second)

@ -72,7 +72,7 @@ func main() {
utils.BootNodes = bootNodeAddrs utils.BootNodes = bootNodeAddrs
} }
var shardIDLeaderMap map[uint32]p2p.Peer var shardIDs []uint32
nodePriKey, _, err := utils.LoadKeyFromFile(*keyFile) nodePriKey, _, err := utils.LoadKeyFromFile(*keyFile)
if err != nil { if err != nil {
panic(err) panic(err)
@ -86,13 +86,12 @@ func main() {
selfPeer := p2p.Peer{IP: *ip, Port: *port, ValidatorID: -1, ConsensusPubKey: peerPubKey} selfPeer := p2p.Peer{IP: *ip, Port: *port, ValidatorID: -1, ConsensusPubKey: peerPubKey}
// Init with LibP2P enabled, FIXME: (leochen) right now we support only one shard // Init with LibP2P enabled, FIXME: (leochen) right now we support only one shard
shardIDLeaderMap = make(map[uint32]p2p.Peer) shardIDs = append(shardIDs, 0)
shardIDLeaderMap[0] = p2p.Peer{}
// Do cross shard tx if there are more than one shard // Do cross shard tx if there are more than one shard
setting := txgen.Settings{ setting := txgen.Settings{
NumOfAddress: 10000, NumOfAddress: 10000,
CrossShard: len(shardIDLeaderMap) > 1, CrossShard: len(shardIDs) > 1,
MaxNumTxsPerBatch: *maxNumTxsPerBatch, MaxNumTxsPerBatch: *maxNumTxsPerBatch,
CrossShardRatio: *crossShardRatio, CrossShardRatio: *crossShardRatio,
} }
@ -112,7 +111,7 @@ func main() {
if err != nil { if err != nil {
panic("unable to new host in txgen") panic("unable to new host in txgen")
} }
for shardID := range shardIDLeaderMap { for _, shardID := range shardIDs {
node := node.New(host, &consensus.Consensus{ShardID: shardID}, nil) node := node.New(host, &consensus.Consensus{ShardID: shardID}, nil)
// Assign many fake addresses so we have enough address to play with at first // Assign many fake addresses so we have enough address to play with at first
nodes = append(nodes, node) nodes = append(nodes, node)
@ -121,7 +120,7 @@ func main() {
// Client/txgenerator server node setup // Client/txgenerator server node setup
consensusObj := consensus.New(host, "0", nil, p2p.Peer{}) consensusObj := consensus.New(host, "0", nil, p2p.Peer{})
clientNode := node.New(host, consensusObj, nil) clientNode := node.New(host, consensusObj, nil)
clientNode.Client = client.NewClient(clientNode.GetHost(), shardIDLeaderMap) clientNode.Client = client.NewClient(clientNode.GetHost(), shardIDs)
readySignal := make(chan uint32) readySignal := make(chan uint32)
@ -161,7 +160,7 @@ func main() {
// wait for 3 seconds for client to send ping message to leader // wait for 3 seconds for client to send ping message to leader
// FIXME (leo) the readySignal should be set once we really sent ping message to leader // FIXME (leo) the readySignal should be set once we really sent ping message to leader
time.Sleep(3 * time.Second) // wait for nodes to be ready time.Sleep(3 * time.Second) // wait for nodes to be ready
for i := range shardIDLeaderMap { for _, i := range shardIDs {
readySignal <- i readySignal <- i
} }
}() }()
@ -194,7 +193,7 @@ func main() {
lock.Lock() lock.Lock()
for shardID, txs := range shardIDTxsMap { // Send the txs to corresponding shards for shardID, txs := range shardIDTxsMap { // Send the txs to corresponding shards
go func(shardID uint32, txs types.Transactions) { go func(shardID uint32, txs types.Transactions) {
SendTxsToLeader(clientNode, shardIDLeaderMap[shardID], txs) SendTxsToShard(clientNode, txs)
}(shardID, txs) }(shardID, txs)
} }
lock.Unlock() lock.Unlock()
@ -211,15 +210,8 @@ func main() {
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
} }
// SendTxsToLeader sends txs to leader account. // SendTxsToShard sends txs to shard, currently just to beacon shard
func SendTxsToLeader(clientNode *node.Node, leader p2p.Peer, txs types.Transactions) { func SendTxsToShard(clientNode *node.Node, txs types.Transactions) {
utils.GetLogInstance().Debug("[Generator] Sending account-based txs to...", "leader", leader, "numTxs", len(txs))
msg := proto_node.ConstructTransactionListMessageAccount(txs) msg := proto_node.ConstructTransactionListMessageAccount(txs)
clientNode.GetHost().SendMessageToGroups([]p2p.GroupID{p2p.GroupIDBeaconClient}, p2p_host.ConstructP2pMessage(byte(0), msg)) clientNode.GetHost().SendMessageToGroups([]p2p.GroupID{p2p.GroupIDBeaconClient}, p2p_host.ConstructP2pMessage(byte(0), msg))
} }
func debugPrintShardIDLeaderMap(leaderMap map[uint32]p2p.Peer) {
for k, v := range leaderMap {
utils.GetLogInstance().Debug("Leader", "ShardID", k, "Leader", v)
}
}

@ -5,49 +5,65 @@ import (
"time" "time"
"github.com/harmony-one/harmony/api/client" "github.com/harmony-one/harmony/api/client"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/utils" "github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/node" "github.com/harmony-one/harmony/node"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
p2p_host "github.com/harmony-one/harmony/p2p/host"
"github.com/harmony-one/harmony/p2p/p2pimpl" "github.com/harmony-one/harmony/p2p/p2pimpl"
ma "github.com/multiformats/go-multiaddr"
) )
// CreateWalletNode creates wallet server node. // CreateWalletNode creates wallet server node.
func CreateWalletNode() *node.Node { func CreateWalletNode() *node.Node {
shardIDLeaderMap := make(map[uint32]p2p.Peer) utils.BootNodes = getBootNodes()
shardIDs := []uint32{0}
// port, _ := strconv.Atoi("9999")
// dummy host for wallet // dummy host for wallet
self := p2p.Peer{IP: "127.0.0.1", Port: "6789"} self := p2p.Peer{IP: "127.0.0.1", Port: "6999"}
priKey, _, _ := utils.GenKeyP2P("127.0.0.1", "6789") priKey, _, _ := utils.GenKeyP2P("127.0.0.1", "6999")
host, err := p2pimpl.NewHost(&self, priKey) host, err := p2pimpl.NewHost(&self, priKey)
if err != nil { if err != nil {
panic(err) panic(err)
} }
/*
for _, leader := range response.Leaders {
peerID, err := peer.IDB58Decode(leader.PeerID)
if err != nil {
panic(err)
}
leaderPeer := p2p.Peer{IP: leader.Ip, Port: leader.Port, PeerID: peerID}
shardIDLeaderMap[leader.ShardId] = leaderPeer
host.AddPeer(&leaderPeer)
}
*/
walletNode := node.New(host, nil, nil) walletNode := node.New(host, nil, nil)
walletNode.Client = client.NewClient(walletNode.GetHost(), shardIDLeaderMap) walletNode.Client = client.NewClient(walletNode.GetHost(), shardIDs)
walletNode.NodeConfig.SetRole(nodeconfig.WalletNode)
walletNode.ServiceManagerSetup()
walletNode.RunServices()
return walletNode return walletNode
} }
// GetPeersFromBeaconChain get peers from beacon chain
// TODO: add support for normal shards
func GetPeersFromBeaconChain(walletNode *node.Node) []p2p.Peer {
peers := []p2p.Peer{}
time.Sleep(5 * time.Second)
walletNode.BeaconNeighbors.Range(func(k, v interface{}) bool {
peers = append(peers, v.(p2p.Peer))
return true
})
fmt.Println("peers: ", peers)
return peers
}
// SubmitTransaction submits the transaction to the Harmony network // SubmitTransaction submits the transaction to the Harmony network
func SubmitTransaction(tx *types.Transaction, walletNode *node.Node, shardID uint32) error { func SubmitTransaction(tx *types.Transaction, walletNode *node.Node, shardID uint32) error {
// msg := proto_node.ConstructTransactionListMessageAccount(types.Transactions{tx}) msg := proto_node.ConstructTransactionListMessageAccount(types.Transactions{tx})
// leader := walletNode.Client.Leaders[shardID] walletNode.GetHost().SendMessageToGroups([]p2p.GroupID{p2p.GroupIDBeaconClient}, p2p_host.ConstructP2pMessage(byte(0), msg))
// walletNode.SendMessage(leader, msg)
fmt.Printf("Transaction Id for shard %d: %s\n", int(shardID), tx.Hash().Hex()) fmt.Printf("Transaction Id for shard %d: %s\n", int(shardID), tx.Hash().Hex())
time.Sleep(300 * time.Millisecond)
return nil return nil
} }
func getBootNodes() []ma.Multiaddr {
addrStrings := []string{"/ip4/54.213.43.194/tcp/9874/p2p/QmdZ7ccH4A6jr6kKzdhx2ttfKz6AEeTpwMChysUL1QLbYX"}
bootNodeAddrs, err := utils.StringsToAddrs(addrStrings)
if err != nil {
panic(err)
}
return bootNodeAddrs
}

@ -6,12 +6,12 @@ import (
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
"github.com/harmony-one/harmony/api/client" "github.com/harmony-one/harmony/api/client"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/node" "github.com/harmony-one/harmony/node"
"github.com/harmony-one/harmony/p2p" "github.com/harmony-one/harmony/p2p"
p2p_host "github.com/harmony-one/harmony/p2p/host"
mock_host "github.com/harmony-one/harmony/p2p/host/mock" mock_host "github.com/harmony-one/harmony/p2p/host/mock"
peer "github.com/libp2p/go-libp2p-peer"
) )
func TestCreateWalletNode(test *testing.T) { func TestCreateWalletNode(test *testing.T) {
@ -31,11 +31,13 @@ func TestSubmitTransaction(test *testing.T) {
m.EXPECT().GetSelfPeer().AnyTimes() m.EXPECT().GetSelfPeer().AnyTimes()
walletNode := node.New(m, nil, nil) walletNode := node.New(m, nil, nil)
priKey, _, _ := utils.GenKeyP2P("127.0.0.1", "9990") walletNode.Client = client.NewClient(walletNode.GetHost(), []uint32{0})
peerID, _ := peer.IDFromPrivateKey(priKey)
walletNode.Client = client.NewClient(walletNode.GetHost(), map[uint32]p2p.Peer{0: p2p.Peer{IP: "127.0.0.1", Port: "9990", PeerID: peerID}})
SubmitTransaction(&types.Transaction{}, walletNode, 0) tx := &types.Transaction{}
msg := proto_node.ConstructTransactionListMessageAccount(types.Transactions{tx})
m.EXPECT().SendMessageToGroups([]p2p.GroupID{p2p.GroupIDBeaconClient}, p2p_host.ConstructP2pMessage(byte(0), msg))
SubmitTransaction(tx, walletNode, 0)
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
} }

@ -306,30 +306,32 @@ func convertBalanceIntoReadableFormat(balance *big.Int) string {
} }
// FetchBalance fetches account balance of specified address from the Harmony network // FetchBalance fetches account balance of specified address from the Harmony network
// TODO add support for non beacon chain shards
func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]AccountState { func FetchBalance(address common.Address, walletNode *node.Node) map[uint32]AccountState {
result := make(map[uint32]AccountState) result := make(map[uint32]AccountState)
for shardID, leader := range walletNode.Client.Leaders { peers := lib.GetPeersFromBeaconChain(walletNode)
port, _ := strconv.Atoi(leader.Port)
client := clientService.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff)) peer := peers[0]
response := client.GetBalance(address) port, _ := strconv.Atoi(peer.Port)
balance := big.NewInt(0) client := clientService.NewClient(peer.IP, strconv.Itoa(port+node.ClientServicePortDiff))
balance.SetBytes(response.Balance) response := client.GetBalance(address)
result[shardID] = AccountState{balance, response.Nonce} balance := big.NewInt(0)
} balance.SetBytes(response.Balance)
result[0] = AccountState{balance, response.Nonce}
return result return result
} }
// GetFreeToken requests for token test token on each shard // GetFreeToken requests for token test token on each shard
func GetFreeToken(address common.Address, walletNode *node.Node) { func GetFreeToken(address common.Address, walletNode *node.Node) {
for shardID, leader := range walletNode.Client.Leaders { peers := lib.GetPeersFromBeaconChain(walletNode)
port, _ := strconv.Atoi(leader.Port) peer := peers[0]
client := clientService.NewClient(leader.IP, strconv.Itoa(port+node.ClientServicePortDiff)) port, _ := strconv.Atoi(peer.Port)
response := client.GetFreeToken(address) client := clientService.NewClient(peer.IP, strconv.Itoa(port+node.ClientServicePortDiff))
response := client.GetFreeToken(address)
txID := common.Hash{}
txID.SetBytes(response.TxId) txID := common.Hash{}
fmt.Printf("Transaction Id requesting free token in shard %d: %s\n", int(shardID), txID.Hex()) txID.SetBytes(response.TxId)
} fmt.Printf("Transaction Id requesting free token in shard %d: %s\n", int(0), txID.Hex())
} }
// ReadAddresses reads the addresses stored in local keystore // ReadAddresses reads the addresses stored in local keystore

280
go.sum

@ -1,280 +0,0 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/Workiva/go-datastructures v1.0.50 h1:slDmfW6KCHcC7U+LP3DDBbm4fqTwZGn1beOFPfGaLvo=
github.com/Workiva/go-datastructures v1.0.50/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/allegro/bigcache v1.2.0 h1:qDaE0QoF29wKBb3+pXFrJFy1ihe5OT9OiXhg1t85SxM=
github.com/allegro/bigcache v1.2.0/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/aristanetworks/goarista v0.0.0-20190213205509-c1e4b3741877 h1:oo0CoL8rbIZZe5mB9RoUhrEQ8X7+5yWALcrjiTf+F+o=
github.com/aristanetworks/goarista v0.0.0-20190213205509-c1e4b3741877/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ=
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32 h1:qkOC5Gd33k54tobS36cXdAzJbeHaduLtnLQQwNoIi78=
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg=
github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY=
github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc=
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ=
github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ=
github.com/dedis/fixbuf v1.0.2/go.mod h1:2syWkaV6ERSAvTkXkD08E6Nrh3Wl8pHMa8F/+HFuAL4=
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/ethereum/go-ethereum v1.8.23 h1:xVKYpRpe3cbkaWN8gsRgStsyTvz3s82PcQsbEofjhEQ=
github.com/ethereum/go-ethereum v1.8.23/go.mod h1:PwpWDrCLZrV+tfrhqqF6kPknbISMHaJv9Ln3kPCZLwY=
github.com/fd/go-nat v1.0.0 h1:DPyQ97sxA9ThrWYRPcWUz/z9TnpTIGRYODIQc/dy64M=
github.com/fd/go-nat v1.0.0/go.mod h1:BTBu/CKvMmOMUPkKVef1pngt2WFH/lg7E6yQnulfp6E=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
github.com/go-ole/go-ole v1.2.2/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.1-0.20181127190454-8d0c54c12466 h1:Kz9p8XEhFbEfi4ka99LEEwIXF4jqyIdB5fuh7UbMFj4=
github.com/golang/protobuf v1.2.1-0.20181127190454-8d0c54c12466/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.7.0 h1:tOSd0UKHQd6urX6ApfOn4XdBMY6Sh1MfxV3kmaazO+U=
github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gxed/hashland v0.0.0-20180221191214-d9f6b97f8db2/go.mod h1:YUhWml1NaWLTNBl4NPptkB8MadfaIhgq+a2TRc+Mw4Q=
github.com/gxed/hashland v0.0.1 h1:t22FZphoE5o1SP/T2+rRtK/OF+eoh9CYljLATKhbAMQ=
github.com/gxed/hashland v0.0.1/go.mod h1:YUhWml1NaWLTNBl4NPptkB8MadfaIhgq+a2TRc+Mw4Q=
github.com/gxed/hashland/keccakpg v0.0.1 h1:wrk3uMNaMxbXiHibbPO4S0ymqJMm41WiudyFSs7UnsU=
github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU=
github.com/gxed/hashland/murmur3 v0.0.1 h1:SheiaIt0sda5K+8FLz952/1iWS9zrnKsEJaOJu4ZbSc=
github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48=
github.com/harmony-one/bls v0.0.0-20190220064443-3c0ae384f04f h1:+tG9QwspzLug8+5/9KfpI7ExToAdMHkMzegzHfXE1J0=
github.com/harmony-one/bls v0.0.0-20190220064443-3c0ae384f04f/go.mod h1:ML9osB/z3hR9WAYZVj7qH+IP6oaPRPmshDbxrQyia7g=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324 h1:PV190X5/DzQ/tbFFG5YpT5mH6q+cHlfgqI5JuRnH9oE=
github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag=
github.com/ipfs/go-cid v0.9.0 h1:EdO7meRzk9MpAo8DbOmPDU3Yh2BQ4ABc0xN2wgEtREA=
github.com/ipfs/go-cid v0.9.0/go.mod h1:DEZAg7ik3SR8PY77P+hNaWtHtBirqeEgHbfmePL8WJA=
github.com/ipfs/go-datastore v3.2.0+incompatible h1:d9fANkqO9u1kgx6FSlZb8eZPDzD2uthVikkJAI7CUII=
github.com/ipfs/go-datastore v3.2.0+incompatible/go.mod h1:bYmHO9fuKO1Ca7dpdDBWQl0mndy5b0HFqSJjGlNYtzs=
github.com/ipfs/go-detect-race v1.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps=
github.com/ipfs/go-ipfs-util v1.2.8 h1:iZ+OcHCaN2BaHU0pe9JDGVySHUUmfwqHA2pd7XxMh7A=
github.com/ipfs/go-ipfs-util v1.2.8/go.mod h1:bmXd4M1Sn0MFKptfxu9KuWvtHySyFMzkSd2rcT8Hw80=
github.com/ipfs/go-log v1.5.7 h1:8ef7XW41hzAnvVNkK5009/bOA9/MFr7fhdzkfAqvolI=
github.com/ipfs/go-log v1.5.7/go.mod h1:AKYS9u+ECLT8t30brTaoVwu3f1FpGx6C0352oI1zQ0Q=
github.com/ipfs/go-todocounter v1.0.1 h1:YExLZ2JceUGDc0of36cNGgl0fqHvPHVpgpxHsQ2tYrg=
github.com/ipfs/go-todocounter v1.0.1/go.mod h1:l5aErvQc8qKE2r7NDMjmq5UNAvuZy0rC8BHOplkWvZ4=
github.com/jackpal/gateway v1.0.4 h1:LS5EHkLuQ6jzaHwULi0vL+JO0mU/n4yUtK8oUjHHOlM=
github.com/jackpal/gateway v1.0.4/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA=
github.com/jackpal/go-nat-pmp v1.0.1 h1:i0LektDkO1QlrTm/cSuP+PyBCDnYvjPLGl4LdWEMiaA=
github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jbenet/go-randbuf v0.0.0-20160322125720-674640a50e6a/go.mod h1:z659Yhk+3iK3C42MGnioXmP9y8uly7LuJaoDGyQyJp4=
github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2 h1:vhC1OXXiT9R2pczegwz6moDvuRpggaroAXhPIseh57A=
github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs=
github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8 h1:bspPhN+oKYFk5fcGNuQzp6IGzYQSenLEgH3s6jkXrWw=
github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY=
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/libp2p/go-addr-util v2.0.7+incompatible h1:Su3MLsvDzl7afq0Z99sCjQxhrjOpf/dVBIWOBur9qlY=
github.com/libp2p/go-addr-util v2.0.7+incompatible/go.mod h1:doh2auL/Rkfq1xHxDrWJGHZ8yDojPerOZoPu9XVwRB8=
github.com/libp2p/go-buffer-pool v0.1.3 h1:L0rKTSV7CdgVzxqP75+6AmJsjkvyM+xY8BCcoR9XLLw=
github.com/libp2p/go-buffer-pool v0.1.3/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ=
github.com/libp2p/go-conn-security v0.1.15 h1:Ohx7vYeje1Wal+eIBUkejcaQPhVjOAZveXoFmo5pArA=
github.com/libp2p/go-conn-security v0.1.15/go.mod h1:lIqm8x2wrAxlG+6CzJ3z4Nk5/F73zdjkS6RKbHSbaJ4=
github.com/libp2p/go-conn-security-multistream v0.1.15 h1:ZpIz9u+000dcUM4+S65rUfjSmwKNFFND+MFSLH0z6oc=
github.com/libp2p/go-conn-security-multistream v0.1.15/go.mod h1:hBY3HYjGnK86P3pX3wgr9IAfe3A/vZB830LJAMi1g88=
github.com/libp2p/go-flow-metrics v0.2.0 h1:GAJSg/g+xLuc7vz0RN96pRA9q/n5b5+Hs6SndagmOR4=
github.com/libp2p/go-flow-metrics v0.2.0/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8=
github.com/libp2p/go-libp2p v6.0.29+incompatible h1:5Ma1c9yDtuK5ek0rR8l1vIjAUU47AdwubcfahVjB2uo=
github.com/libp2p/go-libp2p v6.0.29+incompatible/go.mod h1:CyUlFa6Mw04PkmMg8gBIlHUl8j3TrEiA6oFiF4SgD8w=
github.com/libp2p/go-libp2p-autonat v0.0.0-20190218185411-842b9c4919f5 h1:2rN5WW88yexFlIdE3kjiuYBslbKzNCCwErqWmEGHVOQ=
github.com/libp2p/go-libp2p-autonat v0.0.0-20190218185411-842b9c4919f5/go.mod h1:xTjIQDpwWGdQyxXHrQ53UDED6FWYN8LErC+7e3yONiY=
github.com/libp2p/go-libp2p-blankhost v0.3.15/go.mod h1:v1Lnlzn2DFfVeAk2O19BnVm/OaoRlFZwSyq015ZT11I=
github.com/libp2p/go-libp2p-circuit v2.3.2+incompatible h1:WDJeAL9hBPsqymApE4j2UGT4ScwX75PPdJIXqz8QuMc=
github.com/libp2p/go-libp2p-circuit v2.3.2+incompatible/go.mod h1:DH3RV0Tb4cHZAdSsdNOitADXTqRiFZxJmSk7mMcCFN4=
github.com/libp2p/go-libp2p-crypto v2.0.5+incompatible h1:XVZ7JguuAuxfZ+MAbHsaKs508zRlAc7bGu65xKpxxns=
github.com/libp2p/go-libp2p-crypto v2.0.5+incompatible/go.mod h1:WHpT3tvhh7GM2INNJhQBuI6J+5z/o3QI0lTF5UVjppk=
github.com/libp2p/go-libp2p-discovery v0.0.0-20190221041540-5e0d40c7c880 h1:JjiWWyBC6BDqJtj/XbYEGbC/aM3z/jLSpXLW+FM4lxw=
github.com/libp2p/go-libp2p-discovery v0.0.0-20190221041540-5e0d40c7c880/go.mod h1:x77VonQuwToLyzZQJ6LG/Ai4o+3/u3ofz0S3K/JsTo8=
github.com/libp2p/go-libp2p-host v3.0.15+incompatible h1:8hHOOHT6MqkjbFHUx5ocxTu+H/hllx5zi4txz0KWD0E=
github.com/libp2p/go-libp2p-host v3.0.15+incompatible/go.mod h1:iAthoepYpyqzb89f4RmqzF9+ebsWPFBTvSedSlcWupg=
github.com/libp2p/go-libp2p-interface-connmgr v0.0.21 h1:XJtqDLi860LtusR6mY2PCPGeYXmFjm7gXb+ksqwnCpI=
github.com/libp2p/go-libp2p-interface-connmgr v0.0.21/go.mod h1:2LbTwxMveREcmkOWo/s6MM7xDvSZbW8J8kYDF4Mj648=
github.com/libp2p/go-libp2p-interface-pnet v3.0.0+incompatible h1:MNYpwR4opxOJGkDdlV4Vypd7aM6mlt76fad4m4KLk4k=
github.com/libp2p/go-libp2p-interface-pnet v3.0.0+incompatible/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k=
github.com/libp2p/go-libp2p-kad-dht v4.4.13-0.20190122223835-838d43da02fc+incompatible h1:TXI99n81cjlKNgBN0ylkNt2G2xRUNq86OBoribwWHGs=
github.com/libp2p/go-libp2p-kad-dht v4.4.13-0.20190122223835-838d43da02fc+incompatible/go.mod h1:o7SLAgKvO96vfE0SrzjJfAdCbJjKRfRnbtyUIQg+rqg=
github.com/libp2p/go-libp2p-kbucket v2.2.12+incompatible h1:iiUIxaHtRg09TvMfiCqCoqQsgDEOylz3Dvjb5q/juIw=
github.com/libp2p/go-libp2p-kbucket v2.2.12+incompatible/go.mod h1:MTtm31eal94QTxVOWYTDZ6G1YOJRN2G3ESQHbaPytLk=
github.com/libp2p/go-libp2p-loggables v1.1.24 h1:Uy59Z4AK53YZaswhlKwYM9tk/KOoQijpPliyl4TuAx4=
github.com/libp2p/go-libp2p-loggables v1.1.24/go.mod h1:jcP5HmpEBcQ2w5u9xhLkCv73GBPKz3weC/s6ZWhXn+k=
github.com/libp2p/go-libp2p-metrics v2.1.7+incompatible h1:daZgPZley96uWijqkfphS+EjNgj+wkMaNZA7Ie/O0t8=
github.com/libp2p/go-libp2p-metrics v2.1.7+incompatible/go.mod h1:ko4lRyuvbgwwxD2TJvt2RHONahjJlkn6l7L/iEbJBf0=
github.com/libp2p/go-libp2p-nat v0.8.8 h1:WUu6PfYMrUmcXb8hdP5tT+hua7o5nYwRZmSm1/JGSAc=
github.com/libp2p/go-libp2p-nat v0.8.8/go.mod h1:cA6+rN+EcOAzmSL3vQ53VxX/FfOL1WGeJUvZgqjm2eQ=
github.com/libp2p/go-libp2p-net v3.0.15+incompatible h1:7GDYsyQSXpGxS4SVxBt+iw5nbDnmVJWBg1XLdrzHOlo=
github.com/libp2p/go-libp2p-net v3.0.15+incompatible/go.mod h1:8W6Wx3AZbTRTe8zSMLoAmT3mGyau+w6kGIRk+Z+MZ7Q=
github.com/libp2p/go-libp2p-netutil v0.4.12/go.mod h1:lpxjq1x/eUtPYAZAtnC7dKWjQeTuYIYz2ZIPNDDBj3g=
github.com/libp2p/go-libp2p-peer v2.4.0+incompatible h1:1THIuO/h7GuITklYS7RgGCyoVl8aP9XH4NcokcdhDZc=
github.com/libp2p/go-libp2p-peer v2.4.0+incompatible/go.mod h1:fS2eFKRO1IomwBAf+SuE8P1XOT/AAiqSgVPNIFA7Jc0=
github.com/libp2p/go-libp2p-peerstore v2.0.6+incompatible h1:Jip/IIApZv58SNgSZctjJkLJf1c/zvUgwszTa0ihZbI=
github.com/libp2p/go-libp2p-peerstore v2.0.6+incompatible/go.mod h1:lLfgn0N3z2t+ER57a88K7NTZjMO27ez5TyWSURd428E=
github.com/libp2p/go-libp2p-protocol v1.0.0 h1:6AnF76m2VjjiaDisOahQnWSnX2WWaISOXC7q9/YJIrM=
github.com/libp2p/go-libp2p-protocol v1.0.0/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s=
github.com/libp2p/go-libp2p-pubsub v0.11.10 h1:ITODUkq9xpYUB2I9Fm3HM2MNviiTMmeMt9htvwlvz1g=
github.com/libp2p/go-libp2p-pubsub v0.11.10/go.mod h1:E2KoEMwM5nWtdGV+wWueN7g/j++VL9tmCfjzk1fLpWc=
github.com/libp2p/go-libp2p-record v4.1.7+incompatible h1:SDxar7iuh4z03b85lr8tVMSKNWWK73RLkQKyPwcxIeo=
github.com/libp2p/go-libp2p-record v4.1.7+incompatible/go.mod h1:fsxr7H89UzzL4pG23Aq2n/5aNAXxdGEbyBVepo8oXy8=
github.com/libp2p/go-libp2p-routing v2.7.1+incompatible h1:uS0k70z1Bmu6LKTofR6FhbNMBzZsS5uwHzLD3LjT3no=
github.com/libp2p/go-libp2p-routing v2.7.1+incompatible/go.mod h1:Alff8O712wWiftX462zvknNmi5RmXtLq/gATcxJ/Hq8=
github.com/libp2p/go-libp2p-secio v2.0.17+incompatible h1:Vihojo4Vro7Nx8/b129kziQlpoC8n1MxRmc/yEaxNBw=
github.com/libp2p/go-libp2p-secio v2.0.17+incompatible/go.mod h1:U7wBlYK2sZbUiTaGe6xJd/fyNq40gwn+jBk/iEUbUrA=
github.com/libp2p/go-libp2p-swarm v3.0.22+incompatible h1:nisFdWpgwDpgZpbxtruX9yZCN2XbOiSNRhR1zcOUhcA=
github.com/libp2p/go-libp2p-swarm v3.0.22+incompatible/go.mod h1:NHa7cA4/y8OKFw3BHQjLL9pwPDFXkgECO/k+2gqSFuk=
github.com/libp2p/go-libp2p-transport v3.0.15+incompatible h1:48KfTznuB0vEPcGN+exe3Au92Q4HvcZS3YTVMZbIQhs=
github.com/libp2p/go-libp2p-transport v3.0.15+incompatible/go.mod h1:lcwgOszllbhvQXul37Kv5YbSYXPoUhRB2Z+Nr3jaBmo=
github.com/libp2p/go-libp2p-transport-upgrader v0.1.16 h1:lUvSzPZHNgjZREVVv22IU4+teU2S7ovmqrW6nf9T/YQ=
github.com/libp2p/go-libp2p-transport-upgrader v0.1.16/go.mod h1:5r+arPlxwtCEF1aVi/fTQF/ZWGSPHLxBov1DlXDevDA=
github.com/libp2p/go-maddr-filter v1.1.10 h1:wzVup6MP3FLiiMnK9A2WlIx97UIPflyjEdIBzpYBbb4=
github.com/libp2p/go-maddr-filter v1.1.10/go.mod h1:9uHkmfw086BVLQyQFAbe/peEO9Iley6dafqm3cKHIAk=
github.com/libp2p/go-mplex v0.2.30 h1:oU4Tcs/0Mftdrm3/SXKtwy2SMdLY6oYv/V/FFQYRxXM=
github.com/libp2p/go-mplex v0.2.30/go.mod h1:00WmJEYVKH/Kz6wCom3VmxX7re6B/jgSZmkydBYAZ1w=
github.com/libp2p/go-msgio v0.0.6 h1:e8n/z4Z3AP9gmOITuJVLuD9Ok0ZOvjiNDsh1AAhd4EY=
github.com/libp2p/go-msgio v0.0.6/go.mod h1:u5M7EDois/gQxdPuEfNYQks5cAu9oxUGDU3dRkGping=
github.com/libp2p/go-reuseport v0.2.0 h1:gF9stUz461IFSuL4Uba8tEUFSS5gSUWEke7WuTgjSaw=
github.com/libp2p/go-reuseport v0.2.0/go.mod h1:ViUXkfLbcaqzYb7Yyi7ZP/n8nAezADhH9oLvj6TA83E=
github.com/libp2p/go-reuseport-transport v0.2.0 h1:SPXhVKXf3Tq8TW+LUm4K82KmB6mmAnTD7UsWSKg0w+o=
github.com/libp2p/go-reuseport-transport v0.2.0/go.mod h1:S8t1q+GgSDc6ijrQDNlCZ5Xe2xpFZCZylXoZPconqZE=
github.com/libp2p/go-sockaddr v1.0.3/go.mod h1:N/q858DTOi0BT81GpvIRIls1x7my5oLpbxYZnbRXVBM=
github.com/libp2p/go-stream-muxer v3.0.1+incompatible h1:w9q15DATxItvgKwr6/z+47AC/lg2itwoxu4W/uh0EgA=
github.com/libp2p/go-stream-muxer v3.0.1+incompatible/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14=
github.com/libp2p/go-tcp-transport v2.0.16+incompatible h1:xw8BoJ47Ra17ZTn+IR3i2VkOtzRjDgP29Lpr5Y7XyTg=
github.com/libp2p/go-tcp-transport v2.0.16+incompatible/go.mod h1:K6Zi9TkPvn5m/m0bktlJ6Fv9Vna2wvr/jiCtTRC7T8o=
github.com/libp2p/go-testutil v1.2.10/go.mod h1:8FHCRBHdt9BibhKebrOqVTJyW4cOZc52bfrGmw7ja+4=
github.com/libp2p/go-ws-transport v2.0.15+incompatible h1:hErErrrux0IX4kNl8QTskoBGWkMJ0KH+2o9Y63M4Iwo=
github.com/libp2p/go-ws-transport v2.0.15+incompatible/go.mod h1:qx7Dcw4onTaVNI3iG6q3XOKwNQWnXYhNEHYmhgQmKKk=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o=
github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g=
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ=
github.com/minio/sha256-simd v0.0.0-20181005183134-51976451ce19/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16 h1:5W7KhL8HVF3XCFOweFD3BNESdnO8ewyYTFT2R+/b8FQ=
github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U=
github.com/mr-tron/base58 v1.1.0 h1:Y51FGVJ91WBqCEabAi5OPUz38eAx8DakuAm5svLcsfQ=
github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8=
github.com/multiformats/go-multiaddr v1.4.0 h1:xt9fCCmSyTosXSvEhEqYnC75LiaDSdXycwOLJaDGPic=
github.com/multiformats/go-multiaddr v1.4.0/go.mod h1:1JAWc2R8uiQTLrCHI/lmOkXYu5B8025fQbZjq8//YgY=
github.com/multiformats/go-multiaddr-dns v0.2.5 h1:crSx6SJfKB1tHracH472jVXlMuw+JfaykVi6dNu/4ao=
github.com/multiformats/go-multiaddr-dns v0.2.5/go.mod h1:IGZKFM4G96cYgdMcUmHx5gtJxiHmvZLTQ9rdWXMKJyo=
github.com/multiformats/go-multiaddr-net v1.7.1 h1:1k758hMzdVA8+qE2z705TNWeemoi+oayshZwHBTWzcU=
github.com/multiformats/go-multiaddr-net v1.7.1/go.mod h1:AO4WqKzxLt+paJ0N0kufj6teQ2R6fZbnItDvGTwilmk=
github.com/multiformats/go-multibase v0.3.0 h1:KWPXEW0HCkqUHO7XZsoo0jwephTxh9roPT5fro7q0sw=
github.com/multiformats/go-multibase v0.3.0/go.mod h1:RUrDbdRB1mQ1K/3PAh7h7+6NliRK10PA5joM8V0IYLI=
github.com/multiformats/go-multihash v1.0.8/go.mod h1:sT17phG+xVgnrZc8ht/ZoCIV0sKRwvmZkXk46UfSxM4=
github.com/multiformats/go-multihash v1.0.10 h1:KUnC6rT8Vyw0gx4qXUS6VN1QHKrgmvdDCaURVQ7+miM=
github.com/multiformats/go-multihash v1.0.10/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U=
github.com/multiformats/go-multistream v0.3.9 h1:ZqVaUxtVzjRUCGaO3596vk/rj9UXheIGAdKXXo/VKUA=
github.com/multiformats/go-multistream v0.3.9/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opentracing/opentracing-go v1.0.2 h1:3jA2P6O1F9UOrWVpwrIo17pu01KWvNWg4X946/Y5Zwg=
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8=
github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM=
github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM=
github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66 h1:AwmkkZT+TucFotNCL+aNJ/0KCMsRtlXN9fs8uoOMSRk=
github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc h1:BCPnHtcboadS0DvysUuJXZ4lWVv5Bh5i7+tbIyi+ck4=
github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc/go.mod h1:r45hJU7yEoA81k6MWNhpMj/kms0n14dkzkxYHoB96UM=
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k=
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc=
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo=
github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM=
github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f h1:M/lL30eFZTKnomXY6huvM6G0+gVquFNf6mxghaWlFUg=
github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h1:cZNvX9cFybI01GriPRMXDtczuvUhgbcYr9iCGaNlRv8=
github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible h1:iqksILj8STw03EJQe7Laj4ubnw+ojOyik18cd5vPL1o=
github.com/whyrusleeping/go-smux-multiplex v3.0.16+incompatible/go.mod h1:34LEDbeKFZInPUrAG+bjuJmUXONGdEFW7XL0SpTY1y4=
github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible h1:BdYHctE9HJZLquG9tpTdwWcbG4FaX6tVKPGjCGgiVxo=
github.com/whyrusleeping/go-smux-multistream v2.0.2+incompatible/go.mod h1:dRWHHvc4HDQSHh9gbKEBbUZ+f2Q8iZTPG3UOGYODxSQ=
github.com/whyrusleeping/go-smux-yamux v2.0.8+incompatible h1:IGm/UP/JpEFS6D787sZnZg7RA6fZIR9c/Ms9DeAVNuk=
github.com/whyrusleeping/go-smux-yamux v2.0.8+incompatible/go.mod h1:6qHUzBXUbB9MXmw3AUdB52L8sEb/hScCqOdW2kj/wuI=
github.com/whyrusleeping/mafmt v1.2.8 h1:TCghSl5kkwEE0j+sU/gudyhVMRlpBin8fMBBHg59EbA=
github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA=
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds=
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI=
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow=
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg=
github.com/whyrusleeping/yamux v1.1.5 h1:4CK3aUUJQu0qpKZv5gEWJjNOQtdbdDhVVS6PJ+HimdE=
github.com/whyrusleeping/yamux v1.1.5/go.mod h1:E8LnQQ8HKx5KD29HZFUwM1PxCOdPRzGwur1mcYhXcD8=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2 h1:NwxKRvbkH5MsNkvOtPZi3/3kmI8CAzs3mtv+GLQMkNo=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190219092855-153ac476189d h1:Z0Ahzd7HltpJtjAHHxX8QFP3j1yYgiuvjbjRzDj/KH0=
golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.18.0 h1:IZl7mfBGfbhYx2p2rKRtYgDFw6SBz+kclmxYrCksPPA=
google.golang.org/grpc v1.18.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

@ -26,6 +26,7 @@ const (
BeaconValidator BeaconValidator
NewNode NewNode
ClientNode ClientNode
WalletNode
) )
func (role Role) String() string { func (role Role) String() string {
@ -44,6 +45,8 @@ func (role Role) String() string {
return "NewNode" return "NewNode"
case ClientNode: case ClientNode:
return "ClientNode" return "ClientNode"
case WalletNode:
return "WalletNode"
} }
return "Unknown" return "Unknown"
} }

@ -408,12 +408,35 @@ func (node *Node) RemovePeersHandler() {
} }
} }
func (node *Node) initWalletNodeConfiguration() (service.NodeConfig, chan p2p.Peer) {
chanPeer := make(chan p2p.Peer)
nodeConfig := service.NodeConfig{
IsBeacon: false,
IsClient: false,
IsWallet: true,
Beacon: p2p.GroupIDBeacon,
Group: p2p.GroupIDUnknown,
Actions: make(map[p2p.GroupID]p2p.ActionType),
}
nodeConfig.Actions[p2p.GroupIDBeaconClient] = p2p.ActionStop
var err error
node.groupReceiver, err = node.host.GroupReceiver(p2p.GroupIDBeaconClient)
if err != nil {
utils.GetLogInstance().Error("create group receiver error", "msg", err)
}
return nodeConfig, chanPeer
}
func (node *Node) initNodeConfiguration() (service.NodeConfig, chan p2p.Peer) { func (node *Node) initNodeConfiguration() (service.NodeConfig, chan p2p.Peer) {
chanPeer := make(chan p2p.Peer) chanPeer := make(chan p2p.Peer)
nodeConfig := service.NodeConfig{ nodeConfig := service.NodeConfig{
IsBeacon: false, IsBeacon: false,
IsClient: true, IsClient: true,
IsWallet: false,
Beacon: p2p.GroupIDBeacon, Beacon: p2p.GroupIDBeacon,
Group: p2p.GroupIDUnknown, Group: p2p.GroupIDUnknown,
Actions: make(map[p2p.GroupID]p2p.ActionType), Actions: make(map[p2p.GroupID]p2p.ActionType),
@ -435,6 +458,7 @@ func (node *Node) initBeaconNodeConfiguration() (service.NodeConfig, chan p2p.Pe
nodeConfig := service.NodeConfig{ nodeConfig := service.NodeConfig{
IsBeacon: true, IsBeacon: true,
IsClient: true, IsClient: true,
IsWallet: false,
Beacon: p2p.GroupIDBeacon, Beacon: p2p.GroupIDBeacon,
Group: p2p.GroupIDUnknown, Group: p2p.GroupIDUnknown,
Actions: make(map[p2p.GroupID]p2p.ActionType), Actions: make(map[p2p.GroupID]p2p.ActionType),

@ -155,7 +155,7 @@ func (node *Node) messageHandler(content []byte, sender string) {
} else { } else {
// for non-beaconchain node, subscribe to beacon block broadcast // for non-beaconchain node, subscribe to beacon block broadcast
role := node.NodeConfig.Role() role := node.NodeConfig.Role()
if proto_node.BlockMessageType(msgPayload[0]) == proto_node.Sync && role != nodeconfig.BeaconValidator && role != nodeconfig.BeaconLeader && role != nodeconfig.ClientNode { if proto_node.BlockMessageType(msgPayload[0]) == proto_node.Sync && (role == nodeconfig.ShardValidator || role == nodeconfig.ShardLeader || role == nodeconfig.NewNode) {
for _, block := range blocks { for _, block := range blocks {
node.BeaconBlockChannel <- block node.BeaconBlockChannel <- block
} }

@ -39,6 +39,8 @@ func (node *Node) setupForShardLeader() {
func (node *Node) setupForShardValidator() { func (node *Node) setupForShardValidator() {
nodeConfig, chanPeer := node.initNodeConfiguration() nodeConfig, chanPeer := node.initNodeConfiguration()
// Register client support service.
node.serviceManager.RegisterService(service.ClientSupport, clientsupport.New(node.blockchain.State, node.CallFaucetContract, node.getDeployedStakingContract, node.SelfPeer.IP, node.SelfPeer.Port))
// Register peer discovery service. "0" is the beacon shard ID. No need to do staking for beacon chain node. // Register peer discovery service. "0" is the beacon shard ID. No need to do staking for beacon chain node.
node.serviceManager.RegisterService(service.PeerDiscovery, discovery.New(node.host, nodeConfig, chanPeer, node.AddBeaconPeer)) node.serviceManager.RegisterService(service.PeerDiscovery, discovery.New(node.host, nodeConfig, chanPeer, node.AddBeaconPeer))
// Register networkinfo service. "0" is the beacon shard ID // Register networkinfo service. "0" is the beacon shard ID
@ -65,6 +67,8 @@ func (node *Node) setupForBeaconLeader() {
func (node *Node) setupForBeaconValidator() { func (node *Node) setupForBeaconValidator() {
nodeConfig, chanPeer := node.initBeaconNodeConfiguration() nodeConfig, chanPeer := node.initBeaconNodeConfiguration()
// Register client support service.
node.serviceManager.RegisterService(service.ClientSupport, clientsupport.New(node.blockchain.State, node.CallFaucetContract, node.getDeployedStakingContract, node.SelfPeer.IP, node.SelfPeer.Port))
// Register peer discovery service. No need to do staking for beacon chain node. // Register peer discovery service. No need to do staking for beacon chain node.
node.serviceManager.RegisterService(service.PeerDiscovery, discovery.New(node.host, nodeConfig, chanPeer, nil)) node.serviceManager.RegisterService(service.PeerDiscovery, discovery.New(node.host, nodeConfig, chanPeer, nil))
// Register networkinfo service. // Register networkinfo service.
@ -93,6 +97,14 @@ func (node *Node) setupForClientNode() {
node.serviceManager.RegisterService(service.NetworkInfo, networkinfo.New(node.host, p2p.GroupIDBeacon, chanPeer, nil)) node.serviceManager.RegisterService(service.NetworkInfo, networkinfo.New(node.host, p2p.GroupIDBeacon, chanPeer, nil))
} }
func (node *Node) setupForWalletNode() {
nodeConfig, chanPeer := node.initWalletNodeConfiguration()
// Register peer discovery service.
node.serviceManager.RegisterService(service.PeerDiscovery, discovery.New(node.host, nodeConfig, chanPeer, node.AddBeaconPeer))
// Register networkinfo service. "0" is the beacon shard ID
node.serviceManager.RegisterService(service.NetworkInfo, networkinfo.New(node.host, p2p.GroupIDBeacon, chanPeer, nil))
}
// ServiceManagerSetup setups service store. // ServiceManagerSetup setups service store.
func (node *Node) ServiceManagerSetup() { func (node *Node) ServiceManagerSetup() {
node.serviceManager = &service.Manager{} node.serviceManager = &service.Manager{}
@ -110,6 +122,8 @@ func (node *Node) ServiceManagerSetup() {
node.setupForNewNode() node.setupForNewNode()
case nodeconfig.ClientNode: case nodeconfig.ClientNode:
node.setupForClientNode() node.setupForClientNode()
case nodeconfig.WalletNode:
node.setupForWalletNode()
} }
node.serviceManager.SetupServiceMessageChan(node.serviceMessageChan) node.serviceManager.SetupServiceMessageChan(node.serviceMessageChan)
} }

@ -6,7 +6,7 @@ declare -A SRC
SRC[harmony]=cmd/harmony/main.go SRC[harmony]=cmd/harmony/main.go
SRC[txgen]=cmd/client/txgen/main.go SRC[txgen]=cmd/client/txgen/main.go
SRC[bootnode]=cmd/bootnode/main.go SRC[bootnode]=cmd/bootnode/main.go
# SRC[wallet]=cmd/client/wallet/main.go SRC[wallet]=cmd/client/wallet/main.go
BINDIR=bin BINDIR=bin
BUCKET=unique-bucket-bin BUCKET=unique-bucket-bin

Loading…
Cancel
Save