1
+ openapi : " 3.0.0"
2
+ info :
3
+ description : " This belongs part of ETDStats microservices which will provide a analytics service"
4
+ version : " 1.0.0"
5
+ title : " Block Info service"
6
+ termsOfService : " https://github.com/etherdata-blockchain"
7
+
8
+
9
+ tags :
10
+ - name : " block-info"
11
+ description : " Get blocks and transactions details"
12
+ - name : " node"
13
+ description : " Get nodes info"
14
+ - name : " health"
15
+ description : " Get server's health info"
16
+
17
+ servers :
18
+ - url : https://api.etdchain.net/stats/block_info
19
+ description : Production server
20
+ - url : https://api.debugchain.net/stats/block_info
21
+ description : Testing server
22
+
23
+ paths :
24
+ / :
25
+ get :
26
+ tags :
27
+ - " block-info"
28
+ summary : " Get latest block info"
29
+ description : " Will returns the latest block info from server"
30
+ responses :
31
+ " 200 " :
32
+ description : " OK"
33
+ content :
34
+ application/json :
35
+ schema :
36
+ $ref : " #/components/schemas/block-info"
37
+ /nodes :
38
+ get :
39
+ tags :
40
+ - " node"
41
+ summary : Get list of nodes (Pending)
42
+ responses :
43
+ 200 :
44
+ description : " OK"
45
+ /health :
46
+ get :
47
+ tags :
48
+ - " health"
49
+ summary : " Get server's health info"
50
+ description : " Will return a error reason if not healthy"
51
+ responses :
52
+ " 200 " :
53
+ description : " Server is up"
54
+ content :
55
+ application/json :
56
+ schema :
57
+ $ref : " health_service.spec.yaml#/components/schemas/error"
58
+ " 500 " :
59
+ description : " Server is down"
60
+ content :
61
+ application/json :
62
+ schema :
63
+ $ref : " health_service.spec.yaml#/components/schemas/error"
64
+ components :
65
+ schemas :
66
+ block-info :
67
+ type : object
68
+ required : [ "numBlocks", "numTransactions", "blockTime", "blockTimeHistory", "difficultyHistory" ]
69
+ properties :
70
+ numBlocks :
71
+ type : number
72
+ description : Current block number
73
+ numTransactions :
74
+ type : number
75
+ description : Total number of transactions
76
+ blockTime :
77
+ type : number
78
+ description : Average time for each block in seconds
79
+ block :
80
+ $ref : " transaction_service.spec.yaml#/components/schemas/block"
81
+ description : Latest block
82
+ blockTimeChangePercentage :
83
+ type : string
84
+ description : Difference between latest block time and previous block time
85
+ example : " 10.02%"
86
+ difficultyChangePercentage :
87
+ type : string
88
+ description : Difference between latest block difficulty and previous block difficulty
89
+ example : " -10.02%"
90
+ blockTimeHistory :
91
+ type : array
92
+ description : List of blocks' time
93
+ items :
94
+ type : number
95
+ difficultyHistory :
96
+ type : array
97
+ description : List of blocks' difficulty
98
+ items :
99
+ type : number
100
+
101
+
0 commit comments