remove beacon main and others

pull/502/head
Minh Doan 6 years ago committed by Minh Doan
parent 3b1622ba21
commit 42bdc72a08
  1. 4
      README.md
  2. 59
      cmd/beaconchain/main.go
  3. 5
      scripts/go_executable_build.sh
  4. 1
      test/deploy.sh
  5. 34
      test/leader_run.sh

@ -50,10 +50,6 @@ Harmony server / main node:
go build -o bin/harmony cmd/harmony.go
```
Beacon node:
```
go build -o bin/beacon cmd/beaconchain/main.go
```
Wallet:
```

@ -1,59 +0,0 @@
package main
import (
"flag"
"fmt"
"os"
"path"
"github.com/ethereum/go-ethereum/log"
beaconchain "github.com/harmony-one/harmony/internal/beaconchain/libs"
"github.com/harmony-one/harmony/internal/utils"
)
var (
version string
builtBy string
builtAt string
commit string
)
func printVersion(me string) {
fmt.Fprintf(os.Stderr, "Harmony (C) 2018. %v, version %v-%v (%v %v)\n", path.Base(me), version, commit, builtBy, builtAt)
os.Exit(0)
}
func main() {
numShards := flag.Int("numShards", 1, "number of shards of identity chain")
ip := flag.String("ip", "127.0.0.1", "ip on which beaconchain listens")
port := flag.String("port", "8081", "port on which beaconchain listens")
versionFlag := flag.Bool("version", false, "Output version info")
resetFlag := flag.String("path", "bc_config.json", "path to file")
flag.Parse()
if *versionFlag {
printVersion(os.Args[0])
}
h := log.StreamHandler(os.Stdout, log.TerminalFormat(false))
log.Root().SetHandler(h)
var bc *beaconchain.BeaconChain
if _, err := os.Stat(*resetFlag); err == nil {
bc, err = beaconchain.LoadBeaconChainInfo(*resetFlag)
if err != nil {
fmt.Fprintf(os.Stderr, "Could not reset beaconchain from file: %+v\n", err)
}
} else {
fmt.Printf("Starting new beaconchain\n")
beaconchain.SetSaveFile(*resetFlag)
priKey, _, _ := utils.GenKeyP2P(*ip, *port)
bc = beaconchain.New(*numShards, *ip, *port, priKey)
}
fmt.Printf("Beacon Chain Started: /ip4/%s/tcp/%v/ipfs/%s\n", *ip, *port, bc.GetID().Pretty())
go bc.SupportRPC()
bc.StartServer()
}

@ -5,7 +5,6 @@ export GO111MODULE=on
declare -A SRC
SRC[harmony]=cmd/harmony.go
SRC[txgen]=cmd/client/txgen/main.go
SRC[beacon]=cmd/beaconchain/main.go
SRC[wallet]=cmd/client/wallet/main.go
SRC[bootnode]=cmd/bootnode/main.go
@ -59,7 +58,7 @@ ACTION:
upload upload binaries to s3
pubwallet upload wallet to public bucket (bucket: $PUBBUCKET)
harmony|txgen|bootnode|wallet|beacon
harmony|txgen|bootnode|wallet
only build the specified binary
EXAMPLES:
@ -186,6 +185,6 @@ case "$ACTION" in
"build") build_only ;;
"upload") upload ;;
"pubwallet") upload_wallet ;;
"harmony"|"wallet"|"txgen"|"bootnode"|"beacon") build_only $ACTION ;;
"harmony"|"wallet"|"txgen"|"bootnode") build_only $ACTION ;;
*) usage ;;
esac

@ -118,7 +118,6 @@ pushd $ROOT
echo "compiling ..."
go build -o bin/harmony cmd/harmony.go
go build -o bin/txgen cmd/client/txgen/main.go
go build -o bin/beacon cmd/beaconchain/main.go
go build -o bin/bootnode cmd/bootnode/main.go
popd

@ -1,34 +0,0 @@
#!/bin/bash
ROOT=$(dirname $0)/..
USER=$(whoami)
DRYRUN=
set -x
set -eo pipefail
echo "compiling ..."
go build -o bin/harmony cmd/harmony.go
go build -o bin/beacon cmd/beaconchain/main.go
# Create a tmp folder for logs
t=`date +"%Y%m%d-%H%M%S"`
log_folder="tmp_log/log-$t"
mkdir -p $log_folder
LOG_FILE=$log_folder/r.log
rm -f bc_config.json
echo "launching beacon chain ..."
$DRYRUN $ROOT/bin/beacon -numShards 3 > $log_folder/beacon.log 2>&1 | tee -a $LOG_FILE &
sleep 2 #waiting for beaconchain
MA=$(grep "Beacon Chain Started" $log_folder/beacon.log | awk -F: ' { print $2 } ')
if [ -n "$MA" ]; then
HMY_OPT="-bc_addr $MA"
fi
DB='-db_supported'
$ROOT/bin/harmony -ip 127.0.0.1 -port 9000 -log_folder $log_folder $DB -min_peers 0 $HMY_OPT 2>&1 | tee -a $LOG_FILE &
Loading…
Cancel
Save