Skip to content

Commit

Permalink
feat: update hugo readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed Mar 26, 2024
1 parent b6dcd2f commit 68171f5
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions README.hugo.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Data is stored in the [Apache Parquet](https://parquet.apache.org) format and ca

```bash
# Query the first 10 rows of the beacon_api_eth_v1_events_block table for 2024-03-20
clickhouse-local ---query="$(<< 'EOF'
clickhouse local ---query="$(<< 'EOF'
SELECT
*
Expand All @@ -55,7 +55,7 @@ EOF

```bash
# Use globs to query multiple files eg. 15th to 20th March
clickhouse-local --query="$(<< 'EOF'
clickhouse local --query="$(<< 'EOF'
SELECT
*
Expand All @@ -67,16 +67,25 @@ EOF
)"
```


### Setup clickhouse locally to import and query the data

You might want to download data from multiple tables and query the data. You can use our docker compose setup to run ClickHouse locally and have the schema migrations already applied for ease of use.

1. Run xatu [local clickhouse](https://github.com/ethpandaops/xatu?tab=readme-ov-file#local-clickhouse) to stand up a local ClickHouse cluster with the xatu [migrations](https://github.com/ethpandaops/xatu/tree/master/deploy/migrations/clickhouse) automatically applied.
1. Run xatu [clickhouse docker compose](https://github.com/ethpandaops/xatu?tab=readme-ov-file#locally-via-docker-compose) to stand up a local ClickHouse cluster with the xatu [migrations](https://github.com/ethpandaops/xatu/tree/master/deploy/migrations/clickhouse) automatically applied.
{{< github repo="ethpandaops/xatu" >}}
2. Import the data you want using the [`clickhouse-client`](https://clickhouse.com/docs/en/interfaces/cli) CLI tool.
2. To import data you have 2 options:
- Use the [import-clickhouse.sh](https://github.com/ethpandaops/xatu-data/blob/master/import-clickhouse.sh) script.

```bash
./import-clickhouse.sh mainnet default beacon_api_eth_v1_events_block 2024-03-20

```

- Import the data you want directly using the [`clickhouse client`](https://clickhouse.com/docs/en/interfaces/cli) CLI tool.

```bash
clickhouse-client --query="$(<< 'EOF'
clickhouse client --query="$(<< 'EOF'
INSERT INTO
default.beacon_api_eth_v1_events_block
Expand All @@ -87,10 +96,10 @@ EOF
)"
```

3. Query the data using the [`clickhouse-client`](https://clickhouse.com/docs/en/interfaces/cli) CLI tool.
3. Query the data using the [`clickhouse client`](https://clickhouse.com/docs/en/interfaces/cli) CLI tool.

```bash
clickhouse-client --query="$(<< 'EOF'
clickhouse client --query="$(<< 'EOF'
SELECT
*
Expand Down

0 comments on commit 68171f5

Please sign in to comment.