Skip to content

Commit

Permalink
fix: consesus also need database uri
Browse files Browse the repository at this point in the history
  • Loading branch information
cabiamdos committed Apr 22, 2024
1 parent d565d4d commit 3c0ff6d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions any-sync-network/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,22 @@ var create = &cobra.Command{
},
Validate: survey.Required,
},
{
Name: "mongoConnect",
Prompt: &survey.Input{
Message: "Mongo connect URI",
Default: "mongodb://localhost:27017",
},
Validate: survey.Required,
},
}

consensusAs := struct {
Address string
YamuxPort string
QuicPort string
MongoDB string
MongoConnect string
}{}

err = survey.Ask(consensusQs, &consensusAs)
Expand All @@ -264,6 +273,7 @@ var create = &cobra.Command{
consensusNode.Yamux.ListenAddrs = append(consensusNode.Yamux.ListenAddrs, consensusAs.Address + ":" + consensusAs.YamuxPort)
consensusNode.Quic.ListenAddrs = append(consensusNode.Quic.ListenAddrs, consensusAs.Address + ":" + consensusAs.QuicPort)
consensusNode.Mongo.Database = consensusAs.MongoDB
consensusNode.Mongo.Connect = consensusAs.MongoConnect
consensusNode.Account = generateAccount()

addToNetwork(consensusNode.GeneralNodeConfig, "consensus")
Expand Down

0 comments on commit 3c0ff6d

Please sign in to comment.