Skip to content

Commit 7bcdb11

Browse files
committed
Upload getting-started documentation
1 parent 7b3199b commit 7bcdb11

File tree

2 files changed

+44
-25
lines changed

2 files changed

+44
-25
lines changed

README.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,5 @@ The overall infrastructure is depicted below.
1313

1414
For more information check the [documentation](/docs/).
1515

16-
## Setup
17-
Use the script in `scripts/setup.sh` to automatically install system dependencies, clone the repo and all submodules, and compile:
18-
- Tested on Ubuntu LTS 22.04
19-
```
20-
bash scripts/setup.sh
21-
```
22-
NOTE: you may need to run with `sudo`.
23-
24-
Next, build and run the development profile (default) with appropriate features:
25-
26-
E.g. to output to Google Pub/Sub or to output JSON files, replace `<OUTPUT_TYPE>` with `GOOGLE_PUBSUB` or `JSON`, respectively:
27-
28-
`cargo build --features <OUTPUT_TYPE>`
29-
30-
Finally, execute with the appropriate function and parameters.
31-
32-
E.g. Index starting from genesis onwards:
33-
34-
`./target/debug/blockchain_etl_indexer index-range stream 0`
35-
36-
Or to index from genesis to block 10:
37-
`./target/debug/blockchain_etl_indexer index-range stream 0 10`
38-
39-
And to index a list of specific blocks, provide a CSV filepath with `index-list` command:
40-
`./target/debug/blockchain_etl_indexer index-list stream FILE_PATH.csv`
16+
## Usage
17+
For instructions on system setup, compilation, and running, see the documentation on [Getting Started](/docs/getting-started.md).

docs/getting-started.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Getting Started
2+
## Install System Dependencies
3+
Tested on Ubuntu LTS 22.04:
4+
```
5+
sudo apt install git cargo g++ protobuf-compiler
6+
```
7+
## Clone the Repo
8+
```
9+
git clone https://github.com/blockchain-etl/solana-etl.git
10+
```
11+
## Compile the Code
12+
```
13+
cd solana-etl
14+
cargo build –-release --features <OUTPUT>
15+
```
16+
NOTE: you must replace `<OUTPUT>` in the above command with one of the supported output types, depending on how you would like to run the indexer. The supported outputs are:
17+
1. `JSON`
18+
2. `JSONL`
19+
3. `GOOGLE_PUBSUB`
20+
4. `RABBITMQ_CLASSIC`
21+
5. `RABBITMQ_STREAM`
22+
23+
If you would like to upload the records as files to GCS buckets, then you should use `JSONL` as output, and you can run [this script](/scripts/upload_to_gcs.sh) to continually upload them.
24+
25+
If you would like to write the records to BigQuery using the Storage Write API, then you should use `RABBITMQ_CLASSIC` as output, and setup a RabbitMQ instance using the scripts in the iac directory. That documentation is available [here](/iac/README.md) and the Storage Write API scripts are available [here](/storage-write).
26+
27+
## Configure the Environment Variables
28+
See the [documentation on environment variables](/docs/environment-variables.md).
29+
30+
## Run the Indexer
31+
There are two CLI options to choose from:
32+
1. `index-range`
33+
2. `index-list`
34+
Option 1 requires that you pass a starting slot to index from, and you can optionally provide a second slot as the ending index. The start is inclusive, and the end is exclusive.
35+
36+
Option 2 requires that you pass the path to a CSV file containing a list of specified slots to index.
37+
38+
As an example, if you would like to index from the genesis block onwards, you can run the following command:
39+
```
40+
RUST_LOG=WARN ./target/release/blockchain_etl_indexer index-range stream 0
41+
```
42+
NOTE: `RUST_LOG` specifies the logging level. For more information, see the `log` crate and [its logging levels](https://docs.rs/log/latest/log/enum.Level.html).

0 commit comments

Comments
 (0)