From 2f295f892b05f8d4455b338e685933ba8dc7b187 Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Tue, 11 Jun 2019 18:45:21 -0700 Subject: [PATCH] merge master --- .hmy/wallet.ini | 21 ++++++++++--------- cmd/client/txgen/main.go | 2 +- cmd/client/wallet/generated_wallet.ini.go | 21 ++++++++++--------- cmd/client/wallet/main.go | 4 ++-- cmd/harmony/main.go | 4 ++-- common/config/global_config.go | 9 +++++--- consensus/config.go | 9 ++++---- consensus/consensus.go | 2 +- consensus/consensus_service.go | 2 +- consensus/consensus_v2.go | 25 ++++++++--------------- consensus/view_change.go | 14 ++++++------- core/resharding.go | 6 +++--- crypto/bls/bls_test.go | 4 ++-- drand/drand_test.go | 2 +- internal/blsgen/lib.go | 4 ++-- internal/genesis/foundational.go | 9 ++++++++ internal/genesis/genesis.go | 12 +++++------ internal/genesis/newnodes.go | 4 ++-- internal/utils/flags.go | 3 +-- scripts/wallet.sh | 1 + 20 files changed, 82 insertions(+), 76 deletions(-) diff --git a/.hmy/wallet.ini b/.hmy/wallet.ini index d3be5901b..ba7fd59ef 100644 --- a/.hmy/wallet.ini +++ b/.hmy/wallet.ini @@ -30,19 +30,20 @@ rpc = 127.0.0.1:14556 [devnet] bootnode = /ip4/100.26.90.187/tcp/9871/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvvKXfh3tnEv bootnode = /ip4/54.213.43.194/tcp/9871/p2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj -shards = 3 +shards = 4 [devnet.shard0.rpc] -rpc = 13.57.196.136:14555 -rpc = 35.175.103.144:14555 -rpc = 54.245.176.36:14555 +rpc = l0.t1.hmny.io:14555 +rpc = s0.t1.hmny.io:14555 [devnet.shard1.rpc] -rpc = 35.163.188.234:14555 -rpc = 54.215.251.123:14555 -rpc = 54.153.11.146:14555 +rpc = l1.t1.hmny.io:14555 +rpc = s1.t1.hmny.io:14555 [devnet.shard2.rpc] -rpc = 52.201.246.212:14555 -rpc = 3.81.26.139:14555 -rpc = 18.237.42.209:14555 +rpc = l2.t1.hmny.io:14555 +rpc = s2.t1.hmny.io:14555 + +[devnet.shard3.rpc] +rpc = l3.t1.hmny.io:14555 +rpc = s3.t1.hmny.io:14555 diff --git a/cmd/client/txgen/main.go b/cmd/client/txgen/main.go index 49d58aa27..26b5bf048 100644 --- a/cmd/client/txgen/main.go +++ b/cmd/client/txgen/main.go @@ -111,7 +111,7 @@ func setUpTXGen() *node.Node { endIdx := startIdx + core.GenesisShardSize for _, acct := range genesis.GenesisAccounts[startIdx:endIdx] { secretKey := bls2.SecretKey{} - if err := secretKey.SetHexString(acct.BlsPriKey); err != nil { + if err := secretKey.DeserializeHexStr(acct.BlsPriKey); err != nil { _, _ = fmt.Fprintf(os.Stderr, "cannot parse secret key: %v\n", err) os.Exit(1) diff --git a/cmd/client/wallet/generated_wallet.ini.go b/cmd/client/wallet/generated_wallet.ini.go index c50bbe348..786bfb8eb 100644 --- a/cmd/client/wallet/generated_wallet.ini.go +++ b/cmd/client/wallet/generated_wallet.ini.go @@ -33,21 +33,22 @@ rpc = 127.0.0.1:14556 [devnet] bootnode = /ip4/100.26.90.187/tcp/9871/p2p/Qmdfjtk6hPoyrH1zVD9PEH4zfWLo38dP2mDvvKXfh3tnEv bootnode = /ip4/54.213.43.194/tcp/9871/p2p/QmRVbTpEYup8dSaURZfF6ByrMTSKa4UyUzJhSjahFzRqNj -shards = 3 +shards = 4 [devnet.shard0.rpc] -rpc = 13.57.196.136:14555 -rpc = 35.175.103.144:14555 -rpc = 54.245.176.36:14555 +rpc = l0.t1.hmny.io:14555 +rpc = s0.t1.hmny.io:14555 [devnet.shard1.rpc] -rpc = 35.163.188.234:14555 -rpc = 54.215.251.123:14555 -rpc = 54.153.11.146:14555 +rpc = l1.t1.hmny.io:14555 +rpc = s1.t1.hmny.io:14555 [devnet.shard2.rpc] -rpc = 52.201.246.212:14555 -rpc = 3.81.26.139:14555 -rpc = 18.237.42.209:14555 +rpc = l2.t1.hmny.io:14555 +rpc = s2.t1.hmny.io:14555 + +[devnet.shard3.rpc] +rpc = l3.t1.hmny.io:14555 +rpc = s3.t1.hmny.io:14555 ` ) diff --git a/cmd/client/wallet/main.go b/cmd/client/wallet/main.go index 89fc46359..272b09d3d 100644 --- a/cmd/client/wallet/main.go +++ b/cmd/client/wallet/main.go @@ -357,8 +357,8 @@ func processBlsgenCommand() { privateKey, fileName := blsgen.GenBlsKeyWithPassPhrase(password) publickKey := privateKey.GetPublicKey() - fmt.Printf("Bls private key: %s\n", privateKey.GetHexString()) - fmt.Printf("Bls serialized public key: %s\n", publickKey.SerializeToHexStr()) + fmt.Printf("Bls private key: %s\n", privateKey.SerializeToHexStr()) + fmt.Printf("Bls public key: %s\n", publickKey.SerializeToHexStr()) fmt.Printf("File storing the ENCRYPTED private key with your passphrase: %s\n", fileName) } diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 7dfc64c08..1189a8ae8 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -240,14 +240,14 @@ func createGlobalConfig() *nodeconfig.ConfigType { consensusPriKey := &bls.SecretKey{} if *isGenesis { - err := consensusPriKey.SetHexString(genesisAccount.BlsPriKey) + err := consensusPriKey.DeserializeHexStr(genesisAccount.BlsPriKey) if err != nil { panic(fmt.Errorf("generate key error")) } } else { // NewNode won't work /* - err := consensusPriKey.SetHexString(genesis.NewNodeAccounts[]) + err := consensusPriKey.DeserializeHexStr(genesis.NewNodeAccounts[]) if err != nil { panic(fmt.Errorf("generate key error")) } diff --git a/common/config/global_config.go b/common/config/global_config.go index 911dfb1a2..eb9dd717c 100644 --- a/common/config/global_config.go +++ b/common/config/global_config.go @@ -1,11 +1,14 @@ package config +// NetworkType describes the type of Harmony network type NetworkType int +// Constants for NetworkType const ( - Mainnet = 0 - Testnet = 1 - Devnet = 2 + Mainnet NetworkType = 0 + Testnet NetworkType = 1 + Devnet NetworkType = 2 ) +// Network is the type of Harmony network var Network = Testnet diff --git a/consensus/config.go b/consensus/config.go index 543ceea4f..28eced21d 100644 --- a/consensus/config.go +++ b/consensus/config.go @@ -4,18 +4,17 @@ import "time" // timeout constant const ( - receiveTimeout time.Duration = 5 * time.Second // The duration of viewChangeTimeout; when a view change is initialized with v+1 // timeout will be equal to viewChangeDuration; if view change failed and start v+2 // timeout will be 2*viewChangeDuration; timeout of view change v+n is n*viewChangeDuration - viewChangeDuration time.Duration = 30 * time.Second + viewChangeDuration time.Duration = 300 * time.Second // timeout duration for announce/prepare/commit - phaseDuration time.Duration = 90 * time.Second - bootstrapDuration time.Duration = 90 * time.Second + phaseDuration time.Duration = 300 * time.Second + bootstrapDuration time.Duration = 300 * time.Second maxLogSize uint32 = 1000 // threshold between received consensus message blockNum and my blockNum - consensusBlockNumBuffer uint64 = 1 + consensusBlockNumBuffer uint64 = 10 ) // TimeoutType is the type of timeout in view change protocol diff --git a/consensus/consensus.go b/consensus/consensus.go index 19097ce47..77a0ba970 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -377,7 +377,7 @@ func NewGenesisStakeInfoFinder() (*GenesisStakeInfoFinder, error) { for idx, account := range genesis.GenesisAccounts { blsSecretKeyHex := account.BlsPriKey blsSecretKey := bls.SecretKey{} - if err := blsSecretKey.SetHexString(blsSecretKeyHex); err != nil { + if err := blsSecretKey.DeserializeHexStr(blsSecretKeyHex); err != nil { return nil, ctxerror.New("cannot convert BLS secret key", "accountIndex", idx, ).WithCause(err) diff --git a/consensus/consensus_service.go b/consensus/consensus_service.go index cf8c19438..2e25fe236 100644 --- a/consensus/consensus_service.go +++ b/consensus/consensus_service.go @@ -555,7 +555,7 @@ func (consensus *Consensus) checkViewID(msg *PbftMessage) error { consensus.LeaderPubKey = msg.SenderPubkey consensus.ignoreViewIDCheck = false consensus.consensusTimeout[timeoutConsensus].Start() - utils.GetLogger().Debug("viewID and leaderKey override", "viewID", consensus.viewID, "leaderKey", consensus.LeaderPubKey.GetHexString()[:20]) + utils.GetLogger().Debug("viewID and leaderKey override", "viewID", consensus.viewID, "leaderKey", consensus.LeaderPubKey.SerializeToHexStr()[:20]) utils.GetLogger().Debug("start consensus timeout", "viewID", consensus.viewID, "block", consensus.blockNum) return nil } else if msg.ViewID > consensus.viewID { diff --git a/consensus/consensus_v2.go b/consensus/consensus_v2.go index 0e8d97f17..b221afc05 100644 --- a/consensus/consensus_v2.go +++ b/consensus/consensus_v2.go @@ -78,7 +78,7 @@ func (consensus *Consensus) tryAnnounce(block *types.Block) { } consensus.block = encodedBlock msgToSend := consensus.constructAnnounceMessage() - consensus.switchPhase(Prepare, false) + consensus.switchPhase(Prepare, true) // save announce message to pbftLog msgPayload, _ := proto.GetConsensusMessagePayload(msgToSend) @@ -117,7 +117,7 @@ func (consensus *Consensus) onAnnounce(msg *msg_pb.Message) { return } if !senderKey.IsEqual(consensus.LeaderPubKey) && consensus.mode.Mode() == Normal && !consensus.ignoreViewIDCheck { - utils.GetLogger().Warn("onAnnounce senderKey not match leader PubKey", "senderKey", senderKey.GetHexString()[:10], "leaderKey", consensus.LeaderPubKey.GetHexString()[:10]) + utils.GetLogger().Warn("onAnnounce senderKey not match leader PubKey", "senderKey", senderKey.SerializeToHexStr()[:10], "leaderKey", consensus.LeaderPubKey.SerializeToHexStr()[:10]) return } if err = verifyMessageSig(senderKey, msg); err != nil { @@ -209,12 +209,12 @@ func (consensus *Consensus) tryPrepare(blockHash common.Hash) { return } - if consensus.phase != Announce || consensus.blockNum != block.NumberU64() || !consensus.pbftLog.HasMatchingViewAnnounce(consensus.blockNum, consensus.viewID, hash) { + if consensus.blockNum != block.NumberU64() || !consensus.pbftLog.HasMatchingViewAnnounce(consensus.blockNum, consensus.viewID, hash) { utils.GetLogger().Debug("not match", "myPhase", consensus.phase, "myBlock", consensus.blockNum, "viewID", consensus.viewID) return } - consensus.switchPhase(Prepare, false) + consensus.switchPhase(Prepare, true) // Construct and send prepare message msgToSend := consensus.constructPrepareMessage() @@ -249,7 +249,7 @@ func (consensus *Consensus) onPrepare(msg *msg_pb.Message) { return } - if recvMsg.ViewID != consensus.viewID || recvMsg.BlockNum != consensus.blockNum || consensus.phase != Prepare { + if recvMsg.ViewID != consensus.viewID || recvMsg.BlockNum != consensus.blockNum { utils.GetLogger().Debug("onPrepare message not match", "myPhase", consensus.phase, "myViewID", consensus.viewID, "msgViewID", recvMsg.ViewID, "myBlockNum", consensus.blockNum, "msgBlockNum", recvMsg.BlockNum) return @@ -302,7 +302,7 @@ func (consensus *Consensus) onPrepare(msg *msg_pb.Message) { } if len(prepareSigs) >= consensus.Quorum() { - consensus.switchPhase(Commit, false) + consensus.switchPhase(Commit, true) // Construct and broadcast prepared message msgToSend, aggSig := consensus.constructPreparedMessage() consensus.aggregatedPrepareSig = aggSig @@ -415,13 +415,6 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { consensus.aggregatedPrepareSig = aggSig consensus.prepareBitmap = mask - if consensus.phase != Prepare { - utils.GetLogger().Debug("we are in a wrong phase", - "actualPhase", consensus.phase, - "expectedPhase", Prepare) - return - } - // Construct and send the commit message blockNumHash := make([]byte, 8) binary.LittleEndian.PutUint64(blockNumHash, consensus.blockNum) @@ -434,7 +427,7 @@ func (consensus *Consensus) onPrepared(msg *msg_pb.Message) { logger.Debug("sent commit message") } - consensus.switchPhase(Commit, false) + consensus.switchPhase(Commit, true) return } @@ -461,7 +454,7 @@ func (consensus *Consensus) onCommit(msg *msg_pb.Message) { return } - if recvMsg.ViewID != consensus.viewID || recvMsg.BlockNum != consensus.blockNum || consensus.phase != Commit { + if recvMsg.ViewID != consensus.viewID || recvMsg.BlockNum != consensus.blockNum { utils.GetLogger().Debug("not match", "myViewID", consensus.viewID, "viewID", recvMsg.ViewID, "myBlock", consensus.blockNum, "block", recvMsg.BlockNum, "myPhase", consensus.phase, "phase", Commit) return } @@ -535,7 +528,7 @@ func (consensus *Consensus) onCommit(msg *msg_pb.Message) { func (consensus *Consensus) finalizeCommits() { utils.GetLogger().Info("finalizing block", "num", len(consensus.commitSigs), "phase", consensus.phase) - consensus.switchPhase(Announce, false) + consensus.switchPhase(Announce, true) // Construct and broadcast committed message msgToSend, aggSig := consensus.constructCommittedMessage() diff --git a/consensus/view_change.go b/consensus/view_change.go index cf46bf0b7..836096869 100644 --- a/consensus/view_change.go +++ b/consensus/view_change.go @@ -121,7 +121,7 @@ func (consensus *Consensus) switchPhase(desirePhase PbftPhase, override bool) { func (consensus *Consensus) GetNextLeaderKey() *bls.PublicKey { idx := consensus.getIndexOfPubKey(consensus.LeaderPubKey) if idx == -1 { - utils.GetLogInstance().Warn("GetNextLeaderKey: currentLeaderKey not found", "key", consensus.LeaderPubKey.GetHexString()) + utils.GetLogInstance().Warn("GetNextLeaderKey: currentLeaderKey not found", "key", consensus.LeaderPubKey.SerializeToHexStr()) } idx = (idx + 1) % len(consensus.PublicKeys) return consensus.PublicKeys[idx] @@ -173,7 +173,7 @@ func (consensus *Consensus) startViewChange(viewID uint32) { diff := viewID - consensus.viewID duration := time.Duration(int64(diff) * int64(viewChangeDuration)) - utils.GetLogInstance().Info("startViewChange", "viewID", viewID, "timeoutDuration", duration, "nextLeader", consensus.LeaderPubKey.GetHexString()[:10]) + utils.GetLogInstance().Info("startViewChange", "viewID", viewID, "timeoutDuration", duration, "nextLeader", consensus.LeaderPubKey.SerializeToHexStr()[:10]) msgToSend := consensus.constructViewChangeMessage() consensus.host.SendMessageToGroups([]p2p.GroupID{p2p.NewGroupIDByShardID(p2p.ShardID(consensus.ShardID))}, host.ConstructP2pMessage(byte(17), msgToSend)) @@ -343,7 +343,7 @@ func (consensus *Consensus) onViewChange(msg *msg_pb.Message) { consensus.ReadySignal <- struct{}{} }() } else { - consensus.phase = Commit + consensus.switchPhase(Commit, true) copy(consensus.blockHash[:], consensus.m1Payload[:32]) aggSig, mask, err := consensus.readSignatureBitmapPayload(recvMsg.Payload, 32) if err != nil { @@ -371,7 +371,7 @@ func (consensus *Consensus) onViewChange(msg *msg_pb.Message) { consensus.consensusTimeout[timeoutViewChange].Stop() consensus.consensusTimeout[timeoutConsensus].Start() utils.GetLogger().Debug("new leader start consensus timeout and stop view change timeout", "viewID", consensus.viewID, "block", consensus.blockNum, "viewChangingID", consensus.mode.ViewID()) - utils.GetLogger().Debug("I am the new leader", "myKey", consensus.PubKey.GetHexString()[:20], "viewID", consensus.viewID, "block", consensus.blockNum) + utils.GetLogger().Debug("I am the new leader", "myKey", consensus.PubKey.SerializeToHexStr()[:20], "viewID", consensus.viewID, "block", consensus.blockNum) } utils.GetLogInstance().Debug("onViewChange", "numSigs", len(consensus.viewIDSigs), "needed", consensus.Quorum()) @@ -413,7 +413,7 @@ func (consensus *Consensus) onNewView(msg *msg_pb.Message) { } if !m3Sig.VerifyHash(m3Mask.AggregatePublic, viewIDHash) { - utils.GetLogInstance().Warn("onNewView unable to verify aggregated signature of m3 payload", "m3Sig", m3Sig.GetHexString()[:10], "m3Mask", m3Mask.Bitmap, "viewID", recvMsg.ViewID) + utils.GetLogInstance().Warn("onNewView unable to verify aggregated signature of m3 payload", "m3Sig", m3Sig.SerializeToHexStr()[:10], "m3Mask", m3Mask.Bitmap, "viewID", recvMsg.ViewID) return } @@ -473,7 +473,7 @@ func (consensus *Consensus) onNewView(msg *msg_pb.Message) { // change view and leaderKey to keep in sync with network if consensus.blockNum != recvMsg.BlockNum { - utils.GetLogger().Debug("new leader changed", "newLeaderKey", consensus.LeaderPubKey.GetHexString()[:20], "viewID", consensus.viewID, "myBlock", consensus.blockNum, "newViewBlockNum", recvMsg.BlockNum) + utils.GetLogger().Debug("new leader changed", "newLeaderKey", consensus.LeaderPubKey.SerializeToHexStr()[:20], "viewID", consensus.viewID, "myBlock", consensus.blockNum, "newViewBlockNum", recvMsg.BlockNum) return } @@ -491,7 +491,7 @@ func (consensus *Consensus) onNewView(msg *msg_pb.Message) { consensus.ResetState() utils.GetLogInstance().Info("onNewView === announce") } - utils.GetLogger().Debug("new leader changed", "newLeaderKey", consensus.LeaderPubKey.GetHexString()[:20], "viewID", consensus.viewID, "block", consensus.blockNum) + utils.GetLogger().Debug("new leader changed", "newLeaderKey", consensus.LeaderPubKey.SerializeToHexStr()[:20], "viewID", consensus.viewID, "block", consensus.blockNum) utils.GetLogger().Debug("validator start consensus timeout and stop view change timeout", "viewID", consensus.viewID, "block", consensus.blockNum) consensus.consensusTimeout[timeoutConsensus].Start() consensus.consensusTimeout[timeoutViewChange].Stop() diff --git a/core/resharding.go b/core/resharding.go index 17ba36dda..587c6901b 100644 --- a/core/resharding.go +++ b/core/resharding.go @@ -27,7 +27,7 @@ const ( // GenesisShardSize is the size of each shard at genesis GenesisShardSize = 100 // GenesisShardHarmonyNodes is the number of harmony node at each shard - GenesisShardHarmonyNodes = 78 + GenesisShardHarmonyNodes = 76 // CuckooRate is the percentage of nodes getting reshuffled in the second step of cuckoo resharding. CuckooRate = 0.1 ) @@ -227,7 +227,7 @@ func GetInitShardState() types.ShardState { for j := 0; j < GenesisShardHarmonyNodes; j++ { index := i + j*GenesisShardNum // The initial account to use for genesis nodes priKey := bls.SecretKey{} - priKey.SetHexString(genesis.GenesisAccounts[index].BlsPriKey) + priKey.DeserializeHexStr(genesis.GenesisAccounts[index].BlsPriKey) pubKey := types.BlsPublicKey{} pubKey.FromLibBLSPublicKey(priKey.GetPublicKey()) // TODO: directly read address for bls too @@ -239,7 +239,7 @@ func GetInitShardState() types.ShardState { for j := GenesisShardHarmonyNodes; j < GenesisShardSize; j++ { index := i + (j-GenesisShardHarmonyNodes)*GenesisShardNum priKey := bls.SecretKey{} - priKey.SetHexString(genesis.GenesisFNAccounts[index].BlsPriKey) + priKey.DeserializeHexStr(genesis.GenesisFNAccounts[index].BlsPriKey) pubKey := types.BlsPublicKey{} pubKey.FromLibBLSPublicKey(priKey.GetPublicKey()) // TODO: directly read address for bls too diff --git a/crypto/bls/bls_test.go b/crypto/bls/bls_test.go index cc86b423c..d1ec2ecd2 100644 --- a/crypto/bls/bls_test.go +++ b/crypto/bls/bls_test.go @@ -135,9 +135,9 @@ func TestAggregatedSignature(test *testing.T) { multiSignature := AggregateSig(signs) - str := multiSignature.GetHexString() + str := multiSignature.SerializeToHexStr() - if strings.Compare(multiSignature.GetHexString(), "0") == 0 { + if strings.Compare(multiSignature.SerializeToHexStr(), "0") == 0 { test.Error("Error creating multisignature", str) } } diff --git a/drand/drand_test.go b/drand/drand_test.go index 335550a65..92731be2d 100644 --- a/drand/drand_test.go +++ b/drand/drand_test.go @@ -157,7 +157,7 @@ func TestUpdatePublicKeys(test *testing.T) { } for index, publicKey := range dRand.PublicKeys { - if strings.Compare(publicKey.GetHexString(), publicKeys[index].GetHexString()) != 0 { + if strings.Compare(publicKey.SerializeToHexStr(), publicKeys[index].SerializeToHexStr()) != 0 { test.Error("Public keys not updated succssfully") } } diff --git a/internal/blsgen/lib.go b/internal/blsgen/lib.go index 86e7f831e..6d6140f2b 100644 --- a/internal/blsgen/lib.go +++ b/internal/blsgen/lib.go @@ -38,7 +38,7 @@ func GenBlsKeyWithPassPhrase(passphrase string) (*ffi_bls.SecretKey, string) { privateKey := bls.RandPrivateKey() publickKey := privateKey.GetPublicKey() fileName := keyFileName(publickKey) - privateKeyHex := privateKey.GetHexString() + privateKeyHex := privateKey.SerializeToHexStr() // Encrypt with passphrase encryptedPrivateKeyBytes := encrypt([]byte(privateKeyHex), passphrase) // Write to file. @@ -54,7 +54,7 @@ func LoadBlsKeyWithPassPhrase(fileName, passphrase string) *ffi_bls.SecretKey { decryptedBytes := decrypt(encryptedPrivateKeyBytes, passphrase) priKey := &ffi_bls.SecretKey{} - priKey.SetHexString(string(decryptedBytes)) + priKey.DeserializeHexStr(string(decryptedBytes)) return priKey } diff --git a/internal/genesis/foundational.go b/internal/genesis/foundational.go index a800ff05a..20307cb66 100644 --- a/internal/genesis/foundational.go +++ b/internal/genesis/foundational.go @@ -111,4 +111,13 @@ var GenesisFNAccounts = [...]DeployAccount{ {Address: "0xf10f63f5Bd46c58d2e9530E7F8cb6b4336D05d4E", BlsPriKey: "46bb0a5c47db2c94a456fd07690543db3f50710513814655d5eef13443a3b122"}, {Address: "0xfB81EFd254Fe117047872146806153539F89669E", BlsPriKey: "107062c37224ef8123653a1f3c92e3ceb76e9f6c346808c71bdb165848c47f28"}, {Address: "0xfdc963E875Ea99E434e4B815b7d8Bf506dAA9222", BlsPriKey: "4a75d92d2b0ec874bd3c8fdf8fd46ecc0ab18aa31581c013acc6a25b610f2c68"}, + {Address: "0x35D29200aFC9A4cDC05166096059a042078CB53e", BlsPriKey: "af96cd1118284a8a5916359b7fa566346f2017eadc0d3efcaf67cffe374bf724"}, + + // 90 - 99 + {Address: "0xe4a69826534aD3f6ec6E432474B0380E7F9a9C3d", BlsPriKey: "77da1ed33a8b00b2a227902f53045ed15aa2af735cb17ddbe5d42bcb29cda363"}, + {Address: "0x74e0014c9899c82f05F6AC110583F9f7dCC36508", BlsPriKey: "49decb0f0d35ab8882b253a130f987a6d8dc8ee63b1df340c5ac953d68362790"}, + {Address: "0x5a22c7ec1579C0d87760F4C8ec32fBE24d40E1Dc", BlsPriKey: "4fc4c886c8c5ae820848c6be9c9eafe1012f69cefc17aa790f4ce9daaf0cfae0"}, + {Address: "0xcb0A6c1914d2AD10855cC8cD70B040b7Dc6573a8", BlsPriKey: "51b5dce64da6a543fd171f2a1309347792767e1258c4cb4a9594311a162b9fb6"}, + {Address: "0xfF86Ff1FF457c3eBc18D71ffA30cfedd0860559c", BlsPriKey: "4b0d338b30a055bee3e2f070adc93d341b9316a315b4b4efe1639f0be2c1c10b"}, + {Address: "0xff1bE0eAC9B6053CD656947F0CcE7d277FF720Ec", BlsPriKey: "d94e179e77a8bf71206b2232eb826a9b5f8a64c55d919411263511e3a2ce7407"}, } diff --git a/internal/genesis/genesis.go b/internal/genesis/genesis.go index 119e6488e..907598d6c 100644 --- a/internal/genesis/genesis.go +++ b/internal/genesis/genesis.go @@ -481,7 +481,7 @@ var GenesisAccounts = [...]DeployAccount{ {Address: "0xbA30b84b8d0F106d936Af77D93C6653116EF54b9", BlsPriKey: "24f125b743f65fee238f66874c59e1bbe55bee5cedd8608547028a3241ec3f56"}, {Address: "0xbB61Aa32EAab4f5C0b1D66B3649aD97D9836576C", BlsPriKey: "cc15df81b05c0f5d06b291eb8ca99bf0b579a0c0917805f4a6ad2c3a69574463"}, - // 340 - 349 + // 350 - 359 {Address: "0xba155CD47eF9cF07bf9140721af95ffB76D4EE8B", BlsPriKey: "81f0d207c76b2b3a1e2966959bab28ef967003920da3ccb91bad2d0057e2c118"}, {Address: "0xba98270b18E72A885370567138951af6CFc06d5c", BlsPriKey: "710bb91c90c9a53dc6d2aa457e99a09751721d4d511316dabb5232751767883d"}, {Address: "0xbd1Afa5FB3B24c50A50f7a99A252517e1EDb6E14", BlsPriKey: "7e5c4196b26f497b1a91fda76eb24e4d7d2bf16742182201f2cb762de79f0a34"}, @@ -493,7 +493,7 @@ var GenesisAccounts = [...]DeployAccount{ {Address: "0xc2b1dA16bbe3F9106e5bf535Fc7458419c98D102", BlsPriKey: "40453675a9ef8b39893be1053b2e6a019bb57259f5af6300a20944cc14007806"}, {Address: "0xc7B8417d78cA2d0833b0016e8E12f8E5679a44Eb", BlsPriKey: "c7e577f1b5fd322450d04176a4d8faf183c6ab16c6736eb31716044ce07f5434"}, - // 350 - 359 + // 360 - 369 {Address: "0xc7be7908Be33a58c08FBc5FD3f06b1d4B7781641", BlsPriKey: "0c41279009ff436c25660669b0d4a341c39f81c281b73e7fee6278e6b9f4931f"}, {Address: "0xc82204e189EDF63807270d91c6bAf1d54ABB62B8", BlsPriKey: "621495b05112ddd89e6c7622f7126e1abee9cd6574d9f5ccd2615ad77e60fd32"}, {Address: "0xc84a3D4461f5a2f216D488Eb4F4852f523Aee385", BlsPriKey: "3a9dfede3c1257a04e0ad24d49f5c3bc369c200cc443bd4922448af21e176145"}, @@ -505,7 +505,7 @@ var GenesisAccounts = [...]DeployAccount{ {Address: "0xcE319c2f6c4745b0D41530b55b1Efb09392Fb357", BlsPriKey: "cecd4d19f71fced3e7f1c111865bd932c1f207676b5055445ec8003fe40b340d"}, {Address: "0xd16fb86Ad95B25baDb44092129cb6aA4FcD0190b", BlsPriKey: "f0a8a5aa85e83f0788ae32fb4a0a695bad7e624d4e958ef0dfd7aedd51e77961"}, - // 360 - 369 + // 370 - 379 {Address: "0xd20331D75CF373ee16547Bc00b3b71a283187A31", BlsPriKey: "977ea3be3b10801c2b89a3d7f45f950c3d0edb4d01bba2f777dfd485e898c047"}, {Address: "0xd24640d8fDE68cBFDF25C41613e4B593dF1F7845", BlsPriKey: "7eac3dae78aaea403c89e3c8b1630f597cae73488b9f3c32b260758733738b33"}, {Address: "0xd2ab9e42DbFd509dfd9Ab937Ac875c3953Ea6B63", BlsPriKey: "076726a23ccb51988c4654b72a63c86ee24cc123849752432cdfa80001834d34"}, @@ -517,7 +517,7 @@ var GenesisAccounts = [...]DeployAccount{ {Address: "0xddBb08c3385d8c9b7eD70507761bb6ae86601b36", BlsPriKey: "708edeec192b763d2be631ee4bbbf482deef0975d27136008cc6e518e657251a"}, {Address: "0xe089cbD31bab882923c5c8D3C5432eAfA680E4f6", BlsPriKey: "ee3680cfaed342a14198d65ace8e8d07eb8613c96c4421c92356d4b60b3d3711"}, - // 370 - 379 + // 380 - 389 {Address: "0xe201AE926cb423D61C67364FF3C736359b8f52C3", BlsPriKey: "b1d2dabac0c57ce92581239e0662f358f2a3217603c75a72785c51b6730e1e0c"}, {Address: "0xe21383C4dFeA14C3124e86C5F987045Ef2cF3F42", BlsPriKey: "00855f94388a2f59be2eeb8e8388b3288b3e301315ce124e787eb4a2a9206c53"}, {Address: "0xe36FCA53f5BC3FBa611E7CA51525755A6b3227E2", BlsPriKey: "f714c52565a3c9a499a1193272041963baed808e6c1a50f0040f58f7a902b635"}, @@ -529,7 +529,7 @@ var GenesisAccounts = [...]DeployAccount{ {Address: "0xe809bF710657bD64A238af34085156D571037BeF", BlsPriKey: "e075d8648c623297346e0e918f2bc33a73e079e27742d4cceea98e8bf15fdf4c"}, {Address: "0xe9bD1cA4896533cD6648ea43b1A7D68827aCc2b2", BlsPriKey: "223991e909cddb866090c92919368caa80227af6d21e90bac150622c9dd98c68"}, - // 380 - 389 + // 390 - 399 {Address: "0xeCF73C626B228664471d3884D54d2bd9541AD4bc", BlsPriKey: "04bbb9126561b95f7a84078724823c5c69314e77dc0294e3a8cfe3a94a9cb570"}, {Address: "0xeE584723c953C4DD049edd39738f5247740a9594", BlsPriKey: "53303280087708076f10729fc311f76e1ad59cd095f3121229fca6efc0958225"}, {Address: "0xf105C333253a16C1Ae24c23191E133E06C9ba501", BlsPriKey: "8e033b0eab9d37e62b54fa7336ae2311c64e9316b8c7c7f0231ef9d61ef3c042"}, @@ -541,7 +541,7 @@ var GenesisAccounts = [...]DeployAccount{ {Address: "0xf7D06869051f6470b3a40C6A733571d135641D3b", BlsPriKey: "1e17f7b960f6867b0f37cc5a18b30697cd6b69b99bfcb323043cbb3827fb174d"}, {Address: "0xfA41EDfFf9325c748140ed8Df677B4358568A529", BlsPriKey: "349dbdf228cbb0730c9754a0a188544a1799189050ccdc83c22ac0e0fa37153b"}, - // 390 - 399 + // 400 - 409 {Address: "0xfD87f1fb4720cD7f89914D42BB42cEA7c23fcccd", BlsPriKey: "f21843dfd11ef1f2b1fa5930b56024287944ff75c441deb26cc40deb09b5ec01"}, {Address: "0xfEa557d30651C3F0AeeCA12d33936eeFA0fc4f93", BlsPriKey: "0f946314c071958e26d626fcfcd0ce93fd156b42de77b9c62e4fd9fe69cdf539"}, {Address: "0xfF86Ff1FF457c3eBc18D71ffA30cfedd0860559c", BlsPriKey: "4b0d338b30a055bee3e2f070adc93d341b9316a315b4b4efe1639f0be2c1c10b"}, diff --git a/internal/genesis/newnodes.go b/internal/genesis/newnodes.go index 471e6c195..31008ae80 100644 --- a/internal/genesis/newnodes.go +++ b/internal/genesis/newnodes.go @@ -1,7 +1,6 @@ package genesis // NewNodeAccounts are the accounts for the new node - var NewNodeAccounts = [...]DeployAccount{ {Address: "0x0e59b767D5E74cf7B29Ef9bEc3dA4c402d357C6C", BlsPriKey: "bb0f9464c1ef92db53cf22953b4eeff4b78dd5af47c65a991ee6cf081b8d9569"}, {Address: "0x0fAAda81c203C74CAc786786f7D428477a04bF9c", BlsPriKey: "eaff001d11db657636b1b62895cfa0f35ac767579d08e5959826a56cf7c43667"}, @@ -12,4 +11,5 @@ var NewNodeAccounts = [...]DeployAccount{ {Address: "0x141B0e0f05739B7B784654E973e9b9146473aAb9", BlsPriKey: "06c2aac72636fb74df815688696fe12c4894a50c016e6016a6e51f9452c77b36"}, {Address: "0x1492ebD0EcfD54B4c211b37C8891bA3493c52100", BlsPriKey: "04e762a7c540d2f2f566c0f1729475753914b42e6293a8e6653f29fc6ffba273"}, {Address: "0x1530A04592F9C3bF06aC6044525f08937ED38edB", BlsPriKey: "68bd252b49616db29a5b923c5508374b3ee8184b2d3899a1d71d5ea0f3e68348"}, - {Address: "0xE2ab78ecf325084485957B2599d53Bcf944Cbca8", BlsPriKey: "d09a1c5efd391ef432d5be413d062374643f7f6f68fa59e58409d88d985c6d38"}} + {Address: "0xE2ab78ecf325084485957B2599d53Bcf944Cbca8", BlsPriKey: "d09a1c5efd391ef432d5be413d062374643f7f6f68fa59e58409d88d985c6d38"}, +} diff --git a/internal/utils/flags.go b/internal/utils/flags.go index 491cd5900..0f8d4ec9d 100644 --- a/internal/utils/flags.go +++ b/internal/utils/flags.go @@ -66,8 +66,7 @@ func StringsToPeers(input string) []p2p.Peer { // DefaultBootNodeAddrStrings is a list of Harmony bootnodes address. Used to find other peers in the network. var DefaultBootNodeAddrStrings = []string{ - // FIXME: (leo) this is a bootnode I used for local test, change it to long running ones later - "/ip4/127.0.0.1/tcp/9876/p2p/QmayB8NwxmfGE4Usb4H61M8uwbfc7LRbmXb3ChseJgbVuf", + "/ip4/127.0.0.1/tcp/19876/p2p/Qmc1V6W7BwX8Ugb42Ti8RnXF1rY5PF7nnZ6bKBryCgi6cv", } // BootNodes is a list of boot nodes. It is populated either from default or from user CLI input. diff --git a/scripts/wallet.sh b/scripts/wallet.sh index a9b01d263..f68d48fc4 100755 --- a/scripts/wallet.sh +++ b/scripts/wallet.sh @@ -40,6 +40,7 @@ Actions: --amount - The amount of token to transfer --shardID - The shard Id for the transfer --inputData - Base64-encoded input data to embed in the transaction + 8. blsgen - Generates bls keys with passphrase and store the private key locally EOT exit 0 }