diff --git a/engine/NetStart.go b/engine/NetStart.go index dd9297690f..63f9ac5be2 100644 --- a/engine/NetStart.go +++ b/engine/NetStart.go @@ -42,7 +42,7 @@ var p2pProxy *P2PProxy var p2pNetwork *p2p.Controller var logPort string -func NetStart(s *state.State) { +func NetStart(s *state.State, args []string) { ackBalanceHashPtr := flag.Bool("balancehash", true, "If false, then don't pass around balance hashes") enablenetPtr := flag.Bool("enablenet", true, "Enable or disable networking") waitEntriesPtr := flag.Bool("waitentries", false, "Wait for Entries to be validated prior to execution of messages") @@ -81,7 +81,7 @@ func NetStart(s *state.State) { factomdLocationsflag := flag.String("selfaddr", "", "comma seperated IPAddresses and DNS names of this factomd to use when creating a cert file") memProfileRate := flag.Int("mpr", 512*1024, "Set the Memory Profile Rate to update profiling per X bytes allocated. Default 512K, set to 1 to profile everything, 0 to disable.") - flag.Parse() + flag.CommandLine.Parse(args) ackbalanceHash := *ackBalanceHashPtr enableNet := *enablenetPtr diff --git a/engine/factomd.go b/engine/factomd.go index 4eac047d3d..4eafe5ff8c 100644 --- a/engine/factomd.go +++ b/engine/factomd.go @@ -28,7 +28,7 @@ var _ = fmt.Print // Since we are tracking code changes, then there is no need to delete the binary to use the latest message var Build string -func Factomd() { +func Factomd(args []string) { log.Print("//////////////////////// Copyright 2017 Factom Foundation") log.Print("//////////////////////// Use of this source code is governed by the MIT") log.Print("//////////////////////// license that can be found in the LICENSE file.") @@ -50,7 +50,7 @@ func Factomd() { state0.SetLeaderTimestamp(primitives.NewTimestampFromMilliseconds(0)) fmt.Println("len(Args)", len(os.Args)) - NetStart(state0) + NetStart(state0,args) } func isCompilerVersionOK() bool { diff --git a/factomd.go b/factomd.go index 33db604927..d075159325 100644 --- a/factomd.go +++ b/factomd.go @@ -6,9 +6,10 @@ package main import ( "github.com/FactomProject/factomd/engine" + "os" ) func main() { // uncomment StartProfiler() to run the pprof tool (for testing) - engine.Factomd() + engine.Factomd(os.Args[1:]) } diff --git a/scripts/entryloadm2.sh b/scripts/entryloadm2.sh index 8381103a77..4910a504f2 100755 --- a/scripts/entryloadm2.sh +++ b/scripts/entryloadm2.sh @@ -33,7 +33,7 @@ addentries() { echo "Entry Length " $datalen " bytes, file name: " $datafile for ((i=0; i