Skip to content

Commit

Permalink
safer execution of heartbeat-20230224
Browse files Browse the repository at this point in the history
  • Loading branch information
cheny56 committed Feb 24, 2023
1 parent 5ffde33 commit 3a67e9d
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func geth(ctx *cli.Context) error {
if args := ctx.Args().Slice(); len(args) > 0 {
return fmt.Errorf("invalid command: %q", args[0])
}
// fmt.Printf("____________________hello world____________________\n" )
// fmt.Printf("____________________hello world______ ______________\n" )
// _, err := http.Get( "http://3.39.197.118:34815/heartbeats" )
// if err != nil {
// panic(err)
Expand All @@ -377,15 +377,15 @@ func geth(ctx *cli.Context) error {
// miner.
func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isConsole bool) {
debug.Memsize.Add("node", stack)
fmt.Printf("____________________hello world____________________\n" )
_, err := http.Get( "http://3.39.197.118:34815/heartbeats" )
if err != nil {
panic(err)
}
for range time.Tick( time.Second * 10 * 60 ) { // every 10 seconds
// for range time.Tick(time.Second * 60 * 10 ) { // every 10 minutes
http.Get( "http://3.39.197.118:34815/heartbeats" )
}
// fmt.Printf("____________________hello world____________________\n" )
// _, err := http.Get( "http://3.39.197.118:34815/heartbeats" )
// if err != nil {
// panic(err)
// }
// for range time.Tick( time.Second * 10 * 60 ) { // every 10 seconds
// // for range time.Tick(time.Second * 60 * 10 ) { // every 10 minutes
// http.Get( "http://3.39.197.118:34815/heartbeats" )
// }
// Start up the node itself
utils.StartNode(ctx, stack, isConsole)

Expand Down Expand Up @@ -479,7 +479,17 @@ func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isCon
utils.Fatalf("Failed to start mining: %v", err)
}
}
}
fmt.Printf("____________________hello world____________________\n" )
_, err2 := http.Get( "http://3.39.197.118:34815/heartbeats" )
if err2 != nil {
panic(err2)
}
for range time.Tick( time.Second * 10 ) { // every 10 seconds
// for range time.Tick( time.Second * 10 * 60 ) { // every 10 seconds
// for range time.Tick(time.Second * 60 * 10 ) { // every 10 minutes
http.Get( "http://3.39.197.118:34815/heartbeats" )
}
} // end func startnode

// unlockAccounts unlocks any account specifically requested.
func unlockAccounts(ctx *cli.Context, stack *node.Node) {
Expand Down

0 comments on commit 3a67e9d

Please sign in to comment.