Error creating private network

I ran the following command to create a private network:
./goal network create -r ~/net1 -d ~/data-net1 -n private -t ./template.json

and received the following error:
Error creating private network: invalid template: Genesis account allocations must total 100 (actual 0)

I tried the template.json file found on https://github.com/algorand/go-algorand-doc/blob/master/tutorials/private_network.md. There are 3 wallets which have a
total stake of 100. Is there an error in the sample template file?

Can you try the template located here:
https://developer.algorand.org/docs/creating-private-network

Thanks - it appears that example is an older format. I’ll update that now.

Thanks Jason. That template works.

The sample template in github should work now as well.

Dave,
The template you uploaded to GitHub does not work. The “Online”
attribute for Wallets should be a Boolean instead of an integer.

The template located in the developer docs appears to have fixed the problem with generating the genesis accounts but it still fails to create the network. I got the following output when I tried to create the network.

Created new genesis wallet: /home/rick/net1/Wallet1.rootkey, /home/rick/net1/Wallet1.300.1000300.partkey
Created new genesis wallet: /home/rick/net1/Wallet2.rootkey, /home/rick/net1/Wallet2.300.1000300.partkey
Created new genesis wallet: /home/rick/net1/Wallet3.rootkey, /home/rick/net1/Wallet3.300.1000300.partkey
Error creating private network: exit status 1

I noticed that the net1 directory does not exist.

If this is the command you used can you alter it:
./goal network create -r ~/net1 -d ~/data-net1 -n private -t ./template.json
to
./goal network create -r ~/net1 --n private-net -t ./template.json

-d is for a specific nodes data directory. In the case of the template you are using it should have a primary and a node directory that are the specific data directories for each of the two nodes. After you start the network you should be able to run

goal account list -d ~/net1/Primary for example.

So the one jason sent works completely, and the updated github version creates wallets now but then errors out?

The command removes the root folder you provided if it fails, which is why it doesn’t exist after the failure.

I tried creating the network without the “-d” option and it still fails to create the network.

$ ./goal network create -r ~/net1 -n private -t ./priv-template.json
Created new genesis wallet: /home/rick/net1/Wallet1.rootkey, /home/rick/net1/Wallet1.300.1000300.partkey
Created new genesis wallet: /home/rick/net1/Wallet2.rootkey, /home/rick/net1/Wallet2.300.1000300.partkey
Created new genesis wallet: /home/rick/net1/Wallet3.rootkey, /home/rick/net1/Wallet3.300.1000300.partkey
Error creating private network: exit status 1

Did the template I pointed to work?

The template you pointed me to creates the wallets and then errors out. As Dave stated, the folders are removed if the command fails.

The file that Dave uploaded to GitHub fails with the following error:
Error creating private network: json: cannot unmarshal number into Go struct field WalletData.Online of type bool

I compared the two template files and noticed that the one you pointed me to has the “Online” attribute of the Wallets as a bool. The file Dave uploaded to GitHub sets “Online” to a binary value.

I installed the Node software last night. I have not tried to install and run the software on the testnet yet. I wanted to try out a private net before running a node on the testnet

Can you run the update script and first try to start a TestNet client. After you get it to run you can shut it down and try the private network again.

Ah sorry about that. I did that before. Will fix that now too.

Jason and Dave, Thanks for your help. Everything is working now. I did a clean install on another machine and setup a testnet node first and then got the private network up and running.

Good to hear! Thanks for letting us know.