formancehq / ledger

A Programmable Core Ledger
MIT License
882 stars 101 forks source link

Ledger Golang SDK installation guide doesn't work #523

Closed al-kimmel-serj closed 3 weeks ago

al-kimmel-serj commented 3 weeks ago

Hi.

I try to install Ledger Golang SDK as described here, but I see:

$ go get github.com/formancehq/stack/ledger/client
go: module github.com/formancehq/stack@upgrade found (v1.10.14), but does not contain package github.com/formancehq/stack/ledger/client

My environment:

$ go version
go version go1.23.1 darwin/arm64

I use ledger running in my k8s cluster, not in Formance Platform.

Could you help to fix it?

flemzord commented 3 weeks ago

Hello Please use: https://github.com/formancehq/formance-sdk-go

al-kimmel-serj commented 3 weeks ago

I can't use https://github.com/formancehq/formance-sdk-go, because I use only Ledger and I don't use Formance Gateway. Formance SDK has hardcoded prefix /api/ledger/v2 for Ledger API operations and I can't override it.

gfyrag commented 3 weeks ago

Hi @al-kimmel-serj ! There is an error in the module path. I will fix it. But, keep in mind this sdk can change, it is used internally for integration tests and some methods/parameters can be changed without any warning.

al-kimmel-serj commented 3 weeks ago

Ok. I will keep it in mind. Thank you, @gfyrag.)

gfyrag commented 3 weeks ago

@al-kimmel-serj The fix is merged on main. You can go get it again.

al-kimmel-serj commented 3 weeks ago

@gfyrag I see error when I run:

$ go get github.com/formancehq/ledger/pkg/client
go: github.com/formancehq/ledger/pkg/client@upgrade (v0.0.0-20241024085040-32d22503503f) requires github.com/formancehq/ledger/pkg/client@v0.0.0-20241024085040-32d22503503f: parsing go.mod:
    module declares its path as: github.com/formancehq/stack/ledger/client
            but was required as: github.com/formancehq/ledger/pkg/client
al-kimmel-serj commented 3 weeks ago

Sorry. Now it works. Maybe problem was on my MacBook. Thank you.