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().

  .then(sourceAccount => {
    transaction = new StellarSdk.TransactionBuilder(sourceAccount)
          destination: dest,
          startingBalance: "100"
    return stellarServer.submitTransaction(transaction);
  .then(result => {
    console.log("success" + JSON.stringify(result, undefined, 2));
  .catch(error => {
    console.log("error" + error);

1 Answer 1


You need to choose your private network first.

StellarSdk.Network.use(new StellarSdk.Network('your_private_network_passphrase_here'))

Then create an instance of StellarSdk.Server using the link to your local Horizon server.

let stellarServer = new StellarSdk.Server('http://{horizon_instance_address}:{horizon_port}')

And after that you can proceed with your code.

  • Thank you. My error was not initiating a new StellarSdk.Network but rather simply using the passphrase after `StellarSdk.Network.use("passphrase") Oct 3, 2018 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.