I wish to create an account on a private stellar network.
The network was created using this docker image https://github.com/stellar/docker-stellar-core-horizon
, with the --standalone
flag.
When I attempt to create a network in the following way I receive the error Network.current(...).networkId is not a function
.
The SDK is connected to the network and I am able to get the network information using StellarSdk.Network.current()
.
stellarServer
.loadAccount(sourceKey.publicKey())
.then(sourceAccount => {
transaction = new StellarSdk.TransactionBuilder(sourceAccount)
.addOperation(
StellarSdk.Operation.createAccount({
destination: dest,
startingBalance: "100"
})
)
.build();
transaction.sign(sourceKey);
return stellarServer.submitTransaction(transaction);
})
.then(result => {
console.log("success" + JSON.stringify(result, undefined, 2));
})
.catch(error => {
console.log("error" + error);
});