@@ -17,12 +17,20 @@ Config Example:
1717 "cosmosapi" : " localhost:1317" ,
1818 "cosmosrpc" : " localhost:26656" ,
1919 "pruneoffset" : 100 ,
20- "refreshduration" : " 5s"
20+ "refreshduration" : " 5s" ,
21+ "apimaxlimit" : 100
2122}
2223```
2324
2425- ` Pruneoffset ` is the value of your node pruned settings. The program will use the information from the latest height - pruneoffset to index the chain
2526- ` Refreshduration ` is the time the program will wait until pulling new blocks values
27+ - ` APIMaxLimit ` is the max range allowed by the api, if the range if bigger than the one set, the query will overwrite the ` end ` value
28+
29+ ## Run
30+
31+ - Clone the repo
32+ - Create the ` config.json ` file in the root of the repo
33+ - Run ` make run `
2634
2735## Database
2836
@@ -36,3 +44,80 @@ make generate
3644```
3745
3846_ NOTE: you need ` sqlc ` to generate the files, run ` make install-deps ` if you need it_
47+
48+ ## Queries:
49+
50+ ### Request all the validators info by block height
51+
52+ - Request
53+
54+ ``` sh
55+ curl " http://localhost:42069/api?start=7313145"
56+ ```
57+
58+ _ NOTE: optional parameter ` end ` to set a rangeof blocks_
59+
60+ - Response
61+
62+ ``` json
63+ {
64+ "values" : [
65+ {
66+ "ID" : 3337 ,
67+ "Height" : 7313145 ,
68+ "ValidatorID" : 20 ,
69+ "Missed" : 0 ,
70+ "ID_2" : 20 ,
71+ "OperatorAddress" : " ethmvaloper1kdtjxywfvwq94jsst2uyshwkel6dwdv5vlf4l2" ,
72+ "Pubkey" : " TP8Ncm5KUUT3bQgN5SsQADVtPEwaW7O0MY5yX+ztJuE=" ,
73+ "ValidatorAddress" : " ethmvalcons1qwcmnlr2kwuunpmh0s4pshrgz5zqd9m7ljs8lu" ,
74+ "Moniker" : " evmOS" ,
75+ "Indentity" : " "
76+ },
77+ {
78+ "ID" : 3338 ,
79+ "Height" : 7313145 ,
80+ "ValidatorID" : 13 ,
81+ "Missed" : 2 ,
82+ "ID_2" : 13 ,
83+ "OperatorAddress" : " ethmvaloper1weh6nan3p8cpg7hsfke8teksjnf5pdl8ve97ny" ,
84+ "Pubkey" : " LxQKOI9n5enbjflu802ZL77lyYLHuejIu9o3FXQ3EOc=" ,
85+ "ValidatorAddress" : " ethmvalcons1qkxa6u5tdr820pv9kjc5rlf8p0r7qqr25fenyw" ,
86+ "Moniker" : " peersyst-node-3" ,
87+ "Indentity" : " 14329789E9E20C43"
88+ },
89+ ...
90+ ]
91+ }
92+ ```
93+
94+ ### Request all one validators info by block height
95+
96+ - Request
97+
98+ ``` sh
99+ curl " http://localhost:42069/api?start=7313145&validator=ethmvaloper1weh6nan3p8cpg7hsfke8teksjnf5pdl8ve97ny"
100+ ```
101+
102+ _ NOTE: optional parameter ` end ` to set a rangeof blocks_
103+
104+ - Response
105+
106+ ``` json
107+ {
108+ "values" : [
109+ {
110+ "ID" : 3338 ,
111+ "Height" : 7313145 ,
112+ "ValidatorID" : 13 ,
113+ "Missed" : 2 ,
114+ "ID_2" : 13 ,
115+ "OperatorAddress" : " ethmvaloper1weh6nan3p8cpg7hsfke8teksjnf5pdl8ve97ny" ,
116+ "Pubkey" : " LxQKOI9n5enbjflu802ZL77lyYLHuejIu9o3FXQ3EOc=" ,
117+ "ValidatorAddress" : " ethmvalcons1qkxa6u5tdr820pv9kjc5rlf8p0r7qqr25fenyw" ,
118+ "Moniker" : " peersyst-node-3" ,
119+ "Indentity" : " 14329789E9E20C43"
120+ }
121+ ]
122+ }
123+ ```
0 commit comments