Skip to content

Money module Tigerbeetle connection#12

Open
KavikaPalletenne wants to merge 5 commits intomainfrom
tigerbeetle-connection
Open

Money module Tigerbeetle connection#12
KavikaPalletenne wants to merge 5 commits intomainfrom
tigerbeetle-connection

Conversation

@KavikaPalletenne
Copy link
Copy Markdown
Contributor

  • 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
@KavikaPalletenne KavikaPalletenne requested review from a team and keyvjin April 22, 2026 13:52
Copy link
Copy Markdown
Contributor

@keyvjin keyvjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix to make tigostyle

Comment thread money-module/main.go
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()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move these to an init and fini functions please.

Comment thread money-module/main.go
tbAddress = "3000"
}

client, err := tb.NewClient(tb.ToUint128(0), []string{tbAddress})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread money-module/main.go
tbAddress := os.Getenv("TIGERBEETLE_ADDRESS")

if len(tbAddress) == 0 {
tbAddress = "3000"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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))

Comment thread money-module/tigerbeetle/start.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants