algorand / go-algorand-sdk

Algorand Golang SDK
https://pkg.go.dev/github.com/algorand/go-algorand-sdk/v2
MIT License
185 stars 95 forks source link

(using sandbox) Failed to list wallets #654

Open adagio opened 1 month ago

adagio commented 1 month ago

I am using sandbox https://github.com/algorand/sandbox

./sandbox up dev

Error raises when executing this code

https://github.com/algorand/go-algorand-sdk/blob/6274cc85c1ae2ea062be05c58e66bad1a7fa6a0b/examples/account/main.go#L41-L44

Got this error:

failed to get sandbox accounts: Failed to list wallets: Get "http://localhost:4002/v1/wallets": dial tcp [::1]:4002: connect: connection refused exit status 1

Similiar error occurs when executing this code

https://github.com/algorand/go-algorand-sdk/blob/6274cc85c1ae2ea062be05c58e66bad1a7fa6a0b/examples/overview/main.go#L45-L48

Got this error:

failed to get accounts: Failed to list wallets: Get "http://localhost:4002/v1/wallets": dial tcp [::1]:4002: connect: connection refused exit status 1

jasonpaulos commented 1 month ago

Hello, this appears to be an issue connecting to the KMD server running in the sandbox environment.

Are you certain your sandbox environment has finished setting up before you run the go code? If so, can you run ./sandbox test and share the output?