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
+37-3Lines changed: 37 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,12 @@ Sothis is a tool for replaying historical state on a local ***anvil/hardhat*** t
10
10
11
11
Join the [Rainshower Labs discord server](https://discord.gg/Cs3h397gkz) to discuss sothis and get help.
12
12
13
+
## Using sothis as a crate
14
+
15
+
Sothis can be used as a crate in other rust projects. All tracking modes, as well as the lightweight wrapper around JSON-RPC calls can be used. For more on using sothis as a crate, check out the [wiki.](https://github.com/rainshowerLabs/sothis/wiki)
16
+
17
+
We are targeting **1.68.2 as the MSRV**(minimum supported rust version).
18
+
13
19
## Usage
14
20
15
21
Sothis has optional arguments that are not listed in their respective mode sections that might prove useful. Please study the help section below. You can view it any time by running `sothis --help`.
@@ -23,7 +29,7 @@ Options:
23
29
-r, --replay_rpc <replay_rpc>...
24
30
HTTP JSON-RPC of the node we're replaying data to
25
31
-m, --mode <mode>...
26
-
Choose between live, historic, track, or fast_track [default: historic]
32
+
Choose between live, historic, track, fast_track, or call_track [default: historic]
27
33
-b, --terminal_block <terminal_block>...
28
34
Block we're replaying until
29
35
--exit_on_tx_fail [<exit_on_tx_fail>...]
@@ -38,11 +44,17 @@ Options:
38
44
Exit the program if a transaction fails
39
45
--no_setup [<no_setup>...]
40
46
Start replaying immediately.
47
+
--decimal [<decimal>...]
48
+
Start replaying immediately.
41
49
-c, --contract_address <contract_address>...
42
50
Address of the contract we're tracking storage.
43
51
-l, --storage_slot <storage_slot>...
44
52
Storage slot for the variable we're tracking
45
-
-0, --origin_block <origin_block>...
53
+
-a, --calldata <calldata>...
54
+
Storage slot for the variable we're tracking
55
+
-o, --origin_block <origin_block>...
56
+
First block sothis will look at.
57
+
-q, --query_interval <query_interval>...
46
58
First block sothis will look at.
47
59
-p, --path <path>...
48
60
Path to file we're writing to [default: .]
@@ -52,9 +64,10 @@ Options:
52
64
Print help
53
65
-V, --version
54
66
Print version
67
+
55
68
```
56
69
57
-
Sothis currently has 4 modes. Live, historic, track, and fast track.
70
+
Sothis currently has 5 modes. Live, historic, track, fast track, and call track.
58
71
59
72
### Historic
60
73
@@ -139,6 +152,27 @@ Once you are done tracking the slot, terminate the process via a `SIGTERM` or a
The fast call mode is used to track the change for a *historic* eth_call. It cannot be used to get a live view of it. The source_rpc must be an archive node for this mode to perform optimally. This can be used to get historic chainlink oracle prices, see the output of decentralzied exchange swaps over time, and more.
159
+
160
+
#### Usage
161
+
162
+
-`--mode call_track`: Used to denote we are using the tracking mode.
163
+
-`--source_rpc`: RPC of the node we are getting data from.
164
+
-`--contract_address`: Address of the contract we'll be calling.
165
+
-`--calldata`: Calldata we're using.
166
+
-`--origin_block`: The block from which we start tracking.
167
+
-`--terminal_block`(optional): Final block sothis will track. If not specified, sothis will track until terminated.
168
+
-`--filename`(optional): Name of our output file. The default filename is formatted as: `address-{}-slot-{}-timestamp-{}.json`.
169
+
-`--path`(optional): Path to our output file. The default path is the current directory.
170
+
171
+
Once you are done tracking the slot, terminate the process via a `SIGTERM` or a `SIGINT` (ctrl-c), which will terminate execution and write the file. Keep in mind that sothis will check once per new block if you tried to terminate it. If no new block are produced on the source_rpc, sothis will not terminate and nothing will be written if you force close it. The example below demonstrates tracking of the historic chainlink oracle price for ETH/USD on mainnet.
0 commit comments