I am using a private Stellar network with Horizon but struggling to get the first accounts created using the Go SDK. When attempting to create an account using the autosequence option with the client I have created I get the following error:
mutator:1 failed: couldn't load account for auto sequence: load account failed.
Here is the code:
c := &horizon.Client{
URL: "my horizon url",
HTTP: http.DefaultClient,
}
// Root secret
seed := "my network root secret key"
acc, _ := keypair.Random()
pubkey := acc.Address()
tx, err := b.Transaction(
b.SourceAccount{seed},
b.AutoSequence{SequenceProvider: c},
b.Network{"My network passphrase"},
b.CreateAccount(
b.Destination{pubkey},
b.NativeAmount{"50"},
),
)
I have also tried setting the sequence number using b.Sequence to zero and one and get the following error for that:
Horizon error: "Transaction Failed".
When I check the transaction result codes I see "tx_bad_seq". I think autosequence is the way to go but would greatly appreciate if someone could point me in the right direction when using this with a private network.