You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: transactions/cell-management.md
+15-10
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,21 @@ An indexer is a piece of software that helps speed up the process of locating ce
8
8
9
9

10
10
11
-
An indexer runs as separate node that continuously monitors a Nervos CKB node for new block data. As new blocks are found, the cell information is extracted and organized internally by the indexer until needed. Dapp frontends and backends can then interface directly with the indexer to query for information about cells.
11
+
An indexer monitors for new block data, and then extracts and organizes the cell information so it can be more quickly located when needed. Dapp frontends and backends can then interface directly with the indexer to query for information about cells.
12
+
13
+
The way that indexers have been implemented changed over time, so you may see them referenced as a separate stand-alone node or as part of the CKB node. In the newest generation of node software, the CKB node includes the indexer functionality, and it is enabled in `ckb.toml`.
@@ -29,11 +32,13 @@ const indexer = new Indexer(INDEXER_URL, NODE_URL);
29
32
```
30
33
{% endcode %}
31
34
32
-
On line 8 we start with `initializeConfig(config)`. This uses the `config.json` file in your current working directory to initialize Lumos.
35
+
On lines 6 and 7 we define the CKB node RPC URL and the CKB Indexer RPC URL. These are the same value because the new versions of the CKB node now include the indexer functionality, where it had previously been a separate server.
36
+
37
+
On line 9 we start with `initializeConfig(CONFIG)`. This uses the `config.json` file in your current working directory to initialize Lumos.
33
38
34
-
On line 9 we create a new instance of `Indexer` which will pass requests to the CKB Indexer node JSON RPC which we specified.
39
+
On line 10 we create a new instance of `Indexer` which will pass requests to the CKB Indexer node JSON RPC which we specified.
35
40
36
-
Finally, on line 13 we use `indexer` to retrieve and display the most recent tip block on the console.
41
+
Finally, on line 14 we use `indexer` to retrieve and display the most recent tip block on the console.
37
42
38
43
### Automated Cell Collection
39
44
@@ -102,7 +107,7 @@ The rest of the code should be fairly easy to understand. It continuously gather
102
107
103
108
### Capacity Management
104
109
105
-
Let's say that Charlie wants to send Bob 100 CKBytes. If Charlie had a cell that contained exactly enough CKBytes, this would be a very straight forward transaction.
110
+
Let's say that Charlie wants to send Bob 100 CKBytes. If Charlie had a cell that contained exactly enough CKBytes, this would be a very straightforward transaction.
0 commit comments