hirosystems / ordhook

Build indexers, standards and protocols on top of Ordinals and Inscriptions (BRC20, etc).
Apache License 2.0
174 stars 54 forks source link

posting brc20 activity without `--config-path` #337

Closed ryanwaits closed 8 hours ago

ryanwaits commented 3 weeks ago

Description

When running ordhook scan without the --config-path flag, it seems we never considered the case where scanning from the archive should also post BRC20 activity.

The current assumption for getting BRC20 activity from Ordhook is to update the Ordhook.toml file with the following:

[meta_protocols]
brc20 = true

And assuming you have a brc20.sqlite located inside your project, ordhook/brc20.sqlite, you should be able to successfully run the following command and see BRC20 activity posted to your designated API:

ordhook scan blocks --blocks 779832,779833,779834,779835 --post-to=http://localhost:3000/api/events --config-path=Ordhook.toml

Since we are passing in the --config-path flag, this also requires the user to be running a Bitcoin node, even if they have the BRC20 data available via the archive (brc20.sqlite).

Possible Solutions

1. Add a flag for including metaprotocols

Implement a new flag (e.g., --metaprotocols=brc20) that can be used with the ordhook scan --mainnet command. This flag would:

2. Enhance the --config-path flag

Modify the --config-path flag to allow selective usage of configurations. For instance: