Skip to content

Commit

Permalink
docs: setup of docusaurus and some initial docs (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba authored Aug 30, 2024
1 parent c58e453 commit ef5ecf1
Show file tree
Hide file tree
Showing 35 changed files with 16,866 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Instead, it allows a chain's validators to attest to the state of the counterpar
This enables any chain to connect with IBC, as long as it can implement the IBC protocol (e.g. smart contracts),
and the validators using Interchain Attestation are attesting to the state of the counterparty IBC implementation.

![Attestion enables IBC.png](docs/images/Attestion%20enables%20IBC.png)
![Attestion enables IBC.png](docs/static/img/attestation-enables-ibc.png)

Interchain Attestion is based on using validators with existing economic security to attest to the state of the counterparty chain.
We move the security assumption over to the receiving validator set (e.g. Cosmos Hub/Osmosis/whatever), away from the one we can't trust (like a single sequencer).
Expand All @@ -46,7 +46,7 @@ so Interchain Attestation also has a config module that allows for configurable

The architecture is using a combination of a sidecar process, ABCI++ Vote Extensions, and a light client to enable the attestation process.

![High level architecture.png](docs/images/High%20level%20architecture.png)
![High level architecture.png](docs/static/img/architecture.png)

A talk about the project can be found here: https://www.youtube.com/watch?v=loNyUjSgR8M

Expand Down
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](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')],
};
30 changes: 30 additions & 0 deletions docs/docs/architecture/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_position: 2
---

# Architecture

Interchain Attestation is composed of a few different components that work together to let validators safely attest to the state of a counterparty chain.
The main components, in "chronological order" are:
* Attestation Config Module
* Validators register their signing keys
* Chains/clients are registered for attestation with configuration details
* Attestation Sidecar
* Validators run a sidecar that reads counterparty chain information, and generates signed attestations
* The sidecar also hosts a GRPC server that can be queried for attestations (used by the chain node to fetch attestations during vote extensions)
* Vote Extensions
* Uses the ABCI++ interface with vote extensions to fetch attestations from the sidecar
* Attestations are aggregated from all the validators, and sent to the light client for verification and client updates
* Attestation Light Client
* The IBC light client that uses the attestation data to enable IBC connections
* The light client verifies the attestations and updates the client state and consensus state with packet commitments
* Testing
* In addition there are some development tools used to test the system: interchaintest and some simapps integrated with the above components

![architecture.png](../../static/img/architecture.png)

## Flow

TODO: Add a diagram


7 changes: 7 additions & 0 deletions docs/docs/architecture/attestation-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_position: 5
---

# Attestation Data

TODO: Document the attestation data format and how it is used in the system.
17 changes: 17 additions & 0 deletions docs/docs/architecture/configmodule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sidebar_position: 1
---

# Attestation Config Module

The Attestation Config Module is a Cosmos SDK module that allows for configurable security requirements for the Interchain Attestation system.

It has the following responsibilities:
* Registering and keeping track of validator attestation signing keys
* Registering and keeping track of chains/clients that are registered for attestation with configuration details
* Providing the light client with the data and integration points to the chain it needs:
* Validator signing keys
* Validating required security backing of an attestation (i.e. is there enough voting power behind the attestation)
* Any chain native capabilities like slashing or incentives

TODO: Add illustration with actors and interactions
25 changes: 25 additions & 0 deletions docs/docs/architecture/light-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
sidebar_position: 4
---

# Attestation Light Client

The Attestation Light Client is an ibc-go light client implementation that uses attestation data to verify validator consensus
and update the client state and consensus state with packet commitments and header information.

TODO: Briefly explain the light client interface from ibc-go and how it works (including consensus state)

TODO: Explain packet commitments

TODO: Add illustration

## Consensus State

TODO: Document how packet commitments and stuff are stored in the consensus state.

## Verify Membership

The light client uses packet commitments that it receiver in the attestation data to verify that the packet was included in the chain.

## Verify non-membership

34 changes: 34 additions & 0 deletions docs/docs/architecture/sidecar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
sidebar_position: 2
---

