Skip to content
An Ethereum PoA private-chain environment on AWS.
Branch: master
Clone or download
Latest commit 44bf2d8 Jan 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
ansible fix keys_path Sep 9, 2018
packer fix keys_path Sep 9, 2018
.ec2ssh edit .ec2ssh Jan 21, 2019
.editorconfig
.envrc.sample
.gitignore
README.md edit README.md Jan 21, 2019
create_eip.sh add create_eip.sh Jan 11, 2019
deploy.sh
fix_api.sh rename script and fix README.md May 15, 2018
logo.png edit README.md Jun 5, 2018
private_chain.yml add resources for connection. Mar 26, 2018
template.yaml Fix schema of tip Sep 5, 2018

README.md

ALIS
An Ethereum private-chain environment for the ALIS that using Parity PoA.

Prerequisite

  • aws-cli
  • packer
  • ansible
  • jq
  • direnv

Environment valuables

# Create .envrc to suit your environment.
cp -pr .envrc.sample .envrc
direnv edit

Preparation

Packer

Build an AMI that the nodes of Parity PoA.

Parity resources

You have to change ETH account keys when you use this in production.

  • ./packer/ansible/roles/parity/templates/PCParityPoA*_key.j2

Also spec.json.

  • ./packer/ansible/roles/parity/templates/spec.json.j2

Build

cd ./packer/
packer build ./parity-poa.json

Create EC2 KeyPair

aws ec2 create-key-pair --key-name private-chain

Create EIP

./create_eip.sh

Set SSM valuables

You have to specify SSM valuables as can as possible.
Such as IAM and EIP information you created above.

CloudFormation

Deployment

./deploy.sh

Fix API settings via a script

# Get API ID
aws apigateway get-rest-apis | jq -r --arg ALIS_API_NAME "${ALIS_APP_ID}api" '.items[] | select(.name==$ALIS_API_NAME).id'

# Set API ID to PRIVATE_CHAIN_REST_API_ID in .envrc
direnv edit

./fix_api.sh

After deployment

Connect Instances via Bastion

cp -p .ec2ssh ~/
vi ~/.ec2ssh

Fix some point for your environment.
Then execute ec2ssh update.

echo -e \\nHost PC*\\n  ProxyCommand ssh -W %h:%p Bastion >> ~/.ssh/config 
ec2ssh update

Now you can connect:

ssh PCParityPoA2a

Also you can use tmuxinator.

cp -p ./private_chain.yml ~/.tmuxinator/
mux private_chain

Configure servers.

# You have to edit HostNames.
vi ./ansible/roles/common/files/config

# Also you have to specify your hosts.
cd ansible
cp -p hosts.sample hosts
vi hosts

# Run ansible
ansible-galaxy install -p ./roles -r requirements.yml
ansible-playbook -i hosts site.yml

Connect Parity nodes each other

You can use [parity dir]/enode.sh.

Migrate private chain contracts from Bastion server

See: Private chain contracts

Fix template.yaml's FIXME: tags and deploy again

Such as IAM Policies, and others.

Set SSM valuables again

You can’t perform that action at this time.