Files
dejo-node/docs/openapi.yaml
2025-05-23 10:44:32 -03:00

90 lines
2.0 KiB
YAML

openapi: 3.0.3
info:
title: DEJO Node API
description: API REST pública do nó da blockchain DEJO
version: 1.0.0
paths:
/health:
get:
summary: Verifica se o serviço está vivo
responses:
'200':
description: OK
/startup:
get:
summary: Verifica se o serviço foi inicializado
responses:
'200':
description: Serviço iniciado
'503':
description: Inicialização incompleta
/ready:
get:
summary: Verifica se o nó está pronto para receber requisições
responses:
'200':
description: Pronto para uso
'503':
description: Store ou Mempool indisponível
/tx:
post:
summary: Envia uma nova transação para a rede
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
from:
type: string
to:
type: string
value:
type: number
nonce:
type: integer
gas:
type: integer
signature:
type: string
responses:
'200':
description: Transação enviada
/block/{hash}:
get:
summary: Retorna um bloco pelo hash
parameters:
- name: hash
in: path
required: true
schema:
type: string
responses:
'200':
description: Dados do bloco
/tx/{hash}:
get:
summary: Retorna uma transação pelo hash
parameters:
- name: hash
in: path
required: true
schema:
type: string
responses:
'200':
description: Dados da transação
/mempool:
get:
summary: Retorna as transações pendentes
responses:
'200':
description: Lista de transações pendentes