Skip to content

Latest commit

 

History

History

private-networks

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Private GoChain Deployments

You can deploy GoChain in a private environment for the most optimized, stable 100% Ethereum compatible private blockchain.

Setting up a Private Network

You can run your own private GoChain network on your own hardware or on a cloud provider.

On the Cloud

Microsoft Azure

You can start a network on Azure with just a couple of clicks by choosing GoChain in the Azure Marketplace.

See Microsoft's blog announcement.

AWS

Use our AWS Cloudformation template to get started quickly.

Your own hardware

See custom/ for more information.

Testing Your Deployment

Once you've deployed, test that it's working by trying the following commands:

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' http://IP_ADDRESS_OF_THE_NODE:8545

You should receive something like that:

{"jsonrpc":"2.0","id":67,"result":"GoChain/v2.1.36/linux-amd64/go1.10.3"}
  1. Ssh into the instance and get an initial allocation address
cat genesis.json | grep alloc -C 1

You should get few lines, copy one with 40 symbols, then add 0x to beginning so it looks like this:

0x21aca1c055e459808506a37b1a0079723314c18f
  1. Check that you have something on your initial account via API
curl http://IP_ADDRESS_OF_THE_NODE:8545  -H 'content-type: application/json;' --data-binary '[{"id":"94455d269e0ee68abf391d9923d26b13","jsonrpc":"2.0","method":"eth_getBalance", "params":["ADDRESS_FROM_ABOVE","pending"]}]'

You should see initial balance that you set during creation on the Azure site:

[{"jsonrpc":"2.0","id":"94455d269e0ee68abf391d9923d26b13","result":"0xd46b9bd62f3ba7e0"}]
  1. Get the password of the genesis account (run this on the instance you connected)
cat password.txt
  1. Launch the interactive GoChain console on the machine you ssh'd into:
sudo docker run --rm -it -v $PWD:/gochain -w /gochain ghcr.io/gochain/gochain gochain --datadir /gochain/node attach
  1. Check the balance of the genesis account
eth.getBalance('ADDRESS_FROM_ABOVE')
  1. Go to GochainWallet and create a new account (a public and a private key)

  2. Check the balance of the new account in the interactive gochain console

eth.getBalance('NEW_ACCOUNT_ADDRESS')
  1. Unlock the genesis account in the interactive gochain console (the address from the step 3 and the password from the step 5)
personal.unlockAccount("ADDRESS_FROM_ABOVE","PASSWORD")
  1. Transfer some GO from the genesis account to the new one that you created on the step 8
eth.sendTransaction({from:"ADDRESS_FROM_ABOVE",to:'NEW_ACCOUNT_ADDRESS',value:1000})
  1. Check the balance of the new account:
eth.getBalance('NEW_ACCOUNT_ADDRESS')

And it should return 1000 in the new account!