-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
2894 lines (2804 loc) · 85.8 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
title: CometBFT RPC
contact:
name: CometBFT
url: https://cometbft.com/
description: |
CometBFT supports the following RPC protocols:
* URI over HTTP
* JSONRPC over HTTP
* JSONRPC over websockets
## Configuration
RPC can be configured by tuning parameters under `[rpc]` table in the
`$CMTHOME/config/config.toml` file or by using the `--rpc.X` command-line
flags.
The default RPC listen address is `tcp://127.0.0.1:26657`.
To set another address, set the `laddr` config parameter to desired value.
CORS (Cross-Origin Resource Sharing) can be enabled by setting
`cors_allowed_origins`, `cors_allowed_methods`, `cors_allowed_headers`
config parameters.
If testing using a local RPC node, under the `[rpc]`
section change the `cors_allowed_origins` property, please add the URL of
the site where this OpenAPI document is running, for example:
`cors_allowed_origins = ["http://localhost:8088"]`
or if testing from the official documentation site:
`cors_allowed_origins = ["https://docs.cometbft.com"]`
## Arguments
Arguments which expect strings or byte arrays may be passed as quoted
strings, like `"abc"` or as `0x`-prefixed strings, like `0x616263`.
## URI/HTTP
A REST like interface.
curl localhost:26657/block?height=5
## JSONRPC/HTTP
JSONRPC requests can be POST'd to the root RPC endpoint via HTTP.
curl --header "Content-Type: application/json" --request POST --data '{"method": "block", "params": ["5"], "id": 1}' localhost:26657
## JSONRPC/websockets
JSONRPC requests can be also made via websocket.
The websocket endpoint is at `/websocket`, e.g. `localhost:26657/websocket`.
Asynchronous RPC functions like event `subscribe` and `unsubscribe` are
only available via websockets.
For example using the [websocat](https://github.com/vi/websocat) tool, you can subscribe for 'NewBlock` events
with the following command:
echo '{ "jsonrpc": "2.0","method": "subscribe","id": 0,"params": {"query": "tm.event='"'NewBlock'"'"} }' | websocat -n -t ws://127.0.0.1:26657/websocket
version: "v0.38.x"
license:
name: Apache 2.0
url: https://github.com/cometbft/cometbft/blob/v0.38.x/LICENSE
servers:
- url: https://rpc.cosmos.directory/cosmoshub
description: Interact with the CometBFT RPC from a public node in the Cosmos registry
- url: http://localhost:26657
description: Interact with CometBFT RPC node running locally
tags:
- name: Info
description: Informations about the node APIs
- name: Tx
description: Transactions broadcast APIs
- name: ABCI
description: ABCI APIs
- name: Evidence
description: Evidence APIs
- name: Unsafe
description: Unsafe APIs
paths:
/broadcast_tx_sync:
get:
summary: Returns with the response from CheckTx. Does not wait for DeliverTx result.
tags:
- Tx
operationId: broadcast_tx_sync
description: |
If you want to be sure that the transaction is included in a block, you can
subscribe for the result using JSONRPC via a websocket. See
https://docs.cometbft.com/v0.38.x/core/subscription.html
If you haven't received anything after a couple of blocks, resend it. If the
same happens again, send it to some other node. A few reasons why it could
happen:
1. malicious node can drop or pretend it had committed your tx
2. malicious proposer (not necessary the one you're communicating with) can
drop transactions, which might become valid in the future
(https://github.com/tendermint/tendermint/issues/3322)
Please refer to [formatting/encoding rules](https://docs.cometbft.com/v0.38.x/core/using-cometbft.html#formatting)
for additional details
parameters:
- in: query
name: tx
required: true
schema:
type: string
example: "456"
description: The transaction
responses:
"200":
description: Empty
content:
application/json:
schema:
$ref: "#/components/schemas/BroadcastTxResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/broadcast_tx_async:
get:
summary: Returns right away, with no response. Does not wait for CheckTx nor DeliverTx results.
tags:
- Tx
operationId: broadcast_tx_async
description: |
If you want to be sure that the transaction is included in a block, you can
subscribe for the result using JSONRPC via a websocket. See
https://docs.cometbft.com/v0.38.x/core/subscription.html
If you haven't received anything after a couple of blocks, resend it. If the
same happens again, send it to some other node. A few reasons why it could
happen:
1. malicious node can drop or pretend it had committed your tx
2. malicious proposer (not necessary the one you're communicating with) can
drop transactions, which might become valid in the future
(https://github.com/tendermint/tendermint/issues/3322)
3. node can be offline
Please refer to [formatting/encoding rules](https://docs.cometbft.com/v0.38.x/core/using-cometbft.html#formatting)
for additional details
parameters:
- in: query
name: tx
required: true
schema:
type: string
example: "123"
description: The transaction
responses:
"200":
description: empty answer
content:
application/json:
schema:
$ref: "#/components/schemas/BroadcastTxResponse"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/broadcast_tx_commit:
get:
summary: Returns with the responses from CheckTx and DeliverTx.
tags:
- Tx
operationId: broadcast_tx_commit
description: |
IMPORTANT: use only for testing and development. In production, use
BroadcastTxSync or BroadcastTxAsync. You can subscribe for the transaction
result using JSONRPC via a websocket. See
https://docs.cometbft.com/v0.38.x/core/subscription.html
CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout
waiting for tx to commit.
If CheckTx or DeliverTx fail, no error will be returned, but the returned result
will contain a non-OK ABCI code.
Please refer to [formatting/encoding rules](https://docs.cometbft.com/v0.38.x/core/using-cometbft.html#formatting)
for additional details
parameters:
- in: query
name: tx
required: true
schema:
type: string
example: "785"
description: The transaction
responses:
"200":
description: empty answer
content:
application/json:
schema:
$ref: "#/components/schemas/BroadcastTxCommitResponse"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/check_tx:
get:
summary: Checks the transaction without executing it.
tags:
- Tx
operationId: check_tx
description: |
The transaction won't be added to the mempool.
Please refer to [formatting/encoding rules](https://docs.cometbft.com/v0.38.x/core/using-cometbft.html#formatting)
for additional details
Upon success, the `Cache-Control` header will be set with the default
maximum age.
parameters:
- in: query
name: tx
required: true
schema:
type: string
example: "785"
description: The transaction
responses:
"200":
description: ABCI application's CheckTx response
content:
application/json:
schema:
$ref: "#/components/schemas/CheckTxResponse"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/health:
get:
summary: Node heartbeat
tags:
- Info
operationId: health
description: |
Get node health. Returns empty result (200 OK) on success, no response - in case of an error.
responses:
"200":
description: Gets Node Health
content:
application/json:
schema:
$ref: "#/components/schemas/EmptyResponse"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/status:
get:
summary: Node Status
operationId: status
tags:
- Info
description: |
Get CometBFT status including node info, pubkey, latest block hash, app hash, block height and time.
responses:
"200":
description: Status of the node
content:
application/json:
schema:
$ref: "#/components/schemas/StatusResponse"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/net_info:
get:
summary: Network information
operationId: net_info
tags:
- Info
description: |
Get network info.
responses:
"200":
description: empty answer
content:
application/json:
schema:
$ref: "#/components/schemas/NetInfoResponse"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/dial_seeds:
get:
summary: Dial Seeds (Unsafe)
operationId: dial_seeds
tags:
- Unsafe
description: |
Dial a peer, this route in under unsafe, and has to manually enabled to use
**Example:** curl 'localhost:26657/dial_seeds?seeds=\["[email protected]:26656","[email protected]:26656"\]'
parameters:
- in: query
name: peers
description: list of seed nodes to dial
schema:
type: array
items:
type: string
example: "[email protected]:26656"
responses:
"200":
description: Dialing seeds in progress. See /net_info for details
content:
application/json:
schema:
$ref: "#/components/schemas/dialResp"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/dial_peers:
get:
summary: Add Peers/Persistent Peers (unsafe)
operationId: dial_peers
tags:
- Unsafe
description: |
Set a persistent peer, this route in under unsafe, and has to manually enabled to use.
**Example:** curl 'localhost:26657/dial_peers?peers=\["[email protected]:26656","[email protected]:26656"\]&persistent=false'
parameters:
- in: query
name: persistent
description: Have the peers you are dialing be persistent
schema:
type: boolean
example: true
- in: query
name: unconditional
description: Have the peers you are dialing be unconditional
schema:
type: boolean
example: true
- in: query
name: private
description: Have the peers you are dialing be private
schema:
type: boolean
example: true
- in: query
name: peers
description: array of peers to dial
schema:
type: array
items:
type: string
example: "[email protected]:26656"
responses:
"200":
description: Dialing seeds in progress. See /net_info for details
content:
application/json:
schema:
$ref: "#/components/schemas/dialResp"
"500":
description: empty error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/blockchain:
get:
summary: "Get block headers (max: 20) for minHeight <= height <= maxHeight."
operationId: blockchain
parameters:
- in: query
name: minHeight
description: Minimum block height to return
schema:
type: integer
example: 1
- in: query
name: maxHeight
description: Maximum block height to return
schema:
type: integer
example: 2
tags:
- Info
description: |
Get block headers for minHeight <= height <= maxHeight.
At most 20 items will be returned.
Upon success, the `Cache-Control` header will be set with the default
maximum age.
responses:
"200":
description: Block headers, returned in descending order (highest first).
content:
application/json:
schema:
$ref: "#/components/schemas/BlockchainResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/header:
get:
summary: Get header at a specified height
operationId: header
parameters:
- in: query
name: height
schema:
type: integer
default: 0
example: 1
description: height to return. If no height is provided, it will fetch the latest header.
tags:
- Info
description: |
Get Header.
If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.
responses:
"200":
description: Header informations.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockHeader"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/header_by_hash:
get:
summary: Get header by hash
operationId: header_by_hash
parameters:
- in: query
name: hash
description: header hash
required: true
schema:
type: string
example: "0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"
tags:
- Info
description: |
Get Header By Hash.
Upon success, the `Cache-Control` header will be set with the default
maximum age.
responses:
"200":
description: Header informations.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockHeader"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/block:
get:
summary: Get block at a specified height
operationId: block
parameters:
- in: query
name: height
schema:
type: integer
default: 0
example: 1
description: height to return. If no height is provided, it will fetch the latest block.
tags:
- Info
description: |
Get Block.
If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.
responses:
"200":
description: Block informations.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/block_by_hash:
get:
summary: Get block by hash
operationId: block_by_hash
parameters:
- in: query
name: hash
description: block hash
required: true
schema:
type: string
example: "0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"
tags:
- Info
description: |
Get Block By Hash.
Upon success, the `Cache-Control` header will be set with the default
maximum age.
responses:
"200":
description: Block informations.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/block_results:
get:
summary: Get block results at a specified height
operationId: block_results
parameters:
- in: query
name: height
description: height to return. If no height is provided, it will fetch information regarding the latest block.
schema:
type: integer
default: 0
example: 1
tags:
- Info
description: |
Get block_results.
If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.
responses:
"200":
description: Block results.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockResultsResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/commit:
get:
summary: Get commit results at a specified height
operationId: commit
parameters:
- in: query
name: height
description: height to return. If no height is provided, it will fetch commit informations regarding the latest block.
schema:
type: integer
default: 0
example: 1
tags:
- Info
description: |
Get Commit.
If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.
responses:
"200":
description: |
Commit results.
canonical switches from false to true for block H once block H+1 has been committed. Until then it's subjective and only reflects what this node has seen so far.
content:
application/json:
schema:
$ref: "#/components/schemas/CommitResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/validators:
get:
summary: Get validator set at a specified height
operationId: validators
parameters:
- in: query
name: height
description: height to return. If no height is provided, it will fetch validator set which corresponds to the latest block.
schema:
type: integer
default: 0
example: 1
- in: query
name: page
description: "Page number (1-based)"
required: false
schema:
type: integer
default: 1
example: 1
- in: query
name: per_page
description: "Number of entries per page (max: 100)"
required: false
schema:
type: integer
example: 30
default: 30
tags:
- Info
description: |
Get Validators. Validators are sorted first by voting power
(descending), then by address (ascending).
If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.
responses:
"200":
description: Commit results.
content:
application/json:
schema:
$ref: "#/components/schemas/ValidatorsResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/genesis:
get:
summary: Get Genesis
operationId: genesis
tags:
- Info
description: |
Get genesis.
Upon success, the `Cache-Control` header will be set with the default
maximum age.
responses:
"200":
description: Genesis results.
content:
application/json:
schema:
$ref: "#/components/schemas/GenesisResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/genesis_chunked:
get:
summary: Get Genesis in multiple chunks
operationId: genesis_chunked
tags:
- Info
description: |
Get genesis document in multiple chunks to make it easier to iterate
through larger genesis structures. Each chunk is produced by converting
the genesis document to JSON and then splitting the resulting payload
into 16MB blocks, and then Base64-encoding each block.
Upon success, the `Cache-Control` header will be set with the default
maximum age.
parameters:
- in: query
name: chunk
description: Sequence number of the chunk to download.
schema:
type: integer
default: 0
example: 1
responses:
"200":
description: Genesis chunk response.
content:
application/json:
schema:
$ref: "#/components/schemas/GenesisChunkedResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/dump_consensus_state:
get:
summary: Get consensus state
operationId: dump_consensus_state
tags:
- Info
description: |
Get consensus state.
Not safe to call from inside the ABCI application during a block execution.
responses:
"200":
description: |
Complete consensus state.
See https://pkg.go.dev/github.com/cometbft/cometbft/types?tab=doc#Vote.String for Vote string description.
content:
application/json:
schema:
$ref: "#/components/schemas/DumpConsensusResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/consensus_state:
get:
summary: Get consensus state
operationId: consensus_state
tags:
- Info
description: |
Get consensus state.
Not safe to call from inside the ABCI application during a block execution.
responses:
"200":
description: consensus state results.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsensusStateResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/consensus_params:
get:
summary: Get consensus parameters
operationId: consensus_params
parameters:
- in: query
name: height
description: height to return. If no height is provided, it will fetch commit informations regarding the latest block.
schema:
type: integer
default: 0
example: 1
tags:
- Info
description: |
Get consensus parameters.
If the `height` field is set to a non-default value, upon success, the
`Cache-Control` header will be set with the default maximum age.
responses:
"200":
description: consensus parameters results.
content:
application/json:
schema:
$ref: "#/components/schemas/ConsensusParamsResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/unconfirmed_txs:
get:
summary: Get the list of unconfirmed transactions
operationId: unconfirmed_txs
parameters:
- in: query
name: limit
description: Maximum number of unconfirmed transactions to return (max 100)
required: false
schema:
type: integer
default: 30
example: 1
tags:
- Info
description: |
Get list of unconfirmed transactions
responses:
"200":
description: List of unconfirmed transactions
content:
application/json:
schema:
$ref: "#/components/schemas/UnconfirmedTransactionsResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/num_unconfirmed_txs:
get:
summary: Get data about unconfirmed transactions
operationId: num_unconfirmed_txs
tags:
- Info
description: |
Get data about unconfirmed transactions
responses:
"200":
description: status about unconfirmed transactions
content:
application/json:
schema:
$ref: "#/components/schemas/NumUnconfirmedTransactionsResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/tx_search:
get:
summary: Search for transactions
description: |
Search for transactions w/ their results.
See /subscribe for the query syntax.
operationId: tx_search
parameters:
- in: query
name: query
description: Query
required: true
schema:
type: string
example: '"tx.height=1000"'
- in: query
name: prove
description: Include proofs of the transactions inclusion in the block
required: false
schema:
type: boolean
default: false
example: true
- in: query
name: page
description: "Page number (1-based)"
required: false
schema:
type: integer
default: 1
example: 1
- in: query
name: per_page
description: "Number of entries per page (max: 100)"
required: false
schema:
type: integer
default: 30
example: 30
- in: query
name: order_by
description: Order in which transactions are sorted ("asc" or "desc"), by height & index. If empty, default sorting will be still applied.
required: false
schema:
type: string
default: "asc"
example: "asc"
tags:
- Info
responses:
"200":
description: List of unconfirmed transactions
content:
application/json:
schema:
$ref: "#/components/schemas/TxSearchResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/block_search:
get:
summary: Search for blocks by FinalizeBlock events
description: |
Search for blocks by FinalizeBlock events.
See /subscribe for the query syntax.
operationId: block_search
parameters:
- in: query
name: query
description: Query
required: true
schema:
type: string
example: '"block.height > 1000 AND valset.changed > 0"'
- in: query
name: page
description: "Page number (1-based)"
required: false
schema:
type: integer
default: 1
example: 1
- in: query
name: per_page
description: "Number of entries per page (max: 100)"
required: false
schema:
type: integer
default: 30
example: 30
- in: query
name: order_by
description: Order in which blocks are sorted ("asc" or "desc"), by height. If empty, default sorting will be still applied.
required: false
schema:
type: string
default: "desc"
example: "asc"
tags:
- Info
responses:
"200":
description: List of paginated blocks matching the search criteria.
content:
application/json:
schema:
$ref: "#/components/schemas/BlockSearchResponse"
"500":
description: Error
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
/tx:
get:
summary: Get transactions by hash
operationId: tx
parameters:
- in: query
name: hash
description: hash of transaction to retrieve
required: true
schema:
type: string
example: "0xD70952032620CC4E2737EB8AC379806359D8E0B17B0488F627997A0B043ABDED"