Skip to content

ipatka/devcon4-workshop

 
 

Repository files navigation

Devcon4 Workshop

Architecting with Ethereum

Table of Contents


Intro

Welcome to the Architecting with Ethereum workshop, presented at Devcon IV in Prague on October 30, 2018.

CryptoKube.io

CryptoKube is an open source software stack for hosting peer-to-peer cryptographic applications. It currently consists of many separate modules (primarily Ansible, Terraform, and Docker). The ultimate goal is to provide a turnkey Kubernetes implementation (still under development).

Visit CryptoKube.io for the latest details.

Workshop

In this workshop we build a basic Ethereum application stack using components from the CryptoKube public repos.

We begin by introducing the adminstrative tooling and the major components of the stack. Then we conduct a series of exercises to demonstrate the concepts in realistic use cases. Each exercise builds on previous exercises, and each aims to introduce one major administrative concept and one major P2P crypto node concept.

It is possible to run the exercises locally, although it is recommended to use the provided management host image for greatest environment consistency.

Inspiration

"It's up to us. We cannot take for granted that the future will be better, and that means we need to work to create it today."

  • Peter Thiel, "Zero to One"

Prerequisites

  • Experience: Familiarity with Ethereum and remote Linux administration
  • Software: SSH client & web browser
  • Assets: Digital Ocean account w/SSH & API keys

Initial Setup

Local Setup

TODO

Management Host

The management host is a 2GB droplet running Ubuntu Server 18.04 LTS. To provision the management host, run TODO

It comes preconfigured with the following components:

  • Nginx+LetsEncrypt
  • GoCD
  • Ansible
  • Terraform
  • Packer
  • Virtualbox

Exercises


Administrative Tooling

We'll primarily be using Terraform, Ansible, terraform-inventory, Docker, and Git.

Terraform

HashiCorp Terraform enables you to safely and predictably create, change, and improve infrastructure. It is an open source tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

Overview:

  • Easily describe your infrastructure as code
  • Version control your resources, allowing rollback to previous state
  • Uses declarative syntax (HCL), fully JSON compatible but extended for easier human consumption

Major Concepts:

  • Configuration: text files with .tf extension, describes infrastructure and sets variables
  • State: terraform.tfstate, maps real world resources to your configuration, and keeps track of metadata
  • Providers: responsible for understanding API interactions and exposing resources, example: DigitalOcean, Docker, Consul
  • Modules: self-contained packages configurations that are managed as a group, used to create reusable components

Basic Commands To view a list of available commands, run terraform with no arguments. For details about a command, run terraform <command> -h

  • terraform init - Initialize a new or existing Terraform configuration (install plugins, perform minimal validation)
  • terraform plan - Generate and show an execution plan
  • terraform show - Inspect Terraform state or plan
  • terraform apply - Builds or changes infrastructure
  • terraform destroy - Destroy Terraform-managed infrastructure

Links

Ansible

Ansible is an open source software that automates software provisioning, configuration management, and application deployment. -wikipedia

External Training

Docker

Docker is a computer program that performs operating-system-level virtualization also known as containerization. -wikipedia

Basic Commands To view a list of available commands, run docker with no arguemnts. For details about a command, run docker <command> -h

  • Containers:
    • docker ps - List containers
    • docker logs - Fetch the logs of a container
    • docker kill - Kill one or more running containers
    • docker rm - Remove one or more containers
  • Images:
    • docker images - List images
    • docker rmi - Remove one or more images

Links

Packer

HashiCorp Packer is a tool for building images for cloud platforms, virtual machines, containers and more from a single source configuration.

DigitalOcean

DigitalOcean is an Infrastructure as a Service (IaaS) platform that aims to be "The simplest cloud platform for developers & teams."


Infrastructure Components

Reverse Proxy

Load balancing Load balancing improves the distribution of workloads across multiple computing resources, such as computers, a computer cluster, network links, central processing units, or disk drives. -wikipedia

High availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime, for a higher than normal period. -wikipedia

HAProxy

Nginx

Service Discovery & KV Store

Consul


Interplanetary Filesystem (IPFS)


Ethereum

Ports

Service Protocol Port Interface
HTTP RPC TCP 8545 private
HTTP WS TCP 8546 private
P2P TCP 30303 public
Node discovery UDP 30301 public

Networks

Here are the most commonly-used networks:

Net ID Chain ID Description Consensus Client(s)
1 1 Ethereum mainnet PoW All
3 1 Ropsten testnet PoW All
4 1 Rinkeby tesnet PoA Geth
42 1 Kovan testnet PoA Parity
1 61 Ethereum Classic mainnet PoW All
2 1 Ethereum Classic testnet PoW All

Links

Node Types

Name Headers Transactions State Notes
Light client All On-demand On-demand suitable for mobile & embedded applications
Full node All All Pruned suitable for most server applications
Archive node All All All necessary only for deep block exploration
Bootstrap node All All Pruned required for private blockchains

Geth

Parity


Ethereum Applications


About

DevCon4 workshop: Architecting with Ethereum

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HCL 68.5%
  • Shell 31.5%