one-click-cosmos-testnet

command module
v0.0.0-...-3e2d9fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

Introduction

This is an attempt to make it easier to get started with Cosmos SDK. This CLI will -

  1. Create 3 EC2 instances that are validators that come to consensus and commit transactions.
  2. Allow you to deploy your cosmos sdk code easily.
  3. Allow you to submit transactions against a real life blockchain, in order to simulate a production environment.
  4. Gives you a clean testing environment against which to run your code.

Please note that this repo is WIP. Please file an issue if you come across an error.

Prerequisites

You will need the following tech to run this cli

  1. Terraform
  2. AWS CLI
  3. Docker.
  4. GoLang
  5. Starport

Make sure that you have Docker desktop running. Otherwise this will not work.

Using this CLI

  1. Clone this repo
  2. Run go install github.com/prakashsanker/one-click-cosmos-testnet
  3. Scaffold a chain with starport starport scaffold chain <chain-name>
  4. Run starport chain serve. Once you see that the chain is running, quit the process.
  5. Run one-click-cosmos-testnet configure and enter in your AWS details. To generate an access key and a secret key follow this documentation.
  6. Run one-click-cosmos-testnet generate-test-infra
  7. Run one-click-cosmos-testnet generate-test-net

You will see output like so

Node - 0
SSH into Node0 with this command ssh -i 'validator_key.pem' -o IdentitiesOnly=yes ec2-user@ec2-65-0-204-22.ap-south-1.compute.amazonaws.com
Submit transactions at ec2-65-0-204-22.ap-south-1.compute.amazonaws.com:1317
Node - 1
SSH into Node1 with this command ssh -i 'validator_key.pem' -o IdentitiesOnly=yes ec2-user@ec2-3-110-92-148.ap-south-1.compute.amazonaws.com
Submit transactions at ec2-3-110-92-148.ap-south-1.compute.amazonaws.com:1317
Node - 2
SSH into Node2 with this command ssh -i 'validator_key.pem' -o IdentitiesOnly=yes ec2-user@ec2-65-0-27-30.ap-south-1.compute.amazonaws.com
Submit transactions at ec2-65-0-27-30.ap-south-1.compute.amazonaws.com:1317

The url at port 1317 is where you can submit transactions.

Deploys

Right now, this is hacky, but works.

  1. Run one-click-cosmos-testnet deploy

Rollbacks are not supported yet, but you can approximate by checking out (in git) and then running the deploy command.

Getting Validator Information

Run one-click-cosmos-testnet get-validators.

Diagnosing problems

You can ssh into the EC2 instance with the provided ssh command from get-validators.

Once there, run docker container ls and then docker exec -it <CONTAINER_ID> /bin/bash to ssh into the docker container.

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL