hedera-sdk-go icon indicating copy to clipboard operation
hedera-sdk-go copied to clipboard

Error when calling NewAccountCreateTransaction

Open asimlqt opened this issue 2 years ago • 4 comments

Description

I'm following the getting started tutorial and getting an error on Step 3 of Create an account:

panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/hashgraph/hedera-sdk-go/v2.(*Transaction).GetTransactionHashPerNode(0xc0001fac60)
	/home/asim/go/pkg/mod/github.com/hashgraph/hedera-sdk-go/[email protected]/transaction.go:422 +0x2d5
github.com/hashgraph/hedera-sdk-go/v2.(*Transaction).GetTransactionHash(0xc0001fac60)
	/home/asim/go/pkg/mod/github.com/hashgraph/hedera-sdk-go/[email protected]/transaction.go:393 +0x33
github.com/hashgraph/hedera-sdk-go/v2.(*AccountCreateTransaction).Execute(0xc0001fac60, 0xc0001f2a00)
	/home/asim/go/pkg/mod/github.com/hashgraph/hedera-sdk-go/[email protected]/account_create_transaction.go:490 +0x525
main.main()
	/home/asim/labs/hedera/hedera-go-examples/hedera_examples.go:50 +0x805
exit status 2

I copied and pasted the code from the tutorial and haven't made any changes to it.

After debugging a little further I can see the following error status: StatusInvalidNodeAccount

Steps to reproduce

  1. Follow the getting started tutorial until the end of https://docs.hedera.com/guides/getting-started/create-an-account
  2. Execute go run hedera_examples.go

Additional context

No response

Hedera network

testnet

Version

v2

Operating system

Linux

asimlqt avatar Sep 28 '22 07:09 asimlqt

Yes, I will have pr for this soon, for now u can solve it by manually setting node account ids.

andrix10 avatar Sep 28 '22 08:09 andrix10

Thanks, got it working now by manually setting the node account id.

asimlqt avatar Sep 28 '22 18:09 asimlqt

@asimlqt can uu please share the line code, or documentation.. thank you!

zolmine avatar Oct 03 '22 14:10 zolmine

Hi @zolmine this should be resolved with https://github.com/hashgraph/hedera-sdk-go/pull/582 Can you try with the latest version of the SDK and following the docs: https://docs.hedera.com/guides/getting-started/create-an-account Please let us know if this works for you

Kalina-Todorova avatar Oct 12 '22 09:10 Kalina-Todorova

Hi @zolmine, closing this for now as resolved. Feel free to reopen if you face this issue again or file another ticket.

Kalina-Todorova avatar Oct 31 '22 11:10 Kalina-Todorova