|
1 | | -# Cosmos Documentation System |
| 1 | +# Cosmos Documentation Hub |
2 | 2 |
|
3 | | -A comprehensive documentation system for Cosmos SDK and Cosmos EVM chains, built with [Mintlify](https://mintlify.com). |
| 3 | +> *A work in progress, striving to unify and provide a single source of truth for all documentation encompassing the broader Cosmos stack.* |
4 | 4 |
|
5 | | -## 🏗️ System Architecture |
| 5 | +## Contributing |
6 | 6 |
|
7 | | -### Landing Page Configuration |
8 | | -- **Default Landing Page**: `docs/index.mdx` serves as the main entry point |
9 | | -- **Navigation Structure**: Fully nested, collapsible sidebar navigation |
10 | | -- **Redirect Setup**: Root URL (`/`) automatically redirects to `/docs/index` |
| 7 | +1. **Fork the repository** |
11 | 8 |
|
12 | | -### Documentation Structure |
| 9 | + - Click “Fork” in the GitHub UI to create your own copy. |
13 | 10 |
|
14 | | -``` |
15 | | -docs/ |
16 | | -├── index.mdx # Main landing page |
17 | | -├── evm/ # EVM documentation |
18 | | -│ ├── index.mdx # EVM overview |
19 | | -│ ├── developers/ # Developer guides |
20 | | -│ │ ├── smart-contracts/ # Contract development |
21 | | -│ │ ├── tooling-and-resources/ # Development tools |
22 | | -│ │ └── precompiles/ # Precompiled contracts |
23 | | -├── api-reference/ # API documentation |
24 | | -│ ├── cosmos-rest/ # REST API endpoints (113 endpoints) |
25 | | -│ │ ├── vm/ # EVM virtual machine |
26 | | -│ │ ├── erc20/ # ERC20 token module |
27 | | -│ │ ├── feemarket/ # Fee market management |
28 | | -│ │ ├── precisebank/ # Precise banking |
29 | | -│ │ └── [29 other modules] # Core Cosmos SDK modules |
30 | | -│ └── evm-jsonrpc/ # EVM JSON-RPC API |
31 | | -│ ├── index.mdx # Complete JSON-RPC reference |
32 | | -│ └── eth/ # Ethereum-compatible methods |
33 | | -└── api-specs/ # OpenAPI specifications |
34 | | - ├── cosmos-sdk-complete.json # Complete REST API spec (155KB) |
35 | | - └── cosmos-evm-jsonrpc.json # EVM JSON-RPC spec (6KB) |
36 | | -``` |
37 | | - |
38 | | -## 🚀 Quick Start |
39 | | - |
40 | | -### Development Server |
| 11 | +3. **Clone your fork** |
| 12 | + |
41 | 13 | ```bash |
42 | | -npx mintlify dev |
43 | | -``` |
| 14 | + git clone https://github.com/<your-username>/cosmos-docs.git |
| 15 | + cd cosmos-docs |
| 16 | +```` |
44 | 17 |
|
45 | | -### Production Build |
46 | | -```bash |
47 | | -npx mintlify build |
48 | | -``` |
| 18 | +3. **Create a branch** |
49 | 19 |
|
50 | | -### Service Management |
51 | 20 | ```bash |
52 | | -# Start documentation service |
53 | | -systemctl start mint-docs |
54 | | - |
55 | | -# Restart after changes |
56 | | -systemctl restart mint-docs |
57 | | - |
58 | | -# Check status |
59 | | -systemctl status mint-docs |
60 | | -``` |
61 | | - |
62 | | -## 📊 API Coverage |
63 | | - |
64 | | -### REST API (113 Endpoints) |
65 | | -- **Core Modules**: 29 Cosmos SDK modules |
66 | | -- **EVM Modules**: 4 specialized modules (vm, feemarket, erc20, precisebank) |
67 | | -- **Interactive Documentation**: Full Mintlify integration with code samples |
68 | | -- **Source**: Generated from `cosmos/evm` repository protobuf definitions |
69 | | - |
70 | | -### JSON-RPC API |
71 | | -- **Ethereum Compatibility**: Full Ethereum JSON-RPC specification |
72 | | -- **Method Categories**: eth, net, web3, debug, txpool namespaces |
73 | | -- **WebSocket Support**: Real-time subscriptions (eth_subscribe/unsubscribe) |
74 | | -- **Development Tools**: MetaMask, Hardhat, Foundry compatibility |
75 | | - |
76 | | -## 🔧 Maintenance Workflows |
77 | | - |
78 | | -### Update REST API Documentation |
79 | | - |
80 | | -1. **Sync Protocol Buffers**: |
81 | | - ```bash |
82 | | - ./scripts/sync-protos.sh |
83 | | - ``` |
84 | | - |
85 | | -2. **Generate OpenAPI Specifications**: |
86 | | - ```bash |
87 | | - python scripts/generate-openapi-specs.py |
88 | | - ``` |
89 | | - |
90 | | -3. **Generate Interactive Documentation**: |
91 | | - ```bash |
92 | | - npx @mintlify/scraping@latest openapi-file docs/api-specs/cosmos-sdk-complete.json -o docs/api-reference/cosmos-rest |
93 | | - ``` |
94 | | - |
95 | | -4. **Update Navigation** (automatic via Mintlify scraper output) |
96 | | - |
97 | | -### Update EVM JSON-RPC Documentation |
98 | | - |
99 | | -1. **Extract Methods**: |
100 | | - ```bash |
101 | | - python scripts/extract-jsonrpc-methods.py |
102 | | - ``` |
103 | | - |
104 | | -2. **Generate Documentation**: |
105 | | - ```bash |
106 | | - npx @mintlify/scraping@latest openapi-file docs/api-specs/cosmos-evm-jsonrpc.json -o docs/api-reference/evm-jsonrpc |
107 | | - ``` |
108 | | - |
109 | | -### Configuration Management |
110 | | - |
111 | | -- **docs.json**: Main configuration with nested navigation |
112 | | -- **Landing page**: Automatic redirect from root to `/docs/index` |
113 | | -- **API Integration**: OpenAPI specs with multiple server endpoints |
114 | | -- **Environment**: Python virtual environments for generation scripts |
115 | | - |
116 | | -## 🎨 Customization |
117 | | - |
118 | | -### Theme Configuration |
119 | | -```json |
120 | | -{ |
121 | | - "theme": "palm", |
122 | | - "colors": { |
123 | | - "primary": "#4B47CA", |
124 | | - "light": "#39A6A3", |
125 | | - "dark": "#22E2A8" |
126 | | - } |
127 | | -} |
| 21 | + git checkout -b my-feature |
128 | 22 | ``` |
129 | 23 |
|
130 | | -### Navigation Features |
131 | | -- **Collapsible Groups**: All directory structures are collapsible |
132 | | -- **Icon Integration**: Lucide icon library |
133 | | -- **External Links**: GitHub, Discord, Blog integration |
134 | | -- **Search**: Contextual search with custom prompts |
| 24 | +4. **Make your changes** |
135 | 25 |
|
136 | | -### API Integration |
137 | | -- **Multiple Servers**: Mainnet, testnet, local development |
138 | | -- **Authentication**: Support for various auth methods |
139 | | -- **Code Examples**: Multi-language code samples |
140 | | -- **Interactive Playground**: Test API endpoints directly |
| 26 | + * Edit or add files under `docs/` as needed. |
| 27 | + * Follow existing file structure and naming conventions. |
| 28 | + * Ensure Markdown is valid and links resolve. |
141 | 29 |
|
142 | | -## 🛠️ Development Tools |
| 30 | +5. **Local testing & validation** |
143 | 31 |
|
144 | | -### Dependencies |
145 | 32 | ```bash |
146 | | -# Python dependencies for generators |
147 | | -pip install pyyaml requests protobuf |
148 | | - |
149 | | -# Node.js dependencies |
150 | | -npm install -g @mintlify/scraping |
151 | | -``` |
152 | | - |
153 | | -### File Generation |
154 | | -- **Protobuf Sync**: Automated repository synchronization |
155 | | -- **OpenAPI Generation**: Python-based spec generation |
156 | | -- **Documentation Scraping**: Mintlify automatic page generation |
157 | | -- **Navigation Updates**: Automated hierarchy creation |
158 | | - |
159 | | -### Quality Assurance |
160 | | -- **JSON Validation**: Automatic syntax checking |
161 | | -- **Path Verification**: File existence validation |
162 | | -- **Link Checking**: Navigation integrity |
163 | | -- **Content Validation**: Mintlify parsing verification |
164 | | - |
165 | | -## 📈 Performance & Optimization |
166 | | - |
167 | | -### Generated Assets |
168 | | -- **REST API Spec**: 155KB optimized OpenAPI 3.0 |
169 | | -- **JSON-RPC Spec**: 6KB focused specification |
170 | | -- **Interactive Pages**: 113 REST + 2 JSON-RPC endpoints |
171 | | -- **Navigation Tree**: Fully nested, performant structure |
172 | | - |
173 | | -### Caching Strategy |
174 | | -- **Static Assets**: Long-term caching |
175 | | -- **API Responses**: Contextual caching |
176 | | -- **Build Optimization**: Incremental updates |
177 | | -- **CDN Integration**: Global content delivery |
178 | | - |
179 | | -## 🔍 Troubleshooting |
180 | | - |
181 | | -### Common Issues |
| 33 | + # Start a live-reload preview |
| 34 | + npx mint dev |
182 | 35 |
|
183 | | -1. **Missing File Warnings**: |
184 | | - ```bash |
185 | | - # Check for old navigation references |
186 | | - grep -r "docs/api-reference" docs.json |
| 36 | + # Check for broken internal links |
| 37 | + npx mint broken-links |
187 | 38 |
|
188 | | - # Verify file existence |
189 | | - find docs/api-reference -name "*.mdx" | sort |
190 | | - ``` |
191 | | - |
192 | | -2. **JSON Syntax Errors**: |
193 | | - ```bash |
194 | | - python3 -m json.tool docs.json |
195 | | - ``` |
196 | | - |
197 | | -3. **Mintlify Parsing Errors**: |
198 | | - ```bash |
199 | | - # Check for invalid React components |
200 | | - grep -r "import React" docs/ |
201 | | - |
202 | | - # Validate OpenAPI specs |
203 | | - npx swagger-codegen-cli validate -i docs/api-specs/cosmos-sdk-complete.json |
204 | | - ``` |
205 | | - |
206 | | -4. **Service Issues**: |
207 | | - ```bash |
208 | | - # Check service logs |
209 | | - systemctl status mint-docs |
210 | | - journalctl -u mint-docs -f |
211 | | - ``` |
212 | | - |
213 | | -### File Structure Validation |
214 | | -```bash |
215 | | -# Verify all navigation references exist |
216 | | -python3 -c " |
217 | | -import json |
218 | | -import os |
219 | | -with open('docs.json') as f: |
220 | | - config = json.load(f) |
221 | | -# Add validation logic here |
222 | | -" |
| 39 | + # Validate OpenAPI specs (if applicable) |
| 40 | + npx mint openapi-check path/to/openapi.yaml |
223 | 41 | ``` |
224 | 42 |
|
225 | | -## 🌐 Deployment |
| 43 | + *Source: [Mintlify CLI docs](https://mintlify.com/docs)* |
| 44 | +6. **Commit and push** |
226 | 45 |
|
227 | | -### Production Configuration |
228 | | -- **Custom Domain**: Configured via Mintlify dashboard |
229 | | -- **SSL/TLS**: Automatic certificate management |
230 | | -- **CDN**: Global content distribution |
231 | | -- **Analytics**: Integrated tracking and monitoring |
232 | | - |
233 | | -### Environment Variables |
234 | 46 | ```bash |
235 | | -# API endpoints |
236 | | -COSMOS_REST_URL=https://rest.cosmos.network |
237 | | -COSMOS_TESTNET_REST_URL=https://testnet-rest.cosmos.network |
238 | | -EVM_RPC_URL=https://evm-rpc.cosmos.network |
| 47 | + git add . |
| 48 | + git commit -m "Brief description of your change" |
| 49 | + git push origin my-feature |
239 | 50 | ``` |
240 | 51 |
|
241 | | -### Monitoring |
242 | | -- **Build Status**: Automated deployment checks |
243 | | -- **Performance**: Page load monitoring |
244 | | -- **API Availability**: Endpoint health checks |
245 | | -- **User Analytics**: Documentation usage metrics |
246 | | - |
247 | | -## 📚 Resources |
248 | | - |
249 | | -- **Mintlify Documentation**: https://mintlify.com/docs |
250 | | -- **Cosmos SDK**: https://docs.cosmos.network |
251 | | -- **EVM Module**: https://github.com/cosmos/evm |
252 | | -- **OpenAPI Specification**: https://swagger.io/specification/ |
253 | | - |
254 | | -## 🤝 Contributing |
255 | | - |
256 | | -1. **Setup Development Environment** |
257 | | -2. **Run Quality Checks** |
258 | | -3. **Test Documentation Changes** |
259 | | -4. **Submit Pull Request** |
| 52 | +7. **Open a Pull Request** |
260 | 53 |
|
261 | | -For detailed contribution guidelines, see our development workflow above. |
| 54 | + * On GitHub, navigate to your fork. |
| 55 | + * Click “Compare & pull request.” |
| 56 | + * Provide a concise title and description. |
| 57 | + * Submit the PR for review. |
262 | 58 |
|
263 | | ---- |
264 | 59 |
|
265 | | -**Last Updated**: June 2025 |
266 | | -**Documentation Version**: 1.0.0 |
267 | | -**API Coverage**: 113 REST endpoints + Full JSON-RPC compatibility |
0 commit comments