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

docs: move capability modules's readme to docs #4519

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
5 changes: 5 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ module.exports = {
directory: false,
path: "/ibc/proto-docs.html",
},
{
title: "Capability Module",
directory: false,
path: "/ibc/capability-module.html",
},
{
title: "Roadmap",
directory: false,
Expand Down
28 changes: 13 additions & 15 deletions modules/capability/README.md → docs/ibc/capability-module.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
sidebar_position: 1
---
<!--
order: 8
-->

# Capability Module

## Overview

`modules/capability` is an implementation of a Cosmos SDK module, per [ADR 003](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-003-dynamic-capability-store.md),
that allows for provisioning, tracking, and authenticating multi-owner capabilities
at runtime.
`modules/capability` is an implementation of a Cosmos SDK module, per [ADR 003](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-003-dynamic-capability-store.md), that allows for provisioning, tracking, and authenticating multi-owner capabilities at runtime.

The keeper maintains two states: persistent and ephemeral in-memory. The persistent
store maintains a globally unique auto-incrementing index and a mapping from
Expand Down Expand Up @@ -43,7 +41,7 @@ type App struct {
func NewApp(...) *App {
// ...

app.capabilityKeeper = capability.NewKeeper(codec, persistentStoreKey, memStoreKey)
app.capabilityKeeper = capabilitykeeper.NewKeeper(codec, persistentStoreKey, memStoreKey)
}
```

Expand Down Expand Up @@ -110,20 +108,20 @@ not own.

### Stores

* MemStore
* KeyStore
- MemStore
- KeyStore

## State

### In persisted KV store
### Persisted KV store

1. Global unique capability index
2. Capability owners

Indexes:

* Unique index: `[]byte("index") -> []byte(currentGlobalIndex)`
* Capability Index: `[]byte("capability_index") | []byte(index) -> ProtocolBuffer(CapabilityOwners)`
- Unique index: `[]byte("index") -> []byte(currentGlobalIndex)`
- Capability Index: `[]byte("capability_index") | []byte(index) -> ProtocolBuffer(CapabilityOwners)`

### In-memory KV store

Expand All @@ -133,6 +131,6 @@ Indexes:

Indexes:

* Initialized flag: `[]byte("mem_initialized")`
* RevCapabilityKey: `[]byte(moduleName + "/rev/" + capabilityName) -> []byte(index)`
* FwdCapabilityKey: `[]byte(moduleName + "/fwd/" + capabilityPointerAddress) -> []byte(capabilityName)`
- Initialized flag: `[]byte("mem_initialized")`
- RevCapabilityKey: `[]byte(moduleName + "/rev/" + capabilityName) -> []byte(index)`
- FwdCapabilityKey: `[]byte(moduleName + "/fwd/" + capabilityPointerAddress) -> []byte(capabilityName)`