Problem with CreateTokenAccounts

Hi, I was following the market place workshop by @daniel and getting following error when running wallet.go

                },

~/.../tmp/marketplace-workshop (master)$go run wallet.go 
panic: client: rpc error: code = Unimplemented desc = unknown service flow.access.AccessAPI

goroutine 1 [running]:
main.CreateAccount(0x1809243, 0xe, 0x0, 0x0, 0xc000178840, 0x40, 0xc000123f20, 0xa, 0xc000123f18, 0x8, ...)
	/Users/makoto/work/tmp/marketplace-workshop/wallet.go:96 +0x857
main.CreateTokenAccounts()
	/Users/makoto/work/tmp/marketplace-workshop/wallet.go:137 +0x13c
main.main()
	/Users/makoto/work/tmp/marketplace-workshop/wallet.go:270 +0x20
exit status 2

Has anyone encountered the same issue?

1 Like

To follow up, I pull the latest commit where he updated service address and also I created keys and added them into account.json

Looks like the problem is happening at the below line when the service Address f8d6e0586b0a20c7 is passed.

erviceAccount, err := c.GetAccountAtLatestBlock(ctx, serviceAddress)

I also called c.GetLatestBlockHeader(ctx, true) but getting the same error. I wonder if something wrong with the version number.

My node and flow versions are as follows.

$flow version
Version: v0.9.0
Commit: a286d775fc3e38ca2fd9eb58a8275bb6e2067e14

$node --version
v12.2.0

Hi @makoto,
I wrote the code on v0.8.0.
The API might have changed on v0.9.0, I’ll check a bit later and update if needed.

1 Like

What is yarn equivalent in go? When I first tried I got lots of message that packages are not installed so I had to do lots of go get -u but not sure if that was the right way to do.

  517  go get -u github.com/golang/protobuf/ptypes
  519  go get -u github.com/onflow/flow/protobuf/go/flow/access
  520  go get -u github.com/onflow/flow/protobuf/go/flow/entities
  521  go get -u google.golang.org/grpc
  522  go get -u google.golang.org/grpc/status