Skip to content

Commit 532fd88

Browse files
authored
Merge pull request #15 from core-coin/feature/go-core_volume
add go-core volume
2 parents b303af8 + 77473cf commit 532fd88

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ build-postgres:
5858
# Builds, (re)creates, starts, and attaches to containers for a service
5959
# This runs the additional go-core container
6060
sync-local-postgres:
61-
GO_CORE_FLAGS="$(GO_CORE_FLAGS)" CORE_ETL_FLAGS="-r ws://localhost:8546 --storage postgres-storage -p postgres://etl_user:etl_password@localhost:5432/etl_database" CORE_ETL_EXPORT_FLAGS="$(CORE_ETL_EXPORT_FLAGS)" docker-compose -f ./docker-compose/docker-compose-local-postgres.yml up -d
61+
GO_CORE_FLAGS="$(GO_CORE_FLAGS)" CORE_ETL_FLAGS="-r ws://localhost:8546 --storage postgres -p postgres://etl_user:etl_password@localhost:5432/etl_database" CORE_ETL_EXPORT_FLAGS="$(CORE_ETL_EXPORT_FLAGS)" docker-compose -f ./docker-compose/docker-compose-local-postgres.yml up -d
6262

6363
# Builds, (re)creates, starts, and attaches to containers for a service
6464
# This runs the additional go-core container
6565
sync-remote-postgres:
66-
CORE_ETL_FLAGS="-n mainnet --storage postgres-storage -p postgres://etl_user:etl_password@localhost:5432/etl_database" CORE_ETL_EXPORT_FLAGS="$(CORE_ETL_EXPORT_FLAGS)" docker-compose -f ./docker-compose/docker-compose-remote-postgres.yml up -d
66+
CORE_ETL_FLAGS="-n mainnet --storage postgres -p postgres://etl_user:etl_password@localhost:5432/etl_database" CORE_ETL_EXPORT_FLAGS="$(CORE_ETL_EXPORT_FLAGS)" docker-compose -f ./docker-compose/docker-compose-remote-postgres.yml up -d
6767

6868
# Stops and removes containers, networks, volumes, and images created by docker-compose up
6969
down-postgres:

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Flag | Description | Environment Variable | Default Value
7777
---| --- | --- | ---
7878
`-r, --rpc-url <RPC_URL>` | URL of the RPC node that provides the blockchain data. | `RPC_URL` | wss://xcbws.coreblockchain.net
7979
`-n, --network <NETWORK>` | Network to sync data from (e.g., mainnet, devin, private). | `NETWORK` | Mainnet
80-
`--storage <STORAGE>` | Storage type for saving blockchain data (e.g., sqlite3-storage, postgres-storage). | `STORAGE` | sqlite3-storage
80+
`--storage <STORAGE>` | Storage type for saving blockchain data (e.g., sqlite3, postgres). | `STORAGE` | sqlite3
8181
`-s, --sqlite3-path <SQLITE3_PATH>` | Path to SQLite3 file where the blockchain data is saved. | `SQLITE3_PATH` | None
8282
`-p, --postgres-db-dsn <POSTGRES_DB_DSN>` | Postgres database DSN where the blockchain data is saved. | `POSTGRES_DB_DSN` | None
8383
`-t, --tables-prefix <TABLES_PREFIX>` | Prefix for the tables in the database. Useful when running multiple instances. | `TABLES_PREFIX` | etl
@@ -173,7 +173,7 @@ You can configure `core-etl` using environment variables or command-line flags.
173173

174174
```bash
175175
export NETWORK="mainnet"
176-
export STORAGE="sqlite3-storage"
176+
export STORAGE="sqlite3"
177177
export SQLITE3_PATH="/path/to/your/sqlite3.db"
178178
export TABLES_PREFIX="etl"
179179
export MODULES="blocks,transactions,token_transfers"
@@ -182,7 +182,7 @@ export MODULES="blocks,transactions,token_transfers"
182182
### Command-Line Flags
183183

184184
```bash
185-
./core-etl -n mainnet --storage sqlite3-storage -s /path/to/your/sqlite3.db -t etl -m blocks,transactions,token_transfers export
185+
./core-etl -n mainnet --storage sqlite3 -s /path/to/your/sqlite3.db -t etl -m blocks,transactions,token_transfers export
186186
```
187187

188188
## Examples
@@ -204,7 +204,7 @@ Export only transaction data for the Devin network to SQLite3 storage, using 10
204204
Export transactions and CTN transfers to Postgres with a cleanup interval of 1 hour and retention period of 24 hours:
205205

206206
```bash
207-
./core-etl --storage postgres-storage -p postgres://user:password@localhost:5432/dbname -m transactions,token_transfers export -w "ctn" -r 86400 -c 3600
207+
./core-etl --storage postgres -p postgres://user:password@localhost:5432/dbname -m transactions,token_transfers export -w "ctn" -r 86400 -c 3600
208208
```
209209

210210
Export blocks and transactions using a local node, with the `filtered_etl` table prefix. Do not sync data until the node is synced. Also, filter transactions by address `cb22as..21`:

docker-compose/docker-compose-local-libsql.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ services:
2525
entrypoint: [ "sh", "-c", "gocore ${GO_CORE_FLAGS}" ]
2626
depends_on:
2727
- libsql-server
28+
volumes:
29+
- ./go-core_data:/root/.core # Persist data
2830
restart: always
2931

3032
core-etl:
31-
image: ghcr.io/core-coin/core-cli:latest
33+
image: ghcr.io/core-coin/core-etl:latest
3234
container_name: core-etl
3335
depends_on:
3436
- go-core

docker-compose/docker-compose-local-postgres.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ services:
2626
entrypoint: [ "sh", "-c", "gocore ${GO_CORE_FLAGS}" ]
2727
depends_on:
2828
- etl-postgres
29+
volumes:
30+
- ./go-core_data:/root/.core # Persist data
2931
restart: always
3032

3133
core-etl:
32-
image: ghcr.io/core-coin/core-cli:latest
34+
image: ghcr.io/core-coin/core-etl:latest
3335
container_name: core-etl
3436
depends_on:
3537
- go-core

docker-compose/docker-compose-remote-libsql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
restart: always
1515

1616
core-etl:
17-
image: ghcr.io/core-coin/core-cli:latest
17+
image: ghcr.io/core-coin/core-etl:latest
1818
container_name: core-etl
1919
depends_on:
2020
- libsql-server

docker-compose/docker-compose-remote-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
restart: always
1818

1919
core-etl:
20-
image: ghcr.io/core-coin/core-cli:latest
20+
image: ghcr.io/core-coin/core-etl:latest
2121
container_name: core-etl
2222
depends_on:
2323
- etl-postgres

0 commit comments

Comments
 (0)