Forge Blockchain Deployment Made Easy

1. 1 Forge: Blockchain Deployment Made Easy Brought to you by Tyr Chen
2. 2 Software is just 20% of an internet product
3. 3 Deployment and continuous delivery contributed to next 40%
4. Deploy automation is key for success • less problems • more iterations • robust • reusable code 4
5. 5 Blockchain node deployment is not easy
6. How does parity (ethereum) suggest? 6
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
9. 9 That’s just a single node
10. 10 For app developers, if they own a chain, that means many nodes to maintain
11. Cost for a chain (say 5 nodes in 4 regions) • EC2: 0.11 * 750 * 5 * 4 = $1500 • EBS: 0.1 * 100 * 5 * 4 = $200 • ELB: 25 * 4 = $100 11
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. 13 Problem: nodes come and go for spot instance, how can the validators survive?
14. 14 Or more speci c: how to prevent loss of private keys?
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
16. 16 How do we do real world deployment?
17. A 10, 000 feet overview 17
18. Chain deployment 18
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
20. Create eet: internals 20
21. Init chain - hosts: all become: true environment: PATH: /usr/local/bin:{{ ansible_env.PATH }} vars: token_name: "ArcBlock TBA" token_symbol: "TBA" token_desc: "ArcBlock TBA" initial_supply: 5750000000 total_supply: 7500000000 roles: - role: forge/show_info run_once: true - role: forge/mount_volume - role: forge/init_forge_network become_user: "{{ forge_user }}" 21
22. Init chain: internals 22
23. 23