@@ -26,6 +26,7 @@ Process specific updates:
26
26
Collect and report on pipeline performance and operational data.
27
27
28
28
Our premade metrics crates assist with common use cases:
29
+
29
30
| Crate Name | Description | Ease of Setup |
30
31
| --------------------------- | ----------------------------------------------------------------------------- | ------------- |
31
32
| ` carbon-log-metrics ` | Logs useful program info to the terminal | Easy |
@@ -93,7 +94,7 @@ sudo mv carbon-cli-macos-amd64 /usr/local/bin/carbon-cli
93
94
94
95
##### Windows
95
96
96
- 1 . Download the latest release from https://github.com/sevenlabs-hq/carbon/releases/latest/download/carbon-cli-windows-amd64.exe
97
+ 1 . Download the latest release from < https://github.com/sevenlabs-hq/carbon/releases/latest/download/carbon-cli-windows-amd64.exe >
97
98
2 . Rename the downloaded file to ` carbon-cli.exe `
98
99
3 . Move the file to a directory in your PATH
99
100
@@ -106,7 +107,7 @@ cargo install --git https://github.com/sevenlabs-hq/carbon.git carbon-cli
106
107
#### CLI Usage
107
108
108
109
``` sh
109
- $ carbon-cli parse [OPTIONS] --idl < IDL> --output < OUTPUT>
110
+ carbon-cli parse [OPTIONS] --idl < IDL> --output < OUTPUT>
110
111
```
111
112
112
113
#### Options
@@ -126,7 +127,7 @@ $ carbon-cli parse [OPTIONS] --idl <IDL> --output <OUTPUT>
126
127
1 . To generate a decoder from an Anchor IDL file:
127
128
128
129
``` sh
129
- $ carbon-cli parse --idl my_program.json --output ./src/decoders
130
+ carbon-cli parse --idl my_program.json --output ./src/decoders
130
131
```
131
132
132
133
or with interactive mode:
@@ -138,29 +139,29 @@ This will parse the my_program.json Anchor IDL file and generate the correspondi
138
139
2 . To generate a decoder from an Anchor PDA IDL, specify a program address (Meteora DLMM program in this case):
139
140
140
141
``` sh
141
- $ carbon-cli parse --idl LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo -u mainnet-beta --output ./src/decoders
142
+ carbon-cli parse --idl LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo -u mainnet-beta --output ./src/decoders
142
143
```
143
144
144
145
This will fetch Meteora DLMM program's IDL from chain and generate the corresponding decoder code in the ./src/decoders directory.
145
146
146
147
3 . To generate a decoder from a Codama IDL:
147
148
148
149
``` sh
149
- $ carbon-cli parse --idl my_program_codama.json --output ./src/decoders --standard codama
150
+ carbon-cli parse --idl my_program_codama.json --output ./src/decoders --standard codama
150
151
```
151
152
152
153
This will parse the my_program_codama.json Codama IDL file and generate the corresponding decoder code in the ./src/decoders directory.
153
154
154
155
** Note** : in order to parse CPI Events for a provided Codama IDL, add ` --event-hints ` option with comma-separated names of corresponding defined Codama types:
155
156
156
157
``` sh
157
- $ carbon-cli parse --idl my_program_codama.json --output ./src/decoders --standard codama --event-hints event1,event2,event3
158
+ carbon-cli parse --idl my_program_codama.json --output ./src/decoders --standard codama --event-hints event1,event2,event3
158
159
```
159
160
160
161
##### Scaffold Project
161
162
162
163
``` sh
163
- $ carbon-cli scaffold --name degen-paradize --output ./desired-folder --decoders pumpfun,moonshot,raydium-amm-v4 --data-source yellowstone-grpc
164
+ carbon-cli scaffold --name degen-paradize --output ./desired-folder --decoders pumpfun,moonshot,raydium-amm-v4 --data-source yellowstone-grpc
164
165
```
165
166
166
167
or with interactive mode:
@@ -192,6 +193,7 @@ impl Processor for MyAccountProcessor {
192
193
### Implementing a Datasource
193
194
194
195
For most use cases, we recommend choosing from one of our datasource crates:
196
+
195
197
| Crate Name | Description | Affordability | Ease of Setup |
196
198
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------------- |
197
199
| ` carbon-block-subscribe ` | Uses ` blockSubscribe ` with Solana WS JSON RPC to listen to real-time on-chain transactions | Cheap (just RPC) | Easy |
@@ -277,6 +279,19 @@ Decoders for most popular Solana programs are published and maintained:
277
279
| ` carbon-virtuals-decoder ` | Virtuals Program Decoder | 5U3EU2ubXtK84QcRjWVmYt9RaDyA8gKxdUrPFXmZyaki |
278
280
| ` carbon-zeta-decoder ` | Zeta Program Decoder | ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD |
279
281
282
+ ## Pre-commit hooks
283
+
284
+ To activate the pre-commit hook, run ` ./.pre-commit.sh ` once.
285
+ This will cause the following rules to be registered and called at the next ` git commit ` .
286
+
287
+ The following checks will be performed:
288
+
289
+ - fmt: Checks code formatting using ` cargo fmt --check ` .
290
+ - clippy: Runs ` clippy ` on the codebase to catch potential issues.
291
+ - typos: Uses the ` typos ` tool to check for typos in specific directories.
292
+ - cargo_sort: Utilizes ` cargo-sort ` to ensure Cargo.toml files are sorted correctly.
293
+ - machete: Checks for unused Cargo dependencies using ` cargo-machete ` .
294
+
280
295
## Test
281
296
282
297
``` sh
0 commit comments