Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce docs website #759

Merged
merged 44 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4b28920
init docusaurus repo
MSalopek Mar 1, 2023
46b66c9
unify theme with cosmos-sdk docs
MSalopek Mar 2, 2023
df2877c
update config
MSalopek Mar 3, 2023
6c345fe
add FAQ sections
MSalopek Mar 3, 2023
ee1fe3d
terms
shaspitz Mar 6, 2023
afb4e29
Create overview.md
shaspitz Mar 7, 2023
f09cd87
consumer dev folder
shaspitz Mar 7, 2023
014df70
smol
shaspitz Mar 7, 2023
8b5685c
Create technical-specification.md
shaspitz Mar 7, 2023
f1b1f60
Merge branch 'main' into meta/docs
shaspitz Mar 7, 2023
6540c0a
add new stuff
MSalopek Mar 8, 2023
b11fb69
Merge branch 'main' into meta/docs
MSalopek Mar 14, 2023
22d11a1
add key assignment documentation
MSalopek Mar 14, 2023
cca4360
fix typo
MSalopek Mar 14, 2023
fcc9efa
add clarification
MSalopek Mar 14, 2023
e66ae2f
update documentation; add features section; improve overview
MSalopek Mar 15, 2023
956f356
mv website to docs root; mv old readmes to old_docs
MSalopek Mar 16, 2023
22e2743
add doc deployer
MSalopek Mar 16, 2023
46e2fc5
make deployable to github pages
MSalopek Mar 16, 2023
a85b208
add consumer initiated slashing doc page
MSalopek Mar 17, 2023
dd60838
Merge branch 'main' into meta/docs
MSalopek Mar 20, 2023
de5e3ba
sovereign -> standalone
shaspitz Mar 20, 2023
63e36c3
Merge branch 'main' into meta/docs
MSalopek Mar 21, 2023
0aceed3
add validators section
MSalopek Mar 21, 2023
ec7a178
fix typos
MSalopek Mar 21, 2023
7e06690
update small things
MSalopek Mar 21, 2023
e533831
rename validator stuff
MSalopek Mar 22, 2023
aa9c13e
add joining-testnet docs
MSalopek Mar 22, 2023
8955550
add title to joining testnet
MSalopek Mar 22, 2023
4cfa408
minor refactors
MSalopek Mar 22, 2023
1900df7
refactor faq, update testnet guide
MSalopek Mar 22, 2023
0510d96
update footers
MSalopek Mar 22, 2023
b45fe2c
update testnet repo links
MSalopek Mar 22, 2023
f24f74d
Fix typo
p-offtermatt Mar 23, 2023
226906d
Fix typo: you key => your key
p-offtermatt Mar 23, 2023
a19a15e
Fix typo: cosumer => consumer
p-offtermatt Mar 23, 2023
304e64f
update copyright section so docusaurus builds
MSalopek Mar 23, 2023
0fab030
Add . at the end of info boxes
p-offtermatt Mar 23, 2023
1ac096c
Minor grammar change
p-offtermatt Mar 23, 2023
86d071f
Add missing word "the"
p-offtermatt Mar 23, 2023
8aaa3a6
Fix typo
p-offtermatt Mar 23, 2023
1d49313
update broken link for ics-testnets
MSalopek Mar 23, 2023
e0f3aae
Remove duplicated paragraphs
p-offtermatt Mar 23, 2023
ec45af1
Adjust wording
p-offtermatt Mar 23, 2023
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
48 changes: 48 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

name: Deploy docs
# This job builds and deploys documenation to github pages.
# It runs on every push to main with a change in the docs folder.
on:
workflow_dispatch:
push:
branches:
- main
# - "release/**"
paths:
- "docs/**"
# - "x/**/*.md"
- .github/workflows/deploy-docs.yml

permissions:
contents: read

jobs:
build-and-deploy:
permissions:
contents: write # for JamesIves/github-pages-deploy-action to push changes in repo
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
path: "."

- name: Setup Node.js 🔧
uses: actions/setup-node@v3
with:
node-version: "16.x"

# npm install npm should be removed when https://github.com/npm/cli/issues/4942 is fixed
- name: Build 🔧
run: |
npm install -g npm@8.5.5
make build-docs

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
folder: ~/output
single-commit: true
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,11 @@ proto-update-deps:

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps mocks

###############################################################################
### Documentation ###
###############################################################################

build-docs:
@cd docs && ./build.sh

