Skip to content

Commit

Permalink
docs: move capability modules's readme to docs (#4519)
Browse files Browse the repository at this point in the history
* move capability readme to docs

* Update docs/ibc/capability-module.md

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

---------

Co-authored-by: Damian Nolan <damiannolan@gmail.com>
  • Loading branch information
crodriguezvega and damiannolan authored Aug 31, 2023
1 parent 5d59062 commit 4619053
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
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)`

0 comments on commit 4619053

Please sign in to comment.