Learn how to use Forge Framework to easily deploy your own blockchains in the real world. This introduction includes instructions on how to build a deployment script, reference architecture and looks at some of the most common issues app developers run into when building apps.
https://www.arcblock.io
7. What’s inside of the deployment script?
• bash script to deploy the software locally
• no any suggestions on how to deploy in modern cloud
• no suggestions on security / performance / cost efficiency /etc.
feels like we're back to 90s
7
8. How do we deploy parity?
• dedicate VPC (isolation)
• big instance & big, high IOPS disk (n Terabytes)
• cost is pretty high
• our own deployment code
• packer to build ami
• terraform to provision aws resources
• ansible to deploy
8
12. What if we use spot instances
• EC2: 0.1 * 0.2 * 750 * 20 = $300
• EBS: 0.1 * 100 * 20 = $200
• ELB: 25 * 4 = $100
12
13. Problem: nodes come and go for spot instance,
how can the validators survive?
13
14. Or more speci c: how to prevent loss of private keys?
14
15. Solution: Dedicate data disk + S3 encrypted bucket
• Root EBS: OS, forge software, configuration and keys (no snapshot)
• Data EBS: forge data (snapshot regularly)
• S3 encrypted bucket: backup the configuration and keys
• When a node is terminated or broken:
• spawn a new instance
• restore keys / config from S3
• restore data EBS from a latest snapshot
• start forge
15
19. Create eet
- hosts: localhost
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
vars_prompt:
- name: "chain_id"
prompt: "What's the chain id?"
private: no
default: "forge"
- name: "version"
prompt: "which version of forge are you using?"
private: no
default: "0.20.12"
- name: "num_validator"
prompt: "How many validator node do you want per region?"
private: no
default: 3
- name: "num_sentinel"
prompt: "How many sentinel node do you want per region?"
private: no
default: 2
- name: "volume_size"
prompt: "How big the disk do you need?"
private: no
default: 100
- name: "delete_on_termination"
prompt: "Delete EBS volume on instance ternimation?"
private: no
19