Skip to content

Commit 86d2da5

Browse files
committed
chore: generate rpc doc
1 parent 1d264ee commit 86d2da5

File tree

1 file changed

+180
-1
lines changed

1 file changed

+180
-1
lines changed

rpc/README.md

+180-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.67.1.
5050
* [Method `verify_transaction_proof`](#method-verify_transaction_proof)
5151
* [Method `get_transaction_and_witness_proof`](#method-get_transaction_and_witness_proof)
5252
* [Method `verify_transaction_and_witness_proof`](#method-verify_transaction_and_witness_proof)
53+
* [Method `get_cells_status_proof`](#method-get_cells_status_proof)
54+
* [Method `verify_cells_status_proof`](#method-verify_cells_status_proof)
5355
* [Method `get_fork_block`](#method-get_fork_block)
5456
* [Method `get_consensus`](#method-get_consensus)
5557
* [Method `get_block_median_time`](#method-get_block_median_time)
@@ -120,8 +122,10 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.67.1.
120122
* [Type `CellInfo`](#type-cellinfo)
121123
* [Type `CellInput`](#type-cellinput)
122124
* [Type `CellOutput`](#type-celloutput)
125+
* [Type `CellStatus`](#type-cellstatus)
123126
* [Type `CellWithStatus`](#type-cellwithstatus)
124127
* [Type `CellbaseTemplate`](#type-cellbasetemplate)
128+
* [Type `CellsStatusProof`](#type-cellsstatusproof)
125129
* [Type `ChainInfo`](#type-chaininfo)
126130
* [Type `Consensus`](#type-consensus)
127131
* [Type `Cycle`](#type-cycle)
@@ -1500,6 +1504,146 @@ Response
15001504
```
15011505

15021506

1507+
#### Method `get_cells_status_proof`
1508+
* `get_cells_status_proof(out_points, block_hash)`
1509+
* `out_points`: `Array<` [`OutPoint`](#type-outpoint) `>`
1510+
* `block_hash`: [`H256`](#type-h256) `|` `null`
1511+
* result: [`CellsStatusProof`](#type-cellsstatusproof)
1512+
1513+
Returns a proof of the cells status in the specified block.
1514+
1515+
###### Params
1516+
1517+
* `out_points` - Cells’ out points to prove
1518+
1519+
* `block_hash` - An optional parameter, if specified, generate proof for the block with this hash, otherwise use the tip block
1520+
1521+
###### Examples
1522+
1523+
Request
1524+
1525+
1526+
```
1527+
{
1528+
"id": 42,
1529+
"jsonrpc": "2.0",
1530+
"method": "get_cells_status_proof",
1531+
"params": [
1532+
[
1533+
{
1534+
"tx_hash": "0xa4037a893eb48e18ed4ef61034ce26eba9c585f15c9cee102ae58505565eccc3",
1535+
"index": "0x0"
1536+
}
1537+
]
1538+
]
1539+
}
1540+
```
1541+
1542+
1543+
Response
1544+
1545+
1546+
```
1547+
{
1548+
"id": 42,
1549+
"jsonrpc": "2.0",
1550+
"result": {
1551+
"block_hash": "0xa5f5c85987a15de25661e5a214f2c1449cd803f071acc7999820f25246471f40",
1552+
"cells_count": "0x3f6",
1553+
"cells_status": [
1554+
{
1555+
"mmr_position": "0x0",
1556+
"out_point": {
1557+
"tx_hash": "0xa4037a893eb48e18ed4ef61034ce26eba9c585f15c9cee102ae58505565eccc3",
1558+
"index": "0x0"
1559+
},
1560+
"created_by": "0x0",
1561+
"consumed_by": null
1562+
}
1563+
],
1564+
"merkle_proof": [
1565+
"0xdeb75ce5f1a45df88aca9370c01224fcbba5e996b190a8a6ca4b7b3df18b5d42",
1566+
"0x29deb32dfc73c95d62be24915c5edafc2c0c8e61eda94e6abed78e18f6e1af1b",
1567+
"0xa936c971f5c59b1a200a6b3f2cc8d11ef099fa7a7b18e5faa5792d8aab3ef6a8",
1568+
"0x3b98c55e5a8d274c0c5558de7f1c9c2427fddd291ff961b95e3f5e0deffbd717",
1569+
"0x384b248b63348edc3466016c73cb8657feeccc181c5d73f318dd16b2d59e0305",
1570+
"0xa173912a34b254a2ebc921f7559c0a777fa556362a6761522a2204bd7b524c7e",
1571+
"0xaa6a62aa7388c1df92c16d605233e13ed861234bb803cd37ee1112cfe244b94a",
1572+
"0x9819e43079dad6302e80cc6f0db90cd55aff16dd5380fc461aa02cab19af2d4c",
1573+
"0x944db3a79017c60da31dddb33f796d196dd5c0209ddb738398f489ac3c2b7159",
1574+
"0xe4e6bb25e72c3ce034aa02231e42b2c05030495c37e29530ed7c8fc429f902f9"
1575+
]
1576+
}
1577+
}
1578+
```
1579+
1580+
1581+
#### Method `verify_cells_status_proof`
1582+
* `verify_cells_status_proof(proof)`
1583+
* `proof`: [`CellsStatusProof`](#type-cellsstatusproof)
1584+
* result: `boolean`
1585+
1586+
Verifies that a cells status proof is valid or not.
1587+
1588+
###### Params
1589+
1590+
* `out_points` - Cells’ out points to prove
1591+
1592+
* `block_hash` - An optional parameter, if specified, generate proof for the block with this hash, otherwise use the tip block
1593+
1594+
###### Examples
1595+
1596+
Request
1597+
1598+
1599+
```
1600+
{
1601+
"id": 42,
1602+
"jsonrpc": "2.0",
1603+
"method": "verify_cells_status_proof",
1604+
"params": [{
1605+
"block_hash": "0xa5f5c85987a15de25661e5a214f2c1449cd803f071acc7999820f25246471f40",
1606+
"cells_count": "0x3f6",
1607+
"cells_status": [
1608+
{
1609+
"mmr_position": "0x0",
1610+
"out_point": {
1611+
"tx_hash": "0xa4037a893eb48e18ed4ef61034ce26eba9c585f15c9cee102ae58505565eccc3",
1612+
"index": "0x0"
1613+
},
1614+
"created_by": "0x0",
1615+
"consumed_by": null
1616+
}
1617+
],
1618+
"merkle_proof": [
1619+
"0xdeb75ce5f1a45df88aca9370c01224fcbba5e996b190a8a6ca4b7b3df18b5d42",
1620+
"0x29deb32dfc73c95d62be24915c5edafc2c0c8e61eda94e6abed78e18f6e1af1b",
1621+
"0xa936c971f5c59b1a200a6b3f2cc8d11ef099fa7a7b18e5faa5792d8aab3ef6a8",
1622+
"0x3b98c55e5a8d274c0c5558de7f1c9c2427fddd291ff961b95e3f5e0deffbd717",
1623+
"0x384b248b63348edc3466016c73cb8657feeccc181c5d73f318dd16b2d59e0305",
1624+
"0xa173912a34b254a2ebc921f7559c0a777fa556362a6761522a2204bd7b524c7e",
1625+
"0xaa6a62aa7388c1df92c16d605233e13ed861234bb803cd37ee1112cfe244b94a",
1626+
"0x9819e43079dad6302e80cc6f0db90cd55aff16dd5380fc461aa02cab19af2d4c",
1627+
"0x944db3a79017c60da31dddb33f796d196dd5c0209ddb738398f489ac3c2b7159",
1628+
"0xe4e6bb25e72c3ce034aa02231e42b2c05030495c37e29530ed7c8fc429f902f9"
1629+
]
1630+
}]
1631+
}
1632+
```
1633+
1634+
1635+
Response
1636+
1637+
1638+
```
1639+
{
1640+
"id": 42,
1641+
"jsonrpc": "2.0",
1642+
"result": true
1643+
}
1644+
```
1645+
1646+
15031647
#### Method `get_fork_block`
15041648
* `get_fork_block(block_hash, verbosity)`
15051649
* `block_hash`: [`H256`](#type-h256)
@@ -5528,6 +5672,23 @@ The fields of an output cell except the cell data.
55285672
The JSON field name is “type”.
55295673

55305674

5675+
### Type `CellStatus`
5676+
5677+
Cell status.
5678+
5679+
#### Fields
5680+
5681+
`CellStatus` is a JSON object with the following fields.
5682+
5683+
* `mmr_position`: [`Uint64`](#type-uint64) - The position of the leaf node in the MMR.
5684+
5685+
* `out_point`: [`OutPoint`](#type-outpoint) - The cell’s out point.
5686+
5687+
* `created_by`: [`BlockNumber`](#type-blocknumber) - The block number when the cell was created.
5688+
5689+
* `consumed_by`: [`BlockNumber`](#type-blocknumber) `|` `null` - The block number when the cell was consumed, optional, none if the cell is live.
5690+
5691+
55315692
### Type `CellWithStatus`
55325693

55335694
The JSON view of a cell with its status information.
@@ -5602,6 +5763,23 @@ The cellbase transaction template of the new block for miners.
56025763
* `data`: [`Transaction`](#type-transaction) - The cellbase transaction.
56035764

56045765

5766+
### Type `CellsStatusProof`
5767+
5768+
Proof of cells status.
5769+
5770+
#### Fields
5771+
5772+
`CellsStatusProof` is a JSON object with the following fields.
5773+
5774+
* `block_hash`: [`H256`](#type-h256) - The block hash of the specified block.
5775+
5776+
* `cells_count`: [`Uint64`](#type-uint64) - The total number of generated cells from genesis block to the specified block, including consumed cells.
5777+
5778+
* `cells_status`: `Array<` [`CellStatus`](#type-cellstatus) `>` - An array of cell status.
5779+
5780+
* `merkle_proof`: `Array<` [`H256`](#type-h256) `>` - The merkle proof of the MMR, it is an array of hash digests.
5781+
5782+
56055783
### Type `ChainInfo`
56065784

56075785
Chain information.
@@ -5765,10 +5943,11 @@ An object containing various state info regarding deployments of consensus chang
57655943

57665944
Deployment name
57675945

5768-
`DeploymentPos` is equivalent to `"testdummy" | "light_client"`.
5946+
`DeploymentPos` is equivalent to `"testdummy" | "light_client" | "cells_commitments"`.
57695947

57705948
* Dummy
57715949
* light client protocol
5950+
* Tranaction output commitments
57725951

57735952

57745953
### Type `DeploymentState`

0 commit comments

Comments
 (0)