Skip to content

Commit d4a8807

Browse files
authored
Merge branch 'main' into vit-ss-db
2 parents 2d9eb3c + fb723f2 commit d4a8807

File tree

57 files changed

+2167
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2167
-128
lines changed

Cargo.lock

Lines changed: 73 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ members = [
4646
"src/vit-testing/integration-tests",
4747
"src/vit-testing/mainnet-tools",
4848
"src/vit-testing/mainnet-lib",
49+
"src/vit-testing/db-sync-explorer",
4950
"src/vit-testing/snapshot-trigger-service",
5051
"src/vit-testing/signals-handler",
5152
"src/vit-testing/scheduler-service-lib",
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Db Sync Explorer
4+
version: 1.0.0
5+
contact: {url: "https://github.com/input-output-hk/catalyst-core"}
6+
servers:
7+
- url: http://localhost
8+
9+
10+
paths:
11+
/api/v0/sync/behind:
12+
get:
13+
tags: [sync]
14+
summary: Behind Tip
15+
description: Request for fetching information about Db Sync synchronization status. 'Behind' endpoint return date interval object which represent difference between utc::now() and last block time registered in db sync.
16+
operationId: behindTip
17+
responses:
18+
'200':
19+
description: 'On correct response'
20+
content:
21+
application/json:
22+
schema:
23+
$ref: '#/components/schemas/Behind'
24+
example:
25+
- behind_by:
26+
secs_since_epoch: 1669792739,
27+
nanos_since_epoch: 0
28+
'500':
29+
description: 'On internal server error'
30+
/api/v0/meta:
31+
get:
32+
tags: [meta]
33+
summary: Meta information
34+
description: Provides information about meta information of db sync, like version, network and start date
35+
operationId: metaInformation
36+
responses:
37+
'200':
38+
description: 'On correct response'
39+
content:
40+
application/json:
41+
schema:
42+
items:
43+
$ref: "#/components/schemas/Meta"
44+
example:
45+
- id: 1,
46+
start_time:
47+
secs_since_epoch: 1654041600
48+
nanos_since_epoch: 0
49+
network_name: "preprod"
50+
version: "Version {versionBranch = [13,0,5], versionTags = []}"
51+
'500':
52+
description: 'On internal server error'
53+
54+
/api/v0/tx/hash/{hash}:
55+
get:
56+
tags: [tx]
57+
summary: Transaction info by hash
58+
description: Returns information about transaction by given hash. Returns collection of transaction matching given hash. If none transaction is found, returns empty collection.
59+
operationId: transactionInfoByHash
60+
parameters:
61+
- in: path
62+
name: hash
63+
description: valid transaction hash
64+
example: bc692d5a2a6b014b50fc6216e544c6dc08299add60b62a64eb682c53ffedd4c9
65+
schema:
66+
type: string
67+
required: true
68+
responses:
69+
"200":
70+
description: Valid response
71+
content:
72+
application/json:
73+
schema:
74+
items:
75+
$ref: "#/components/schemas/TransactionConfirmation"
76+
example:
77+
- epoch_no: 36
78+
slot_no: 14062141
79+
absolute_slot: 151741
80+
block_no: 338669
81+
82+
/api/v0/sync/progress:
83+
get:
84+
tags: [sync]
85+
summary: Sync percentage
86+
description: Endpoint can provide float represents percentage of synchronization between dbsync and target network (to check target network please use meta endpoint). Number is expressed as BigDecimal
87+
operationId: syncPercentage
88+
responses:
89+
'200':
90+
description: 'On correct request'
91+
content:
92+
application/json:
93+
schema:
94+
$ref: "#/components/schemas/SyncPercentage"
95+
example:
96+
sync_percentage: "99.9999554682794478"
97+
98+
/api/v0/health:
99+
post:
100+
tags: [meta]
101+
summary: Health
102+
description: Health endpoint for checking if service is up
103+
operationId: health
104+
responses:
105+
'200':
106+
description: 'Server is up'
107+
108+
tags:
109+
- name: sync
110+
description: Information on db sync state against network.
111+
- name: tx
112+
description: Information on transactions.
113+
- name: meta
114+
description: Information on service or db sync condition.
115+
116+
117+
components:
118+
schemas:
119+
TransactionConfirmation:
120+
type: object
121+
properties:
122+
epoch_no:
123+
type: integer
124+
format: int32
125+
description: epoch number in which transction was minted.
126+
slot_no:
127+
type: integer
128+
description: slot number in which transaction was minted.
129+
absolute_slot:
130+
type: integer
131+
description: absolute slot number in which transaction was minted
132+
block_no:
133+
type: integer
134+
description: block number in which transaction was minted
135+
Behind:
136+
type: object
137+
properties:
138+
behind_by:
139+
$ref: '#/components/schemas/SystemTime'
140+
141+
SyncPercentage:
142+
type: object
143+
properties:
144+
sync_percentage:
145+
type: number
146+
format: float
147+
description: "sync progression expressed in percents"
148+
Meta:
149+
type: object
150+
properties:
151+
id:
152+
type: number
153+
format: int64
154+
description: "identifier of meta information"
155+
start_time:
156+
$ref: '#/components/schemas/SystemTime'
157+
version:
158+
type: number
159+
format: float
160+
description: "db sync version"
161+
network_name:
162+
type: number
163+
format: float
164+
description: "network name db sync points to"
165+
SystemTime:
166+
type: object
167+
properties:
168+
secs_since_epoch:
169+
type: integer
170+
format: int32
171+
description: seconds since epoch start represents date.
172+
nanos_since_epoch:
173+
type: integer
174+
description: seconds since epoch start represents date.

0 commit comments

Comments
 (0)