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: README.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,36 @@ In order to poll the substream, you will need to call the `poll()` function on t
38
38
# View available modules on .spkg
39
39
print(sb.output_modules)
40
40
41
-
# Poll the module and return a list of SubstreamOutput objects in the order of teh specified modules
41
+
# Poll the module and return a list of SubstreamOutput objects in the order of the specified modules
42
42
result = sb.poll(["store_swap_events"], start_block=10000835, end_block=10000835+20000)
43
43
```
44
44
45
-
The result here is a `SubstreamOutput` object, you can access both the `data` and `snapshots` dataframes by doing:
45
+
With the default inputs, this function outputs Pandas Dataframes after streaming all blocks between the start_block and end_block. However depending on how this function is called, a dict object is returned. The `poll()` function has a number of inputs
46
+
47
+
- output_modules
48
+
- List of strings of output modules to stream
49
+
- start_block
50
+
- Integer block number to start the polling
51
+
- end_block
52
+
- Integer block number to end the polling. In theory, there is no max block number as any block number past chain head will stream the blocks in real time. Its recommended to use an end_block far off into the future if building a data app that will be streaming datain real time as blocks finalize, such as block 20,000,000
53
+
- stream_callback
54
+
- An optional callback function to be passed into the polling function to execute when valid streamed data is received
55
+
- return_first_result
56
+
- Boolean value that if True will return data on the first block after the start block to have an applicable TX/Event.
57
+
- Can be called recursively on the front end while incrementing the start_block to return data as its streamed rather than all data at once after streaming is completed
58
+
- Defaults to False
59
+
- If True, the data is returned in the format {"data": [], "module_name": String, "data_block": int}
60
+
- initial_snapshot
61
+
- Boolean value, defaults to False
62
+
- highest_processed_block
63
+
- Integer block number that is used in measuring indexing and processing progress, in cases where return_progress is True
64
+
- Defaults to 0
65
+
- return_progress: bool = False,
66
+
- Boolean value that if True returns progress in back processing
67
+
- Defaults to False
68
+
69
+
70
+
The result here is the default `SubstreamOutput` object, you can access both the `data` and `snapshots` dataframes by doing:
0 commit comments