Zcash Blockchain Infrastructure (zBI)
A platform for automating and orchestrating containerized blockchain infrastructure
Background
Alphega Solutions is a consulting firm established by John Akinyele, an AWS Certified Solutions Architect Professional. The firm provides clients with solutions for migrating and implementing cloud-based production workloads. Alphega Solutions began working with Bolt Labs, Inc in 2018 to implement a highly available Zcash full node and lightwalletd endpoint leveraging cloud-based containerized technologies.
Motivation
This project aims to create a platform (zBI) for operating and maintaining a high-availability architecture that allows for seamless scaling and a failure resilient infrastructure for operating Zcash instances with 99.9% uptime out of the box. zBI will provide mechanisms for deploying Zcash instances (comprising of Zcash full node and lightwalletd server) that are fault-tolerant with redundancies to handle high traffic. zBI promises to provide the Zcash community with an automated and repeatable containerized solution for operating Zcash instances. The platform will provide a framework for creating a secure multi-user shared environment based on cloud infrastructure.
zBI Platform
Cluster
The platform represents an environment/framework that can support one or more highly available Zcash nodes/instances. The framework will provide facilities for monitoring the health and state of the instances and auto-scaling to ensure the desired instances are maintained.
Node/Instance
Each instance in the cluster represents a full-node Zcash and/or lightwalletd provisioned and configured with storage, certificates, and a set of authorized users.
zBI Users
Platform Administrator
This represents the administrators for the underlying infrastructure with responsibility for purchasing and provisioning physical/cloud infrastructure. These users have the responsibility for creating instances, provisioning required storage and assigning instance administrators.
Node/Instance Administrator
This represents the administrator of a specific instance in the cluster. These users have the responsibility for managing the instance and determining which APIs to expose to end-users through the JSON-RPC or gRPC endpoints.
Node/Instance End-users
This represents the developers that can access available APIs through the endpoints exposed by the instance administrators. Instance administrators will authorize and provide end-users with appropriate credentials for secure access.
zBI Use Cases
The goal of the zBI platform is to support use cases that further the ZOMG mission to make Zcash ubiquitous. Specifically, we will focus on two essential use cases that will support the ecosystem:
Quick access to Blockchain data
Efficient and scalable access to comprehensive historical Zcash blockchain data. This is useful to exchanges and data analytics providers.
Node Management Platform
Leasing private nodes to builders and end-users for Zcash application development.
Technical Approach
zBI is a containerized solution for managing Zcash blockchain infrastructure in a portable and extensible containerized-orchestration system that allows for automated deployment, scaling, and management. The platform will leverage Kubernetes to orchestrate clusters of virtual machines and schedule containers to run on those virtual machines based on their available compute resources and the resource requirements of each container. Kubernetes is designed to group containers into pods so that they can be scaled to the desired state. It automatically manages service discovery, incorporates load balancing, tracks resource allocation, and scales based on compute utilization. In addition, it checks the health of individual resources and enables applications to self-heal by automatically restarting or replicating containers.
Software Components
zBI will use a declarative approach to define a desired state for the software components and corresponding configuration required to create a Zcash instance. These components (Zcashd and lightwalletd server) already have containerized solutions and it is also possible to create alternate containerized solutions from forked repositories in other to allow for customizations within these components. Other entities such as zcash.conf, security assets, and TLS certificates will be similarly represented as configurable assets. This approach allows for flexibility in configuring environments that meet the desired need. The need could be for a single-node instance (full node and/or lightwalletd) connecting to either testnet or mainnet; or an isolated peer network (with two or more nodes) fitted for a variety of testing or simulation needs.
Control Plane
zBI will provide a control plane with functionality to manage and operate the infrastructure. The control plane will provide mechanisms for defining and continuously managing the components of the platform to make sure the desired state is maintained.
High-Availability
High availability will be achieved through the combination of a continuous deployment pipeline to maintain the environment and deploy the necessary software components and leveraging auto-scaling and self-healing features of Kubernetes.
Execution Risks
The execution risk is minimal for this project. Kubernetes ecosystem is designed with features such as service discovery, load balancing, storage orchestration, automated rollouts/rollbacks, and self-healing. DevOps/GitOps principles will be leveraged to ensure the environment keeps up with changes to Zcashd and to overcome any inherent instabilities.
Downsides
This platform will be hosted in US East 1 region of AWS and thus subject to the availability and downtimes of its availability zones. Kubernetes ecosystem has a proven rich set of design patterns for implementing robust and fault-tolerant systems. In addition, disaster recovery plans will be put in place to replicate to an alternate region in case of catastrophic failures.
Evaluation Plan
Alphega Solutions will demonstrate the viability of this platform by operating and maintaining a set of Zcash full node and lightwalletd endpoints to the testnet sandbox environment using a Kubernetes cluster over 5 availability zones in US East region of AWS. The platform will also provide a framework for individuals to run their own Zcash infrastructure on personal devices or in a cloud environment. Ultimately, the goal of this project is to promote the deployment of containerized environments for R&D purposes and to increase community involvement.
Tasks & Schedule
Initialization Phase (1 month)
Setup AWS account
Purchase 1-year reserved EC2 instances
Configure AWS services
Setup Git Repository
Development Phase (3 months)
zBI Control Plane
DevOps Pipeline configuration
Deployment Phase (2 months)
Implement DevOps pipeline
Test and approve environment
Release zBI to Zcash community
Bug Fixes
Maintenance Phase (1 year)
Operate environment
Release Git repos and documentation to Zcash community
Budget
Infrastructure Cost $ 40,000
Compute – EKS, ECR, EC2
Storage – EBS, S3
Network – Load Balancer, NAT & Internet Gateway
DevOps – Code pipeline, Code build
Development Cost $ 20,000
1 Software Engineer
1 DevOps Engineer
Maintenance Cost $ 20,000
Infrastructure Monitoring
AWS Support
DevOps Cloud/Kubernetes Admin