Skip to content

Commit

Permalink
feat: setup basic faucet trigger channel
Browse files Browse the repository at this point in the history
  • Loading branch information
amimart committed Aug 10, 2022
1 parent 77955fe commit 6ef0d4f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"okp4/cosmos-faucet/internal/server"
"okp4/cosmos-faucet/pkg/client"
"time"

"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
Expand All @@ -28,7 +29,14 @@ func NewStartCommand() *cobra.Command {
Use: "start",
Short: "Start the GraphQL api",
Run: func(cmd *cobra.Command, args []string) {
faucet, err := client.NewFaucet(config, nil)
triggerTxChan := make(chan bool)
go func() {
for range time.Tick(5 * time.Second) {
triggerTxChan <- true
}
}()

faucet, err := client.NewFaucet(config, triggerTxChan)
if err != nil {
log.Fatal().Err(err).Msg("Failed create a new faucet instance")
}
Expand Down

0 comments on commit 6ef0d4f

Please sign in to comment.