This README provides a comprehensive guide on using the AWS Deployment Utility script for deploying the TLSNotary Server on AWS infrastructure. This utility is especially useful for zkApp developers who wish to deploy their application in a production environment.
The AWS Deployment Utility script is designed to automate the deployment of a TLSNotary Server on an AWS EC2 instance. This script handles various tasks, including the creation of an EC2 instance, installation of necessary dependencies, and running the Notary Server.
Before running this script, ensure you have the following:
- AWS Account: An active AWS account and appropriate permissions to create and manage EC2 instances.
- AWS SDK for JavaScript: Ensure the AWS SDK for JavaScript is installed and configured correctly in your environment.
- SSH Key: The script assumes you have an SSH key named
zknotary
in your AWS account and locally under~/.ssh/zknotary.pem
. Make sure this key exists, or modify the script to use a key of your choice.
- EC2 Client Configuration: The script sets up an EC2 client targeting the
us-east-1
region. - Instance Creation: It deploys a
t2.micro
instance using the specified AMI, key name, and security group. - Instance Initialization: After creating the instance, the script waits for 60 seconds to allow the instance to initialize.
- Setup Commands: The script executes a series of commands on the newly created instance. These commands include setting up a DNS resolver, installing Rust, cloning the TLSNotary repository, and running the Notary Server.
- SSH Execution: It uses SSH to run the setup commands on the EC2 instance.
To run the script, simply execute it in your JavaScript environment. The script will log outputs to the console, which includes any standard output or errors encountered during the deployment process.
node aws-deployment-script.js
If the deployment fails, check the following:
- AWS Credentials: Ensure your AWS credentials are set up correctly and have the necessary permissions.
- SSH Key: Verify that the SSH key is correctly set up both in AWS and locally.
- Network Accessibility: Ensure that the security group and network configurations allow SSH access to the EC2 instance.
Note: This script is intended for production deployment. For development purposes, you may want to consider simpler alternatives, like cloning the TLSNotary repository and running the Notary Server.
Contributions are welcome. Please submit a pull request or create an issue to discuss the changes you want to make.
Apache