erigon-pulse/cmd/devnettest/commands/event.go
leonardchinonso 878cc063b0
Draft PR to complete devnet automation (#4278)
* Fixing headers stuck in StageSync

* Removed ./dev folder and cleaned up code

* Removing the logs subscription tests
2022-06-01 22:47:12 +01:00

41 lines
702 B
Go

package commands
import (
"fmt"
"github.com/ledgerwatch/erigon/cmd/devnettest/services"
"github.com/spf13/cobra"
"sync"
)
var (
//eventAddrs = []string{devAddress, recvAddr}
eventTopics []string
)
func init() {
rootCmd.AddCommand(LogsCmd)
}
var LogsCmd = &cobra.Command{
Use: "logs",
Short: "Subscribes to log event sends a notification each time a new log appears",
Run: func(cmd *cobra.Command, args []string) {
callLogs()
},
}
var wg sync.WaitGroup
func callLogs() {
wg.Add(1)
go func() {
if err := services.Logs([]string{}, eventTopics); err != nil {
fmt.Printf("could not subscribe to log events: %v\n", err)
}
defer wg.Done()
}()
wg.Wait()
callContractTx()
}