Giter VIP home page Giter VIP logo

blockchain-provisioning's Introduction

DEPRECATED

The circles pilot will be run on Kovan instead of a private testnet. This repo exists only for reference / archival purposes and does not describe a live system anywhere.

Blockchain Provisioning

This repository contains terraform scripts defining an AWS environment containing a private Ethereum blockchain

Using the Cluster

Running a Local Node

Run one of these from the project root. NODE_NAME is the name that will be shown at stats.circles-chain.com

  • Full node: ./nodes/full <NODE_NAME>
  • Light client: ./nodes/light <NODE_NAME>

Bringing Up the AWS environment

  1. Install terraform
  2. Run aws configure --profile circles-blockchain-provisioning
  3. Enter the access-key and secret, and set the default region as eu-central-1. The output format can be None.
  4. terraform init
  5. terraform apply

Operating the Cluster

  • aside from a few exceptions (see below) this git repository should fully and completly describe the cluster and all associated AWS infrastructure
  • updates to the cluster should only be applied by changing the source code and running terraform apply
  • instances are immutable (never modified after they are deployed)
  • if an instance needs to be changed then it will be destroyed and an updated replacement will be built from source and deployed

Manually Provisioned Resources

Terraform State and Locking Table

  • state is persisted to an encrypted & versioned S3 bucket
  • in order to reduce the risk that a bad commit could destroy the state the required resources (S3 bucket + dynamoDB table) are managed outside of Terraform
  • specified in providers.tf
  • docs: state | backends

Secrets

EFS Folder Structure

  • Directories in EFS can only be created by mounting an instance and running mkdir.
  • Nodes share the same EFS volume but only mount subdirectories. Subdirectories cannot be mounted until they actually exist.
  • EFS volume needs /sealer and /rpc directories (should be empty)

Environment / Topology

Data Persistance

  • defined in storage.tf
  • all state is persisted in a single EFS filesystem volume

Consensus Parameters

Network

  • defined in network.tf
  • 1 private & 1 public subnet in eu-central-1

Logging

  • cloud-init logs for each instance written to cloudwatch logs

Services

Each service runs on a single burstable t2.micro instance (defined in services/base.tf).

sealer (x2)

  • produces blocks
  • holds private keys
  • running geth
  • private subnet

rpc

  • rpc ports opened to public internet
  • relays blocks to sealer
  • allows interaction with metamask
  • running geth
  • public subnet

bootnode

  • service discovery
  • requires open udp ports to the network
  • running geth
  • public subnet

ethstats

  • monitoring dashboard for the cluster
  • running eth-netstats
  • public subnet

TODO

Big

  • Block explorer -> blocked by blockscout/blockscout#196
  • Define staging environment & deployment pipeline
  • Bootnode should be stateful
  • Authentication for RPC endpoints
  • Define (and ideally automate) secret rotation procedures
  • Backup chain state (ideally some versioned / snapshotting system). Test restoration from these backups.

Small

  • metamask cannot connect to rpc w./ DNS, only w./ IP
  • Cap size of log file on disk
  • Unify geth version parameters
  • Services should not be run as root
  • Use systemd to autorestart failed processes

blockchain-provisioning's People

Contributors

d-xo avatar edzillion avatar xwvvvvwx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.