Money module Tigerbeetle connection#12
Open
KavikaPalletenne wants to merge 5 commits intomainfrom
Open
Conversation
Contributor
KavikaPalletenne
commented
Apr 22, 2026
- Use official Tigerbeetle Docker image in dev docker-compose file
- Hardcode Tigerbeetle container IP address as Go client requires numerical address (can't use Docker service discovery). Also hardcoded Docker warchest network subnet for this
- Setup Go Tigerbeetle client connection code
- hardcode tigerbeetle container ip address - Use official tigerbeetle docker image
keyvjin
reviewed
Apr 24, 2026
Comment on lines
1
to
25
| package main | ||
|
|
||
| import "fmt" | ||
| import ( | ||
| "log" | ||
| "os" | ||
|
|
||
| tb "github.com/tigerbeetle/tigerbeetle-go" | ||
| ) | ||
|
|
||
| func main() { | ||
| fmt.Println("Hello, World!") | ||
| tbAddress := os.Getenv("TIGERBEETLE_ADDRESS") | ||
|
|
||
| if len(tbAddress) == 0 { | ||
| tbAddress = "3000" | ||
| } | ||
|
|
||
| client, err := tb.NewClient(tb.ToUint128(0), []string{tbAddress}) | ||
|
|
||
| if err != nil { | ||
| log.Printf("Error creating client: %s", err) | ||
| return | ||
| } | ||
|
|
||
| defer client.Close() | ||
| } |
Contributor
There was a problem hiding this comment.
Can we move these to an init and fini functions please.
| tbAddress = "3000" | ||
| } | ||
|
|
||
| client, err := tb.NewClient(tb.ToUint128(0), []string{tbAddress}) |
Contributor
There was a problem hiding this comment.
Nit: Is there a way to use var client tb.Client, var err error. (Maybe just declare on line above?) (TiGoStyle shit). I think this is fine in this case because this statement cannot be misinfered and will be hidden in the init anyways
| tbAddress := os.Getenv("TIGERBEETLE_ADDRESS") | ||
|
|
||
| if len(tbAddress) == 0 { | ||
| tbAddress = "3000" |
Contributor
There was a problem hiding this comment.
(TiGoStyle) I think this is something we should fully check our preconditions for. (i.e I think money-module should instantly fail if the address isn't numeric, and nor a valid port number etc (TiGoStyle))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.