Skip to content

Commit

Permalink
Demo and Getting Started in Readme (#32)
Browse files Browse the repository at this point in the history
* Update README.md

* Add Getting Started

* Jack patch

* update to use uroll denom

* Update README.md

* Update README.md

---------

Co-authored-by: Jack Zampolin <jack.zampolin@gmail.com>
Co-authored-by: Reece Williams <31943163+Reecepbcups@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 15, 2024
1 parent 7d7ee94 commit 4719bbb
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 3 deletions.
82 changes: 79 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,82 @@
# spawn
<div align="center">
<h1>Spawn</h1>
</div>

Spawn is the best development platform for building custom modular Cosmos-SDK blockchains. Pick and choose modules to create a network tailor-fit to your needs. Use the native Cosmos tools and standards you're already familiar with. Quickly test interoperability between your new chain and established networks like the Cosmos-Hub across local devnet, public testnet, and mainnet through native InterchainTest support. Take advantage of the latest innovations, such as Proof-Of-Authority consensus and Celestia Data Availability. Build without limits.

## Spawn in Action

In this demo @Reecepbcups:
- Downloads and installs `spawn`
- Creates a new chain, customizing the modules and genesis
- Installs the chain binary and spins up a local testnet
- Interacts with the chain using the `appd` CLI

https://github.com/rollchains/spawn/assets/10821110/0de7bf37-c82a-4826-a3e3-13def6a53327

## Requirements

- `go 1.21+` - [official site](https://go.dev/doc/install)
- Docker - [official site](https://docs.docker.com/get-docker/)

## Getting Started
In this tutorial, we'll create and interact with a new Cosmos-SDK blockchain called "rollchain", with the token denomination "uroll". This chain has tokenfactory, POA, and globalfee modules enabled, but we'll disable cosmwasm.

1. Clone this repo and install

```shell
git clone https://github.com/rollchains/spawn.git
cd spawn
make install
```

2. Create your chain using the `spawn` command and customize it to your needs!

```shell
spawn new rollchain \
--bech32=roll `# the prefix for addresses` \
--denom=uroll `# the coin denomination to create` \
--bin=rolld `# the name of the binary` \
--disabled=cosmwasm `# modules to disable. By default all modules are enabled [tokenfactory, PoA, globalfee, cosmwasm]` \
--org={your_github_username} `# the github username or organization to use for the module imports`
```

> *NOTE:* `spawn` creates a ready to use repository complete with `git` and GitHub CI. It can be quickly pushed to a new repository getting you and your team up and running quickly.
3. Spin up a local testnet for your chain

```shell
cd rollchain
make testnet
```

4. Open a new terminal window and send a transaction on your new chain

```shell
# list the keys that have been provisioned with funds in genesis
rolld keys list

# send a transaction from one account to another
rolld tx bank send acc0 $(rolld keys show acc1 -a) 1337uroll --chain-id=chainid-1

# enter "y" to confirm the transaction
# then query your balances tfor proof the transaction executed successfully
rolld q bank balances $(rolld keys show acc1 -a)
```

5. Push your new chain to a new repository

> [Create a new repository on GitHub](https://github.com/new)
```shell
# git init, add, and commit are all handled by default unless you add the `--no-git` flag on create
git remote add origin https://github.com/{your_github_username}/rollchain.git
git push -u origin master
```
In this tutorial, we configured a new custom chain, launched a testnet for it, tested a simple token transfer, and then pushed the custom chain code to a new git repo. This tutorial demonstrates just how easy it is to create a brand new custom Cosmos-SDK blockchain from scratch, saving developers time.

## Spawn Product Goals

## Goals
- Easy templating for a new chain from base

- Local-Interchain nested, easy JSON configured starts
Expand All @@ -11,4 +87,4 @@

- Base for a new module into your repo (spawn module new <module-name>). Regex import into your apps SDK without any comments in the app.go

- Easily import or clone upstream modules into your repo (spawn module import <module-name>). Module name can also be a git repo (even one we do not own) that we can pull the files from directly for the user. So if we want SDK v0.50 tokenfactory, we can pull from repo X or repo Y depending on our needs. May require a unique go.mod for each module, unsure atm. Maybe we can abstract this away and handle ourselves?
- Easily import or clone upstream modules into your repo (spawn module import <module-name>). Module name can also be a git repo (even one we do not own) that we can pull the files from directly for the user. So if we want SDK v0.50 tokenfactory, we can pull from repo X or repo Y depending on our needs. May require a unique go.mod for each module, unsure atm. Maybe we can abstract this away and handle ourselves?
27 changes: 27 additions & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Deployment Information

Spawn created applications are able to be deployed in a large number of configurations. The following are some of the most common configurations:

## Single Node

The simplest deployment is a single node. This is the easiest to set up and is the most common for development and testing. It is also the most common for small scale production deployments. This has the following downsides:
- Single point of failure
- No redundancy
- No scalability
- Insecure IBC

TODO: Add some options for easy deployment for single node deployments. If theres some GH action thing to deploy to a cloud that would be ideal.

## Single Node with Horcrux

A single node with Horcrux is a single node deployment with a Horcrux backup. This is a simple way to add redundancy to a single node deployment. This is similar to the This has the following downsides:
- No redundancy for the chain node
- Still pretty insecure IBC

TODO: Add a guide for setting this up. this option is relatively hard to do and doesn't really offer a whole ton more but we have it :shrug:

## Full Consensus Network

A full consensus network is a network with a full set of nodes. This is the most secure and scalable deployment. It requires at least 4 nodes to be secure. It is more expensive to run and more complex to set up, but provides much more security for IBC and allows for more complex incetive structures.

TODO: Some of the following: guides for setting up all the nodes yourself, maybe a cloud deployment option. A list of validators who are interested in deploying these types of networks. A talk to us button.

0 comments on commit 4719bbb

Please # to comment.