An Ethereum private-chain environment for the ALIS
that using Parity PoA.
- aws-cli
- packer
- ansible
- jq
- direnv
# Create .envrc to suit your environment.
cp -pr .envrc.sample .envrc
direnv edit
Build an AMI that the nodes of Parity PoA.
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
cd ./packer/
packer build ./parity-poa.json
aws ec2 create-key-pair --key-name private-chain
./create_eip.sh
You have to specify SSM valuables as can as possible.
Such as IAM and EIP information you created above.
./deploy.sh
# 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
- Prerequisite: ec2ssh
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
# 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
You can use [parity dir]/enode.sh
.
Such as IAM Policies, and others.