Skip to content

Commit

Permalink
feat: docs site & overhaul (#207)
Browse files Browse the repository at this point in the history
* temp: move docs -> _old

* a base

* latetst

* gh pages workflow

* perms

* `deploymentBranch: "gh-pages",`

* contents: write

* tweaks for prod

* v0.50 base url?>

* redirect to /spawn/v0.50.0

* f

* v0.50 proper redirect?

* idk

* yaaa babyy

* bikes

* wip

* rm unused imgs

* fix a little

* full tutorial

* typo

* deploy only on push to main

* cleanup

* checklist

* latest docs

* system req

* remove router

* final walkthrough
  • Loading branch information
Reecepbcups authored Sep 8, 2024
1 parent 622ab14 commit 578d28d
Show file tree
Hide file tree
Showing 117 changed files with 18,019 additions and 411 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This deploy-docs workflow was created based on instructions from:
# https://docusaurus.io/docs/deployment
name: Deploy to GitHub Pages

permissions:
contents: write
actions: write
pages: write

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "docs/**"
- .github/workflows/deploy-docs.yml

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache-dependency-path: docs/package-lock.json

- name: Build website
run: make build-docs

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.6.4
with:
branch: gh-pages
folder: docs/build
single-commit: true
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ get-localic:

.PHONY: get-heighliner

.PHONY: build-docs
## build-docs: Build the documentation.
build-docs:
@cd docs && npm ci && npm run build

## serve-docs: Run docs server
serve-docs:
@cd docs && npm run serve

## dev-docs: Run dev docs instance
dev-docs:
@cd docs && npm run dev

help: Makefile
@echo
@echo " Choose a command run in "spawn", or just run 'make' for install"
Expand Down
134 changes: 30 additions & 104 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,125 +8,51 @@ Spawn is the easiest way to build, maintain and scale a Cosmos SDK blockchain. S
- **Integrations**: Github actions and end-to-end testing are configured right from the start.
- **Iteration**: Quickly test between your new chain and established networks like the local Cosmos-Hub devnet.

## Spawn in Action

In this 4 minute demo we:
- Create a new chain, customizing the modules and genesis
- Create a new `nameservice` module
- Add the new message structure for transactions and queries
- Store the new data types
- Add the application logic
- Connect it to the command line
- Runs `make sh-testnet` to build and launch the chain locally
- Interacts with the chain's nameservice logic, settings a name, and retrieving it

https://github.com/rollchains/spawn/assets/31943163/ecc21ce4-c42c-4ff2-8e73-897c0ede27f0

## Requirements

- [`go 1.22+`](https://go.dev/doc/install)
- [`Docker`](https://docs.docker.com/get-docker/)
- [`git`](https://git-scm.com/)
## Installation

## System Setup
### Prerequisite Setup

* [MacOS](./docs/SYSTEM_SETUP.md#macos-setup)
* [Ubuntu](./docs/SYSTEM_SETUP.md#ubuntu-setup)
* [Windows](./docs/SYSTEM_SETUP.md#windows-setup)
If you do not have [`go 1.22+`](https://go.dev/doc/install), [`Docker`](https://docs.docker.com/get-docker/), or [`git`](https://git-scm.com/) installed, follow the instructions below.

---
* [MacOS](./docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md#macos)
* [Windows](./docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md#windows)
* [Ubuntu](./docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md#linux-ubuntu)

## 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 and Proof of Authority, but we'll disable cosmwasm.

1. Clone this repo and install
### Install Spawn

```bash
git clone https://github.com/rollchains/spawn.git
# Download the the Spawn repository
git clone https://github.com/rollchains/spawn.git --depth=1 --branch v0.50.7
cd spawn
git checkout v0.50.7

# Install Spawn
make install

# Install Local-Interchain (testnet runner)
make get-localic

# If you get "command 'spawn' not found", add to path
# Attempt to run a command
spawn help

# If you get "command 'spawn' not found", add to path.
# Run the following in your terminal to test
# Then add to ~/.bashrc (linux) or ~/.zshrc (mac)
export PATH="$PATH:$(go env GOPATH)/bin"
# Then add to ~/.bashrc (linux / windows) or ~/.zshrc (mac)
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.bashrc
source ~/.bashrc
```

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

```bash
GITHUB_USERNAME=rollchains

# If the `--consensus` or `--disabled` flags are not present,
# a selector UI will appear in your terminal to see all options.
spawn new rollchain \
--consensus=proof-of-authority \
--bech32=roll \
--denom=uroll \
--bin=rolld \
--disabled=cosmwasm,globalfee,block-explorer \
--org=${GITHUB_USERNAME}
```

> *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

```bash
cd rollchain

# Starts 2 networks for the IBC testnet at http://127.0.0.1:8080.
# - Builds the docker image of your chain
# - Launches a testnet with IBC automatically connected and relayed
#
# Note: you can run a single node, non IBC testnet, with `make sh-testnet`.
make testnet
```

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

```bash
# 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=localchain-1

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

5. (optional) Send an IBC transaction

```bash
# submit a cross chain transfer from acc0 to the other address
rolld tx ibc-transfer transfer transfer channel-0 cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr 7uroll --from=acc0 --chain-id=localchain-1 --yes

# Query the other side to confirm it went through
sleep 10

# Interact with the other chain without having to install the cosmos binary
# - Endpoints found at: GET http://127.0.0.1:8080/info
# - make get-localic
local-ic interact localcosmos-1 query 'bank balances cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr'
```

6. Push your new chain to a github repository

```bash
# Create a new repository on GitHub from the gh cli
gh repo create rollchain --source=. --remote=upstream --push --private
```

> You can also push it the old fashioned way with https://github.com/new
## Spawn in Action

In this tutorial, we configured a new custom chain, launched a testnet for it, tested a simple token transfer, and confirmed it was successful. This tutorial demonstrates just how easy it is to create a brand new custom Cosmos-SDK blockchain from scratch, saving developers time.
In this 4 minute demo we:
- Create a new chain, customizing the modules and genesis
- Create a new `nameservice` module
- Add the new message structure for transactions and queries
- Store the new data types
- Add the application logic
- Connect it to the command line
- Build and launch a chain locally
- Interact with the chain's nameservice logic, settings a name, and retrieving it

## Add a Feature
[Follow Along with the nameservice demo](https://rollchains.github.io/spawn/v0.50/build/name-service/) | [source](./docs/versioned_docs/version-v0.50.x/02-build-your-chain/01-nameservice.md)

If you wish to add a feature to spawn, reference the [NEW_FEATURE.md](./docs/NEW_FEATURE.md) for guidance.
https://github.com/rollchains/spawn/assets/31943163/ecc21ce4-c42c-4ff2-8e73-897c0ede27f0
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
3 changes: 0 additions & 3 deletions docs/PLUGINS.md

This file was deleted.

Loading

0 comments on commit 578d28d

Please sign in to comment.