.PHONY: build-docs
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*
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
10 changes: 10 additions & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# This builds docs using docusaurus.
COMMIT=$(git rev-parse HEAD)
echo "building docusaurus main docs"
(git clean -fdx && git reset --hard && git checkout $COMMIT)
npm ci && npm run build
mv build ~/output
echo "done building docusaurus main docs"
# echo $DOCS_DOMAIN > ~/output/CNAME
File renamed without changes.
4 changes: 4 additions & 0 deletions docs/docs/adrs/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "ADRs",
"position": 6
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
sidebar_position: 4
title: ADR Template
---
# ADR {ADR-NUMBER}: {TITLE}

## Changelog
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/consumer-development/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Consumer Guide",
"position": 4
}
32 changes: 32 additions & 0 deletions docs/docs/consumer-development/app-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
sidebar_position: 1
---
# Developing an ICS consumer chain

When developing an ICS consumer chain, besides just focusing on your chain's logic you should aim to allocate time to ensure that your chain is compatible with the ICS protocol.
To help you on your journey, the ICS team has provied multiple examples of a minumum viable consumer chain applications.

## Basic consumer chain

The source code for the example app can be found [here](https://github.com/cosmos/interchain-security/tree/main/app/consumer).

Please note that consumer chains do not implement the staking module - the validator set is replicated from the provider, meaning that the provider and the consumer use the same validator set and their stake on the provider directly determines their stake on the consumer.
At present there is no opt-in mechanism available, so all validators of the provider must also validate on the provider chain.

Your chain should import the consumer module from `x/consumer` and register it in the correct places in your `app.go`.
The `x/consumer` module will allow your chain to communicate with the provider using the ICS protocol. The module handles all IBC communication with the provider, and it is a simple drop-in.
You should not need to manage or override any code from the `x/consumer` module.

## Democracy consumer chain

The source code for the example app can be found [here](https://github.com/cosmos/interchain-security/tree/main/app/consumer-democracy).

This type of consumer chain wraps the basic CosmosSDK `x/distribution`, `x/staking` and `x/governance` modules allowing the consumer chain to perform democratic actions such as participating and voting within the chain's governance system.

This allows the consumer chain to leverage those modules while also using the `x/consumer` module.

With these modules enabled, the consumer chain can mint its own governance tokens, which can then be delegated to prominent community members which are referred to as "representatives" (as opposed to "validators" in standalone chains). The token may have different use cases besides just voting on governance proposals.

## Standalone chain to consumer chain changeover
This feature is being actively worked on. Information will be provided at a later time.

5 changes: 5 additions & 0 deletions docs/docs/consumer-development/consumer-chain-governance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 2
---

# Consumer Chain Governance
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 3
---

# Upgrading Consumer Chains
24 changes: 24 additions & 0 deletions docs/docs/consumer-development/offboarding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_position: 5
title: Offboarding Checklist
---
# Consumer Offboarding

To offboard a consumer chain simply submit a `ConsumerRemovalProposal` governance proposal listing a `stop_time`. After stop time passes, the provider chain will remove the chain from the ICS protocol (it will stop sending validator set updates).

```js
// ConsumerRemovalProposal is a governance proposal on the provider chain to remove (and stop) a consumer chain.
// If it passes, all the consumer chain's state is removed from the provider chain. The outstanding unbonding
// operation funds are released.
{
// the title of the proposal
"title": "This was a great chain",
"description": "Here is a .md formatted string specifying removal details",
// the chain-id of the consumer chain to be stopped
"chain_id": "consumerchain-1",
// the time on the provider chain at which all validators are responsible to stop their consumer chain validator node
"stop_time": "2023-03-07T12:40:00.000000Z",
}
```

More information will be listed in a future version of this document.
104 changes: 104 additions & 0 deletions docs/docs/consumer-development/onboarding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
sidebar_position: 4
title: Onboarding Checklist
---
# Consumer Onboarding Checklist

The following checklists will aid in onboarding a new consumer chain to replicated security.

Additionally, you can check the [testnet repo](https://github.com/cosmos/testnets/blob/master/replicated-security/CONSUMER_LAUNCH_GUIDE.md) for a comprehensive guide on preparing and launching consumer chains.

## 1. Complete testing & integration

- [ ] test integration with gaia
- [ ] test your protocol with supported relayer versions (minimum hermes 1.3)
- [ ] reach out to the ICS team if you are facing issues

## 2. Create an Onboarding Repository

To help validators and other node runners onboard onto your chain, please prepare a repository with information on how to run your chain.

This should include (at minumum):

- [ ] genesis.json witout CCV data (before the propsal passes)
- [ ] genesis.json with CCV data (after spawn time passes)
- [ ] information about relevant seed/peer nodes you are running
- [ ] relayer information (compatible versions)
- [ ] copy of your governance proposal (as JSON)
- [ ] a script showing how to start your chain and connect to peers (optional)
- [ ] take feedback from other developers, validators and community regarding your onboarding repo and make improvements where applicable

Example of such a repository can be found [here](https://github.com/hyphacoop/ics-testnets/tree/main/game-of-chains-2022/sputnik).

## 3. Submit a Governance Proposal

Before you submit a `ConsumerChainAddition` proposal, please consider allowing at least a day between your proposal passing and the chain spawn time. This will allow the validators, other node operators and the community to prepare for the chain launch.
If possible, please set your spawn time so people from different parts of the globe can be available in case of emergencies. Ideally, you should set your spawn time to be between 12:00 UTC and 20:00 UTC so most validator operators are available and ready to respond to any issues.

Additionally, reach out to the community via the [forum](https://forum.cosmos.network/) to formalize your intention to become an ICS consumer, gather community support and accept feedback from the community, validators and developers.

- [ ] determine your chain's spawn time
- [ ] determine consumer chain parameters to be put in the proposal
- [ ] take note to include a link to your onboarding repository
- [ ] describe the purpose and benefits of running your chain

Example of a consumer chain addition proposal.

```js
// ConsumerAdditionProposal is a governance proposal on the provider chain to spawn a new consumer chain.
// If it passes, then all validators on the provider chain are expected to validate the consumer chain at spawn time.
// It is recommended that spawn time occurs after the proposal end time.
{
// Title of the proposal
"title": "Add consumer chain",
// Description of the proposal
// format the text as a .md file and include the file in your onboarding repository
"description": ".md description of your chain and all other relevant information",
// Proposed chain-id of the new consumer chain.
// Must be unique from all other consumer chain ids of the executing provider chain.
"chain_id": "newchain-1",
// Initial height of new consumer chain.
// For a completely new chain, this will be {0,1}.
"initial_height" : {
"revision_height": 0,
"revision_number": 1,
},
// Hash of the consumer chain genesis state without the consumer CCV module genesis params.
// It is used for off-chain confirmation of genesis.json validity by validators and other parties.
"genesis_hash": "d86d756e10118e66e6805e9cc476949da2e750098fcc7634fd0cc77f57a0b2b0",
// Hash of the consumer chain binary that should be run by validators on chain initialization.
// It is used for off-chain confirmation of binary validity by validators and other parties.
"binary_hash": "376cdbd3a222a3d5c730c9637454cd4dd925e2f9e2e0d0f3702fc922928583f1",
// Time on the provider chain at which the consumer chain genesis is finalized and all validators
// will be responsible for starting their consumer chain validator node.
"spawn_time": "2023-02-28T20:40:00.000000Z",
// Unbonding period for the consumer chain.
// It should should be smaller than that of the provider.
"unbonding_period": 86400000000000,
// Timeout period for CCV related IBC packets.
// Packets are considered timed-out after this interval elapses.
"ccv_timeout_period": 259200000000000,
// IBC transfer packets will timeout after this interval elapses.
"transfer_timeout_period": 1800000000000,
// The fraction of tokens allocated to the consumer redistribution address during distribution events.
// The fraction is a string representing a decimal number. For example "0.75" would represent 75%.
// The reward amount distributed to the provider is calculated as: 1 - consumer_redistribution_fraction.
"consumer_redistribution_fraction": "0.75",
// BlocksPerDistributionTransmission is the number of blocks between IBC token transfers from the consumer chain to the provider chain.
// eg. send rewards to the provider every 1000 blocks
"blocks_per_distribution_transmission": 1000,
// The number of historical info entries to persist in store.
// This param is a part of the cosmos sdk staking module. In the case of
// a ccv enabled consumer chain, the ccv module acts as the staking module.
"historical_entries": 10000,
}
```

## 4. Launch

The consumer chain starts after at least 66.67% of all provider's voting power comes online. The consumer chain is considered interchain secured once the appropriate CCV channels are established and the first validator set update is propagated from the provider to the consumer

- [ ] provide a repo with onboarding instructions for validators (it should already be listed in the proposal)
- [ ] genesis.json with ccv data populated (MUST contain the initial validator set)
- [ ] maintenance & emergency contact info (relevant discord, telegram, slack or other communication channels)
- [ ] have a block explorer in place to track chain activity & health
4 changes: 4 additions & 0 deletions docs/docs/features/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Features",
"position": 3
}
Loading