Fix mainnet release todos

pull/1637/head
Rongjian Lan 5 years ago
parent 6ece8d958c
commit 6a3c0b256d
  1. 3
      api/service/networkinfo/service.go
  2. 6
      internal/configs/node/config.go
  3. 2
      internal/utils/configfile.go
  4. 4
      node/node_syncing.go
  5. 6
      scripts/node.sh

@ -11,7 +11,6 @@ import (
"github.com/ethereum/go-ethereum/rpc"
msg_pb "github.com/harmony-one/harmony/api/proto/message"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p"
badger "github.com/ipfs/go-ds-badger"
@ -61,7 +60,7 @@ const (
func New(h p2p.Host, rendezvous p2p.GroupID, peerChan chan p2p.Peer, bootnodes utils.AddrList) *Service {
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(context.Background(), connectionTimeout)
dataStore, err := badger.NewDatastore(fmt.Sprintf("%s/.dht-%s-%s", nodeconfig.GetTempDir(), h.GetSelfPeer().IP, h.GetSelfPeer().Port), nil)
dataStore, err := badger.NewDatastore(fmt.Sprintf(".dht-%s-%s", h.GetSelfPeer().IP, h.GetSelfPeer().Port), nil)
if err != nil {
panic(err)
}

@ -7,7 +7,6 @@ import (
"crypto/ecdsa"
"errors"
"fmt"
"os"
"sync"
"github.com/harmony-one/bls/ffi/go/bls"
@ -249,11 +248,6 @@ func GetVersion() string {
return version
}
// GetTempDir return temporary directory
func GetTempDir() string {
return os.TempDir()
}
// SetPublicRPC set the boolean value of public RPC access
func SetPublicRPC(v bool) {
publicRPC = v

@ -6,7 +6,7 @@ import (
"os"
"strings"
"gopkg.in/ini.v1"
ini "gopkg.in/ini.v1"
"github.com/harmony-one/harmony/internal/params"
"github.com/harmony-one/harmony/p2p"

@ -365,8 +365,8 @@ func (node *Node) CalculateResponse(request *downloader_pb.DownloaderRequest, in
}
case downloader_pb.DownloaderRequest_BLOCKHEADER:
var hash common.Hash
for _, bytes := range request.Hashes {
var hash common.Hash
hash.SetBytes(bytes)
blockHeader := node.Blockchain().GetHeaderByHash(hash)
if blockHeader == nil {
@ -380,8 +380,8 @@ func (node *Node) CalculateResponse(request *downloader_pb.DownloaderRequest, in
}
case downloader_pb.DownloaderRequest_BLOCK:
var hash common.Hash
for _, bytes := range request.Hashes {
var hash common.Hash
hash.SetBytes(bytes)
block := node.Blockchain().GetBlockByHash(hash)
if block == nil {

@ -336,7 +336,7 @@ download_harmony_db_file() {
url="http://${BUCKET}.s3.amazonaws.com/${FOLDER}db/${file_to_dl}"
if _curl_download $url "${outdir}" ${file_to_dl}; then
verify_checksum "${outdir}" "${file_to_dl}" md5sum.txt || return $?
msg "downlaoded ${file_to_dl}, extracting ..."
msg "downloaded ${file_to_dl}, extracting ..."
tar -C "${outdir}" -xvf "${outdir}/${file_to_dl}"
else
msg "can't download ${file_to_dl}"
@ -347,7 +347,7 @@ download_harmony_db_file() {
files=$(awk '{ print $2 }' ${outdir}/md5sum.txt)
echo "[available harmony db files for shard ${shard_id}]"
grep -oE harmony_db_${shard_id}-.*.tar "${outdir}/md5sum.txt"
grep -oE "harmony_db_${shard_id}"-.*.tar "${outdir}/md5sum.txt"
echo
for file in $files; do
if [[ $file =~ "harmony_db_${shard_id}" ]]; then
@ -357,7 +357,7 @@ download_harmony_db_file() {
url="http://${BUCKET}.s3.amazonaws.com/${FOLDER}db/$file"
if _curl_download $url "${outdir}" $file; then
verify_checksum "${outdir}" "${file}" md5sum.txt || return $?
msg "downlaoded $file, extracting ..."
msg "downloaded $file, extracting ..."
tar -C "${outdir}" -xvf "${outdir}/${file}"
else
msg "can't download $file"

Loading…
Cancel
Save