ГАНИМЕД — блокчейн-платформа с нативными монетами GND (расчётная единица и комиссии) и GANI (управление и голосование), смарт-контрактами на Solidity и стандартом токенов GNDst-1.
Доступны REST API, RPC и WebSocket; консенсус — PoA/PoS.
Документация по запросам: docs/api-requests.md, docs/api.md.
Полная документация
Платформа построена по модульной архитектуре. Уровни: ядро (core) → API → консенсус → VM → токены → интеграция и мониторинг.
| Уровень | Пакет | Назначение |
|---|---|---|
| 1 | core/ |
Блокчейн, State, транзакции, кошельки, контракты |
| 2 | api/ |
REST, RPC, WebSocket |
| 3 | consensus/ |
PoA, PoS, правила выбора |
| 4 | vm/ |
EVM, компиляция, исполнение контрактов |
| 5 | tokens/ |
GND-st1, GND-RWA, native, registry, deployer |
| 6 | integration/, monitoring/, audit/ |
Мосты, оракулы, метрики, аудит |
Основной хост: main-node.gnd-net.com
Базовый URL REST API:
• С портом: http://main-node.gnd-net.com:8182/api/v1 или https://main-node.gnd-net.com:8182/api/v1
• По IP: http://31.128.41.155:8182/api/v1
Важно: Без порта запрос идёт на 80/443; нода слушает 8182 — используйте :8182 в URL или настройте обратный прокси (Nginx).
Формат ответа: { "success": true|false, "data": ..., "error": "текст_или_null", "code": число }
curl -s "http://main-node.gnd-net.com:8182/api/v1/health"
curl -s "http://main-node.gnd-net.com:8182/api/v1/metrics"
curl -s "http://main-node.gnd-net.com:8182/api/v1/metrics/transactions"
curl -s "http://main-node.gnd-net.com:8182/api/v1/metrics/fees"
curl -s "http://main-node.gnd-net.com:8182/api/v1/fees"
curl -s "http://main-node.gnd-net.com:8182/api/v1/alerts"
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/alerts/thresholds" \
-H "Content-Type: application/json" \
-d '{ "block_delay_seconds": 60, "mempool_size": 1000 }'
Создание кошелька — только с валидным X-API-Key.
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/wallet" \
-H "Content-Type: application/json" \
-H "X-API-Key: ВАШ_API_КЛЮЧ"
# Ответ: { "success": true, "data": { "address": "GND...", "publicKey": "0x...", "privateKey": "0x..." } }
# 401 — неверный или отсутствующий X-API-Key
curl -s "http://main-node.gnd-net.com:8182/api/v1/wallet/GND.../balance"
# Ответ: { "success": true, "data": { "address": "...", "balances": [ { "token_address", "balance", "standard", "symbol", "name", "decimals", "is_verified" }, ... ] } }
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/transaction" \
-H "Content-Type: application/json" \
-d '{ "from": "GND...", "to": "GND...", "value": "1000", "fee": "0", "nonce": 0, "type": "transfer", "data": "", "signature": "" }'
# Ответ: { "success": true, "data": "хеш_транзакции" }
curl -s "http://main-node.gnd-net.com:8182/api/v1/transaction/ХЕШ_ТРАНЗАКЦИИ"
GET /api/v1/transaction без хеша возвращает подсказку (400).
curl -s "http://main-node.gnd-net.com:8182/api/v1/transactions"
curl -s "http://main-node.gnd-net.com:8182/api/v1/mempool"
# Ответ: { "success": true, "data": { "size": N, "pending_hashes": [...] } }
curl -s "http://main-node.gnd-net.com:8182/api/v1/transactions/list"
# Ответ: массив транзакций из gnd_db.transactions (для админки)
В data — блок: TxCount, Hash, Height, Timestamp, массив Transactions.
curl -s "http://main-node.gnd-net.com:8182/api/v1/block/latest"
curl -s "http://main-node.gnd-net.com:8182/api/v1/block/0"
curl -s "http://main-node.gnd-net.com:8182/api/v1/block/1"
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/contract" \
-H "Content-Type: application/json" \
-d '{ "from": "GND...", "bytecode": "0x60806040...", "name": "MyToken", "standard": "GND-st1", "owner": "GND...", "gas_limit": 3000000, "nonce": 0, "signature": "" }'
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/contract/compile" \
-H "Content-Type: application/json" \
-d '{ "source": "pragma solidity ^0.8.0; contract C {}", "contract_name": "C" }'
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/contract/analyze" \
-H "Content-Type: application/json" \
-d '{ "bytecode": "0x60806040...", "abi": [...] }'
curl -s "http://main-node.gnd-net.com:8182/api/v1/contract/GNDct..."
curl -s "http://main-node.gnd-net.com:8182/api/v1/contract/GNDct.../state?addresses=addr1,addr2"
curl -s "http://main-node.gnd-net.com:8182/api/v1/contract/GNDct.../view"
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/contract/GNDct.../call" \
-H "Content-Type: application/json" \
-d '{ "data": "0x..." }'
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/contract/GNDct.../send" \
-H "Content-Type: application/json" \
-d '{ "from": "GND...", "data": "0x...", "value": "0", "gas_limit": 200000 }'
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/token/deploy" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{ "name": "Test Token", "symbol": "TST", "decimals": 18, "total_supply": "1000000000000000000000000", "owner": "GND...", "standard": "GND-st1" }'
# 401 — неверный X-API-Key; 503 — сервис деплоя недоступен
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/token/logo/upload" \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@logo.png" \
-F "token_id=123"
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/token/transfer" \
-H "Content-Type: application/json" \
-d '{ "token_address": "GNDct...", "from": "GND...", "to": "GND...", "amount": "1000000" }'
# Для нативных монет: "symbol": "GND" или "GANI", token_address — пусто
curl -s -X POST "http://main-node.gnd-net.com:8182/api/v1/token/approve" \
-H "Content-Type: application/json" \
-d '{ "token_address": "GNDct...", "owner": "GND...", "spender": "GND...", "amount": "500000" }'
curl -s "http://main-node.gnd-net.com:8182/api/v1/token/GNDct.../balance/GND..."
curl -s "http://main-node.gnd-net.com:8182/api/v1/coin/GND/balance/GND..."
curl -s "http://main-node.gnd-net.com:8182/api/v1/coin/GANI/balance/GND..."
curl -s "http://main-node.gnd-net.com:8182/api/v1/coin/GND/supply"
curl -s "http://main-node.gnd-net.com:8182/api/v1/coin/GANI/supply"
curl -s "http://main-node.gnd-net.com:8182/api/v1/state/account/GND..."
# Ответ: { "success": true, "data": { "address", "nonce", "balance_gnd", "storage_root" } }
curl -s "http://main-node.gnd-net.com:8182/api/v1/state/account/GND.../block/123"
# Ответ: { "success": true, "data": { "block_id", "address", "nonce", "balance_gnd", "storage_root" } }
curl -s "http://main-node.gnd-net.com:8182/api/v1/state/contract/GNDct.../storage?block_id=123"
# Ответ: { "success": true, "data": { "address", "block_id", "slots": [ { "slot_key", "slot_value" } ] } }
JSON-RPC 2.0. Базовый URL: http://main-node.gnd-net.com:8181
| Путь | Метод | Назначение |
|---|---|---|
/block/latest |
GET | Последний блок |
/block/by-number |
POST | Блок по номеру |
/contract/deploy |
POST | Деплой контракта |
/contract/call |
POST | Вызов view (без TX) |
/contract/send |
POST | Вызов write (создание TX) |
/account/balance |
POST | Баланс аккаунта |
/tx/send |
POST | Отправка транзакции |
/tx/status |
POST | Статус транзакции |
/token/universal-call |
POST | Универсальный вызов токена |
Подключение: wss://main-node.gnd-net.com:8183/ws. Подписки на блоки и транзакции. Аутентификация по X-API-Key.
| Сервис | Порт | Путь / назначение |
|---|---|---|
| REST API | 8182 |
/api/v1/* |
| RPC | 8181 |
/block/latest, /tx/send и др. |
| WebSocket | 8183 |
/ws |
Без прокси используйте порт в URL: http://main-node.gnd-net.com:8182/api/v1/health.
created_at — создание блока, updated_at — финализация.block_id, tx_id — блок и транзакция создания.timestamp — время включения в блок; contract_id — связь с контрактом (для вызовов/деплоя), для переводов — null.docs/consensus.md, docs/database.md.Публичные эндпоинты. Запуск: go test ./api/... -run TestDocURLs -v
| Группа | URL | Ожидаемый ответ |
|---|---|---|
| Здоровье и метрики | GET /api/v1/health, /metrics, /metrics/transactions, /metrics/fees, /fees, /alerts |
200, success: true, при необходимости data |
| Кошелёк | GET /api/v1/wallet/:address/balance |
200, data: { address, balances[] } |
| Транзакции | GET /api/v1/transaction (без хеша) |
400, подсказка |
GET /api/v1/transactions, GET /api/v1/mempool |
200, data: { size, pending_hashes } |
|
| Блоки | GET /api/v1/block/latest, /block/0, /block/1 |
200 с блоком в data или 500 при недоступной БД |
| Контракт | GET /api/v1/contract/:address, /contract/:address/view |
200 (найден), 404 или 500 |
| Токен / монета | GET /api/v1/token/:address/balance/:owner, GET /api/v1/coin/:symbol/balance/:owner |
200 с балансом или 404/500 |
| Состояние | GET /api/v1/state/account/:address, GET /api/v1/state/contract/:address/storage?block_id=N |
200 с данными или 404 |