| location | backend | назначение |
|---|---|---|
/api/ |
127.0.0.1:8182 |
REST API (/api/v1/health, /api/v1/wallet/...,
/api/v1/mempool и т.д.)
|
/rpc/ |
127.0.0.1:8181 |
RPC (JSON-RPC), запросы приходят как в корень бэкенда благодаря rewrite
|
/ws |
127.0.0.1:8183 |
WebSocket для ноды |
Через Nginx main-node.gnd-net.com:
/api/ → REST,
/rpc/ → JSON-RPC,
/ws → WebSocket.
Базовый URL REST API: https://main-node.gnd-net.com/api/v1 или
http://31.128.41.155:8182/api/v1.
Формат ответа: { "success": true|false, "data": ..., "error": "текст", "code": число }.
# Проверка работы API
curl -s "https://main-node.gnd-net.com/api/v1/health"
# Метрики
curl -s "https://main-node.gnd-net.com/api/v1/metrics"
curl -s "https://main-node.gnd-net.com/api/v1/metrics/transactions"
curl -s "https://main-node.gnd-net.com/api/v1/metrics/fees"
# Алерты
curl -s "https://main-node.gnd-net.com/api/v1/alerts"
curl -s -X POST "https://main-node.gnd-net.com/api/v1/wallet" \
-H "Content-Type: application/json"
# Ответ:
# {
# "success": true,
# "data": {
# "address": "GND...",
# "publicKey": "0x...",
# "privateKey": "0x..."
# }
# }
curl -s "https://main-node.gnd-net.com/api/v1/wallet/GND9jbK6Vca5VcZxATt3zb9yz5KQeMwjHFrz/balance"
# Ответ:
# {
# "success": true,
# "data": {
# "address": "GND...",
# "balance": "1000000"
# }
# }
curl -s -X POST "https://main-node.gnd-net.com/api/v1/transaction" \
-H "Content-Type: application/json" \
-d '{
"from": "GND9jbK6Vca5VcZxATt3zb9yz5KQeMwjHFrz",
"to": "GND9LZxRfX64SfxTFDis68wvoNkrYa3ZVtg4",
"value": "1000",
"fee": "0",
"nonce": 0,
"type": "transfer",
"data": "",
"signature": ""
}'
# Ответ:
# {
# "success": true,
# "data": "хеш_транзакции"
# }
curl -s "https://main-node.gnd-net.com/api/v1/transaction/abc123..."
curl -s "https://main-node.gnd-net.com/api/v1/mempool"
# Ответ:
# {
# "success": true,
# "data": {
# "size": 0,
# "pending_hashes": []
# }
# }
curl -s "https://main-node.gnd-net.com/api/v1/block/latest"
curl -s "https://main-node.gnd-net.com/api/v1/block/0"
curl -s "https://main-node.gnd-net.com/api/v1/block/1"
curl -s -X POST "https://main-node.gnd-net.com/api/v1/contract" \
-H "Content-Type: application/json" \
-d '{
"from": "GND...",
"bytecode": "0x60806040...",
"name": "MyToken",
"standard": "GND-st1",
"owner": "GND...",
"compiler": "solc 0.8",
"version": "1.0",
"params": {},
"description": "",
"metadata_cid": "",
"source_code": "",
"gas_limit": 3000000,
"gas_price": "0",
"nonce": 0,
"signature": "",
"total_supply": "0"
}'
curl -s "https://main-node.gnd-net.com/api/v1/contract/GND..."
curl -s -X POST "https://main-node.gnd-net.com/api/v1/token/transfer" \
-H "Content-Type: application/json" \
-d '{
"token_address": "GND_контракт_токена",
"from": "GND...",
"to": "GND...",
"amount": "1000000"
}'
curl -s -X POST "https://main-node.gnd-net.com/api/v1/token/approve" \
-H "Content-Type: application/json" \
-d '{
"token_address": "GND_контракт_токена",
"owner": "GND...",
"spender": "GND...",
"amount": "500000"
}'
curl -s "https://main-node.gnd-net.com/api/v1/token/GND_контракт_токена/balance/GND_адрес_владельца"
| Сервис | Порт | Путь / назначение |
|---|---|---|
| REST API | 8182 |
/api/v1/* |
| RPC | 8181 |
/block/latest, /tx/send и др. |
| WebSocket | 8183 |
/ws |
Через Nginx main-node.gnd-net.com:
https://main-node.gnd-net.com/api/ → REST
(proxy_pass, например, на http://127.0.0.1:8182/).