-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from cardano-scaling/observer-backend
Observer API backend
- Loading branch information
Showing
23 changed files
with
1,424 additions
and
945 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
As a minor extension, we also keep a semantic version for the `UNRELEASED` | ||
changes. | ||
|
||
## [1.0.0] - UNRELEASED | ||
|
||
- Create a [client](api/client-api.yaml) and [observer](api/observer-api.yaml) API specification. | ||
|
||
- Listen for observations on the observer API and aggregate them into the client API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
openapi: 3.0.3 | ||
|
||
info: | ||
title: Hydra Explorer - Observer API | ||
version: 1.0.0 | ||
description: |- | ||
API to be used by hydra-chain-observer instances to report observations of Hydra Head transactions to a hydra-explorer instance. | ||
license: | ||
name: Apache 2.0 | ||
url: http://www.apache.org/licenses/LICENSE-2.0.html | ||
|
||
externalDocs: | ||
url: http://hydra.family | ||
description: More information about the Hydra protocol | ||
|
||
servers: | ||
- url: "http://{host}:{port}" | ||
variables: | ||
host: | ||
default: "localhost" | ||
port: | ||
default: "8080" | ||
|
||
paths: | ||
/observations/{network}/{version}: | ||
post: | ||
summary: Submit a new Hydra Head protocol observation from given network and protocol version | ||
operationId: postObservations | ||
parameters: | ||
- in: path | ||
name: network | ||
schema: | ||
oneof: | ||
- title: Mainnet | ||
type: string | ||
enum: ["mainnet"] | ||
- title: Network magic | ||
$ref: "#/components/schemas/NetworkMagic" | ||
required: true | ||
description: | | ||
Cardano network on which the observation was made. Identified by the string "mainnet" or the network magic number. For example 764824073 for mainnet or 1 for preprod. | ||
- in: path | ||
name: version | ||
schema: | ||
$ref: "#/components/schemas/HydraVersion" | ||
required: true | ||
description: Semantic version of the observer, currently corresponding to hydra protocol version. | ||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "#/components/schemas/Observation" | ||
required: true | ||
responses: | ||
"200": | ||
description: Successful reported observation | ||
"400": | ||
description: Invalid observation | ||
|
||
components: | ||
schemas: | ||
NetworkMagic: | ||
$ref: "https://raw.githubusercontent.com/CardanoSolutions/cardanonical/refs/heads/main/cardano.json#definitions/NetworkMagic" | ||
HydraVersion: | ||
$ref: "https://raw.githubusercontent.com/cardano-scaling/hydra/master/hydra-node/json-schemas/common.yaml#definitions/HydraVersion" | ||
Observation: | ||
type: object | ||
properties: | ||
point: | ||
$ref: "https://raw.githubusercontent.com/cardano-scaling/hydra/master/hydra-node/json-schemas/common.yaml#definitions/ChainPoint" | ||
blockNo: | ||
type: integer | ||
observedTx: | ||
$ref: "https://raw.githubusercontent.com/cardano-scaling/hydra/master/hydra-node/json-schemas/common.yaml#definitions/OnChainTx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.