Skip to content

Commit 1c79ead

Browse files
committed
Add --state-dir CLI parameter for LMDB state storage path
1 parent 4970fcf commit 1c79ead

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/kafka_streaming_loader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def main(
4444
network: str,
4545
start_block: int = None,
4646
label_csv: str = None,
47+
state_dir: str = '.amp_state',
4748
):
4849
client = Client(amp_server)
4950
print(f'Connected to {amp_server}')
@@ -63,7 +64,7 @@ def main(
6364
{
6465
'bootstrap_servers': kafka_brokers,
6566
'client_id': 'amp-kafka-loader',
66-
'state': {'enabled': True, 'storage': 'lmdb'},
67+
'state': {'enabled': True, 'storage': 'lmdb', 'data_dir': state_dir},
6768
},
6869
)
6970

@@ -103,6 +104,7 @@ def main(
103104
parser.add_argument('--network', default='anvil')
104105
parser.add_argument('--start-block', type=int, help='Start from specific block (default: latest - 10)')
105106
parser.add_argument('--label-csv', help='Optional CSV for label joining')
107+
parser.add_argument('--state-dir', default='.amp_state', help='Directory for LMDB state storage')
106108
parser.add_argument('--log-level', choices=['DEBUG', 'INFO', 'WARNING', 'ERROR'])
107109
args = parser.parse_args()
108110

@@ -121,6 +123,7 @@ def main(
121123
network=args.network,
122124
start_block=args.start_block,
123125
label_csv=args.label_csv,
126+
state_dir=args.state_dir,
124127
)
125128
except KeyboardInterrupt:
126129
print('\n\nStopped by user')

0 commit comments

Comments
 (0)