Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions docs/dev/DEPLOYMENTS.md

This file was deleted.

40 changes: 0 additions & 40 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,7 @@ const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
defaultSidebar: [
{ type: "autogenerated", dirName: "." },
// {
// type: "category",
// label: "Resources",
// collapsed: true,
// items: [
// {
// type: "link",
// label: "IBC",
// href: "https://ibc.cosmos.network/v8",
// },
// {
// type: "link",
// label: "Cosmos-SDK",
// href: "https://docs.cosmos.network",
// },
// {
// type: "link",
// label: "Developer Portal",
// href: "https://tutorials.cosmos.network",
// },
// {
// type: "link",
// label: "Awesome Cosmos",
// href: "https://github.com/cosmos/awesome-cosmos",
// },
// ],
// },
],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
},
],
*/
};

module.exports = sidebars
210 changes: 209 additions & 1 deletion docs/versioned_docs/version-v0.50.x/00-meet-spawn.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,214 @@ Spawn is the easiest way to build, maintain and scale a Cosmos SDK blockchain. S

## NameService Demo

[Follow Along with the NameService demo](../version-v0.50.x/02-build-your-application/01-nameservice.md)
[Follow Along with the NameService demo](./02-build-your-application/01-nameservice.md)

<video src="https://github.com/rollchains/spawn/assets/31943163/ecc21ce4-c42c-4ff2-8e73-897c0ede27f0" width="100%" height="100%" controls></video>


## Testimonials

