Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WatchCmd = &cobra.Command{ Use: "watch", Short: "Watch for Whales on the BitcoinCash network", Long: `This command will watch for large amounts of BCH being transferred on-chain. It will then tweet about these transactions.`, RunE: func(cmd *cobra.Command, args []string) error { logger, err := getLogger() if err != nil { return err } ctx, cancel := context.WithCancel(context.Background()) defer cancel() go listenExitCommand(logger, cancel) monitor := createMonitoringClient(ctx, logger) // start all main workers in separate goroutines var wg sync.WaitGroup if monitor != nil { wg.Add(1) go func() { defer wg.Done() monitor.ListenHttp(ctx) }() } counter, err := txcounter.NewTxCounter(&txcounter.TxCounterConfig{ AverageTime: time.Duration(viper.GetInt("Average.TransactionAverageTimeH")) * time.Hour, }, ctx, logger, monitor) if err != nil { logger.Fatalf("Error creating TX counter: %+v", err) } go counter.ScheduleCleanupTransactions() wg.Add(1) go func() { defer wg.Done() watchTransactionsRest(counter, ctx, logger, monitor) }() wg.Wait() err = counter.WriteTransactionsFile() if err != nil { logger.Errorf("Error writing transaction data to disk on shutdown %+v", err) } return nil }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.