# Attestation Sidecar

The Attestation Sidecar is a process that runs alongside a chain node, and is responsible for generating and serving attestations to the chain node.
The sidecar is used by the chain node to fetch attestations during vote extensions.

The sidecar is configured by the validator to connect to counterparty chains and will run in the background to continuously fetch and generate attestations.

The sidecar is implemented as a CLI binary that can perform multiple tasks, such as setting up signing keys, creating validator registration files, and starting the attestation process.

In addition, the sidecar also enables relaying of IBC packets (exact capabilities TBD).

The Attestation Sidecar is responsible for the following:
* Fetching attestation data from the counterparty chain
* Packet commitments
* Header information
* Signing attestations
* Serving attestations to the chain node via a GRPC server

## Configuration

TODO: Document the configuration (or should it be under a separate "usage" section of some kind?)

## Relaying

Currently, the sidecar has only one-off commands for creating clients, connections and channels, but the plan is to enable the sidecar to relay IBC packets
as part of its running process.

## CLI

TODO: Document the commands
14 changes: 14 additions & 0 deletions docs/docs/architecture/vote-extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
sidebar_position: 3
---

# Vote Extensions

ABCI++ is a CometBFT interface that allows a chain to add more functionality to the low-level parts of their application.
In particular, for our purposes, it allows validators to communicate with each other to aggregate potentially disparate information
and come to consensus on an aggregate value. To read more about ABCI++, please refer to the official documentation [here](https://docs.cometbft.com/v0.38/spec/abci/).

In the context of Interchain Attestation, we use the ABCI++ interface to fetch attestations from the sidecar,
aggregate them, and send them to the light client for verification and client updates.

TODO: Add illustration with all the different callbacks
7 changes: 7 additions & 0 deletions docs/docs/developing/developing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_position: 5
---

# Developing

TODO: Document how to set up a development environment, how to run tests, etc.
7 changes: 7 additions & 0 deletions docs/docs/developing/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_position: 1
---

# Testing

TODO: Document the test setup, how to run them, etc
7 changes: 7 additions & 0 deletions docs/docs/integration-manual/integration-manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
sidebar_position: 3
---

# Integration Manual

TODO: Document how to integrate with a chain, how to register chains etc.
15 changes: 15 additions & 0 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
sidebar_position: 1
---

# Introduction

Interchain Attestation is a project to enable IBC everywhere. In particular, IBC for chains that can't/don't have a
light client implementation that can be used with IBC. It enables IBC for any chain that can implement IBC, and
let another chain safely validate it (for instance by running a full node). This then includes optimistic rollups,
Ethereum, Solana, and more.

The system enables any chain to connect with IBC, as long as it can implement the IBC protocol (e.g. smart contracts),
and the validators using Interchain Attestation are attesting to the state of the counterparty IBC implementation.

![Attestation enables IBC](../static/img/attestation-enables-ibc.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
sidebar_position: 4
---

# Validator Operator Manual

TODO: Document all the things the validators can and should do to operate the system.
Including documentation on how to set up the sidecar, how to register validators, full nodes, etc.
104 changes: 104 additions & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Interchain Attestation',
tagline: 'IBC. EVERYWHERE.',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://interchain-attestation.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'cosmos', // Usually your GitHub org/user name.
projectName: 'interchain-attestation', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: './sidebars.js',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: {
showReadingTime: true,
feedOptions: {
type: ['rss', 'atom'],
xslt: true,
},
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
// Useful options to enforce blogging best practices
onInlineTags: 'warn',
onInlineAuthors: 'warn',
onUntruncatedBlogPosts: 'warn',
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/social-card.png',
navbar: {
title: 'Interchain Attestation',
logo: {
alt: 'Interchain Attestation Logo',
src: 'img/logo.svg',
srcDark: 'img/logo light.svg'
},
items: [
{
type: 'docSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: 'Docs',
},
{
href: 'https://github.com/cosmos/interchain-attestation',
label: 'GitHub',
position: 'right',
},
],
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};

export default config;
Loading

0 comments on commit ef5ecf1

Please sign in to comment.