> "Spawn is a marked transformation in CosmosSDK protocol development, allowing scaffolding and upgrading from 0.47 to 0.50 to be achievable and understandable. Without the tool, this would have been a dedicated multi-month effort" - Ash, [Burnt.com](https://burnt.com/)


> "Spawn has truly streamlined the developer onboarding process into the Cosmos ecosystem, seamless and efficient." - [Anil](https://x.com/anilcse_/status/1840444855576846355) [VitWit](https://www.vitwit.com/)

---

## Spawn Overview

Setting up a new blockchain used to take at least a week, requiring manual edits, debugging, and configuring tests. Now, with Spawn, you can create a custom network in just a few clicks. It generates a personalized network tailored to your project, letting you focus on writing product logic. The modular approach allows you to include or remove features, so you can start building quickly without the hassle of setting up everything from scratch. Spawn simplifies the process, especially for new developers, by removing guesswork and speeding up the setup.

## New Development

Get started building using the `new-chain` command. Spawn will guide you through the process of selecting the modules you need and configuring your new chain. Using `--help` will showcase examples and other options you may want to consider for your new network.

```bash
spawn new mychain --help
```

```bash
Create a new project

Usage:
spawn new-chain [project-name] [flags]

Aliases:
new-chain, new, init, create

Flags:
-b, --binary string Application binary name (default "simd")
--bypass-prompt Bypass UI prompter
--denom string Bank token denomination (default "token")
--org string Github organization name (default "rollchains")
--skip-git No git repository created
--wallet-prefix string Users wallet namespace (default "cosmos")
```

### Security Selection

You can read about different security models in the [Consensus Security](./04-learn-spawn/01-consensus-algos.md) section. If you don't know which to select, use proof of authority.

```bash
spawn new mychain
```

After running the new command, navigate with your arrow keys and press 'enter' to select the module you want to use. You can only use 1 from this consensus list. Then select done.

```
Consensus Selector (( enter to toggle ))
Done
✔ proof-of-authority
proof-of-stake
interchain-security
```

### Feature Selection

You now select which features you want to include in your base application. Usually you would have to do these manually, each taking about 15 minutes to integrate. With spawn, you select them right away. It automatically configures them **and** give you testing for the assurance it works.

An information guide will be displayed for each feature at the bottom of the UI, sharing information about what the feature does. Select the following then press 'enter' on done to continue.

```bash
Feature Selector (( enter to toggle ))
Done
✔ tokenfactory
✔ ibc-packetforward
✔ ibc-ratelimit
cosmwasm
wasm-light-client
✔ optimistic-execution
ignite-cli
✔ block-explorer
tokenfactory: Native token minting, sending, and burning on the chain
```

Just like that, an entire network is generated. Everything you need to get started and more! Let's dive in.

## Structure

Opening up this newly generated `mychain/` gives you a general view into the entire layout.

```bash title="ls -laG"
.github/
app/
chains/
cmd/
contrib/
explorer/
interchaintest/
proto/
scripts/

.gitignore
.goreleaser.yaml
chain_metadata.json
chain_registry_assets.json
chain_registry.json
chains.yaml
docker-compose.yml
Dockerfile
go.mod
go.sum
Makefile
README.md
```

### .github/

This directory contains all the workflow actions for native github integration out of the box. It handles
- Integration & Unit tests for every code change
- Docker images saved to [ghcr](https://github.com/features/packages) on a new version tag
- Public cloud or private hosted testnets
- App binary releases
- PR title formatting
- Markdown file valid link reviews

### app/

App is the main location for all of the application connection logic.

- **decorators/** - Initial logic as new transactions are received. Used to override input data, block requests, or add additional logic before the action begins initial processing.
- **upgrades/** - You have to run an upgrade when you add or remove logic and nodes are already running different logic. This is where you put the upgrade information and state migrations.
- **ante.go** - The decorators for the entire network, wired together.
- **app.go** - The entire application connected and given access to the cosmos-sdk. The brain of the program.
- **upgrades.go** - Registers the upgrades/ folder logic when one is pending processing.

### chains/

The chains/ directory is where the local and public testnet configuration files are placed. Reference the [testnets](#testnets) section for more information

### cmd/

The cmd/ directory is the entry point for the wiring connections and is where the main.go file is located. This is where the application is started and the chain is initialized when you run the binary. By default, `simd` is the binary name and is saved to your $GOPATH (/home/user/go/bin/).

### explorer/

If you enabled the explorer in the feature selection, this is where the [ping.pub](https://ping.pub/) explorer files are located. When running a testnet with `make sh-testnet` or `make testnet`, you can launch the explorer along side the chain to view activity in real time. Blocks, transactions, uptime, connections, and more are all viewable. Easily launch it with the `docker compose up` command in the root of the directory.

### interchaintest/

Interchaintest is a generalized integration test environment for the Interchain and beyond. It supports Cosmos, Ethereum, UTXO (Bitcoin), and other chain types. By default you will see many test like `ibc_test.go`, `ibc_rate_limit_test.go` and `tokenfactory_test.go` after generation. Any features you select are placed here automatically to confirm your network is working as expected. This are run with the github action automatically on every code change **or** you can run them manually with `make local-image && make ictest-*`, where the * is the testname *(ictest-ibc, ictest-tokenfactory, etc)*.

### proto/

[Proto, also called protocol buffers](https://protobuf.dev/), are a generalized way to define the structure of data. Discussed this more in the [Modules](#modules) sub section.

### scripts/

Scripts automate some more complex requirements list setting up a fast testnet or generating code on the fly. You should not need to modify anything here until you are more advanced. These are shown in the `make help` command to abstract away complexity.

### chain_metadata.json

A cosmetic file showcasing a format for the network. Fill in the data here once you push to the public so developers can easily see what your network is about. This is required for [ICS consumer networks](./04-learn-spawn/01-consensus-algos.md#create-an-ics-consumer-network). If you do not use ICS, you can delete this file if you wish.

### chain_registry.json & assets

These files are the format needed to upload to [https://cosmos.directory/](https://cosmos.directory/) ([github](https://github.com/cosmos/chain-registry)). Frontends use this data to connect to the network, especially in the [local-interchain testnet tool](#testnets).

## Modules

We're all here to build new logic on top. The SDK calls these modules, or e**x**tensions, x/ for short. To make this easy spawn has a build in generator for a module.

```bash
spawn module new --help
```

```bash
Usage:
spawn module new [name] [flags]

Aliases:
new, c, create

Examples:
spawn module new mymodule [--ibc-module]

Flags:
--ibc-middleware Set the module as an IBC Middleware
--ibc-module Set the module as an IBC Module
```

All you need to have is the name you wish to call it, and if you want standard or an IBC module. IBC enables cross network communication of the logic. This is a powerful feature that allows you to build a network of networks. You can try this out with the [IBC module demo](./02-build-your-application/08-ibc-module.md) demo.

For now, just create a default module called `example`

```bash
spawn module new example
```

```
🎉 New Module 'example' generated!
🏅 Commands:
- $ make proto-gen # convert proto files into code
```

This created a new x/example module and the [proto/](#proto) files in the expected structure. `genesis.proto` contains the data saved and more hardcoded. `query.proto` is how you allow external actors to grab data from the network and `tx.proto` is how you allow external actors to send data to the network. Spawn also connects it to the application if you look through your `app/app.go`.

Learn how to make a new module with the [Name Service](./02-build-your-application/01-nameservice.md) guide.

## Testnets

This uses the [local-interchain](https://github.com/strangelove-ventures/interchaintest/tree/main/local-interchain) format and supports JSON or YAML. By default, 2 IBC network defaults are included. **self-ibc** and **testnet**. Run the testnet with `make testnet` to automatically build, setup, and launch a complex network simply.

Self IBC is really only useful if you are building [IBC Modules](./02-build-your-application/08-ibc-module.md). Follow that guide to see how to use it.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ slug: /install/system-setup
# Overview

:::note Synopsis
Setup your development environment with the essentials to get started building your blockchain.
Setup your development environment with the essentials to get started building the blockchain.
:::


## System Requirements

Before we can install and interact with spawn, you must have the following core tools installed:
Before you can install and interact with spawn, you must have the following core tools installed:
* [`Go 1.22+`](https://go.dev/doc/install)
* [`Docker`](https://docs.docker.com/get-docker/)
* [`Git`](https://git-scm.com/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Name Service"
sidebar_label: "Build A Name Service"
sidebar_label: "Build a Name Service"
sidebar_position: 1
slug: /build/name-service
---
Expand All @@ -24,7 +24,7 @@ Building your first Cosmos-SDK blockchain with Spawn. This tutorial focuses on a

## Generate a New Chain

Let's create a new chain called 'rollchain'. We are going to set defining characteristics such as
Let's create a new chain called 'rollchain'. You are going to set defining characteristics such as
- Which modules to disable from the template *if any*
- Proof of Stake consensus
- Wallet prefix (bech32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ The chain will begin to create (mint) new blocks. You can see the logs of the ne

### Interact Set Name

Using the newly built binary *(rolld from the --bin flag when we created the chain)*, you are going to execute the `set` transaction to your name. In this example we will use "alice". This links account `acc1` address to the desired name in the keeper.
Using the newly built binary *(rolld from the --bin flag when the chain was created)*, you are going to execute the `set` transaction to your name. In this example, use "alice". This links account `acc1` address to the desired name in the keeper.

Then, we resolve this name with the nameservice lookup. `$(rolld keys show acc1 -a)` is a substitute for the acc1's address. You can also use just `roll1hj5fveer5cjtn4wd6wstzugjfdxzl0xpg2te87` here.
Then, resolve this name with the nameservice lookup. `$(rolld keys show acc1 -a)` is a substitute for the acc1's address. You can also use just `roll1hj5fveer5cjtn4wd6wstzugjfdxzl0xpg2te87` here.

```bash
rolld tx nameservice set alice --from=acc1 --yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ make proto-gen

<details>
<summary>Hint #2</summary>
<p>Iterate through the `k.Keeper.NameMapping`, check the Value(). if it matches the name we requested, return that wallet (Key)</p>
<p>Iterate through the `k.Keeper.NameMapping`, check the Value(). if it matches the name requested, return that wallet (Key)</p>
</details>

<details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You just crafted your first blockchain, module, and custom logic with Spawn. You

## What's Next?

Extend the NameService to include IBC support with the [ibc-module](../03-demos/02-ibc-module.md) tutorial.
Extend the NameService to include IBC support with the [ibc-module](./08-ibc-module.md) tutorial.

<!-- TODO: What's next? (further interaction, Go,TS,Python, public testnet with github, frontend, explorer, cosmwasm) -->
<!-- TODO: query via rest api -->
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: "IBC Module"
sidebar_label: "IBC NameService Module"
sidebar_position: 1
slug: /demo/ibc-module
title: "IBC NameService Module"
sidebar_label: "IBC NameService (Part 2)"
sidebar_position: 8
slug: /build/name-service-ibc-module
---

# IBC NameService Module
# IBC Name Service Module

In this section, you will build on top of the Service tutorial to add cross chain functionality. This will allow you to sent a name from another network.
In this section, you will build on top of the Name Service tutorial to add cross chain functionality. This will allow you to sent a name from another network.

## Prerequisites
- [System Setup](../01-setup/01-system-setup.md)
- [Install Spawn](../01-setup/02-install-spawn.md)
- [Build Your Name Service Chain Tutorial](../02-build-your-application/01-nameservice.md)
- [Build Your Name Service Chain Tutorial](./01-nameservice.md)

## Create your chain

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Your First Application",
"label": "Build Your Application",
"position": 2,
"link": null
}
Loading