renaming benchmark to harmony; more readme instructions

pull/240/head^2
Nicolas Burtey 6 years ago
parent 5e312d58f6
commit a345483137
  1. 4
      .travis.yml
  2. 25
      README.md
  3. 0
      cmd/harmony.go
  4. 3
      scripts/go_executable_build.sh
  5. 0
      scripts/gofmt.sh
  6. 12
      test/deploy.sh

@ -8,10 +8,10 @@ install:
- go get -t -v ./...
- go get -u golang.org/x/lint/golint
- go get gopkg.in/check.v1
- ./.travis.gofmt.sh
- ./script/gofmt.sh
- go build -v ./...
script:
- ./.travis.gofmt.sh
- ./script/gofmt.sh
notifications:
slack:
harmonyone:gggCd1QQopsQAW8JYgBWiH7M

@ -26,6 +26,31 @@ cd harmony
go get ./...
```
## Build
Harmony server / main node:
```
go build -o bin/harmony cmd/harmony.go
```
Beacon node:
```
go build -o bin/beacon cmd/beaconchain/main.go
```
Wallet:
```
go build -o bin/wallet cmd/client/wallet/main.go
```
Tx Generator:
```
go build -o bin/txgen cmd/client/txgen/main.go
```
You can also run the script `./script/go_executable_build.sh` to build all the executables.
The script use associated arrays that requiere bash v4 (MacOS has a bash v3 installed by default). You can follow instruction from https://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/
## Usage
### Running local test

@ -1,6 +1,6 @@
#!/usr/bin/env bash
declare -A SRC
SRC[benchmark]=benchmark.go
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
@ -64,6 +64,7 @@ function build_only
BUILTBY=${USER}@
for bin in "${!SRC[@]}"; do
echo "building ${SRC[$bin]}"
env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags="-X main.version=v${VERSION} -X main.commit=${COMMIT} -X main.builtAt=${BUILTAT} -X main.builtBy=${BUILTBY}" -o $BINDIR/$bin $RACE ${SRC[$bin]}
if [ "$(uname -s)" == "Linux" ]; then
$BINDIR/$bin -version

@ -5,7 +5,7 @@ ROOT=$(dirname $0)/..
set -eo pipefail
function cleanup() {
for pid in `/bin/ps -fu $USER| grep "benchmark\|txgen\|soldier\|commander\|profiler\|beacon" | grep -v "grep" | grep -v "vi" | awk '{print $2}'`;
for pid in `/bin/ps -fu $USER| grep "harmony\|txgen\|soldier\|commander\|profiler\|beacon" | grep -v "grep" | grep -v "vi" | awk '{print $2}'`;
do
echo 'Killed process: '$pid
kill -9 $pid 2> /dev/null
@ -16,7 +16,7 @@ function killnode() {
local port=$1
if [ -n "port" ]; then
pid=$(/bin/ps -fu $USER | grep "benchmark" | grep "$port" | awk '{print $2}')
pid=$(/bin/ps -fu $USER | grep "harmony" | grep "$port" | awk '{print $2}')
echo "killing node with port: $port"
kill -9 $pid 2> /dev/null
echo "node with port: $port is killed"
@ -39,7 +39,7 @@ USAGE: $ME [OPTIONS] config_file_name
-s shards number of shards (default: $SHARDS)
-k nodeport kill the node with specified port number (default: $KILLPORT)
This script will build all the binaries and start benchmark and txgen based on the configuration file.
This script will build all the binaries and start harmony and txgen based on the configuration file.
EXAMPLES:
@ -87,7 +87,7 @@ cleanup
# Also it's recommended to use `go build` for testing the whole exe.
pushd $ROOT
echo "compiling ..."
go build -o bin/benchmark
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
popd
@ -100,14 +100,14 @@ mkdir -p $log_folder
echo "launching beacon chain ..."
$ROOT/bin/beacon -numShards $SHARDS > $log_folder/beacon.log 2>&1 &
sleep 1 #wait or beachchain up
sleep 1 #waiting for beaconchain
# Start nodes
while IFS='' read -r line || [[ -n "$line" ]]; do
IFS=' ' read ip port mode shardID <<< $line
#echo $ip $port $mode
if [ "$mode" != "client" ]; then
$ROOT/bin/benchmark -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN &
$ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN &
sleep 0.5
fi
done < $config

Loading…
Cancel
Save