ordhook icon indicating copy to clipboard operation
ordhook copied to clipboard

posting brc20 activity without `--config-path`

Open ryanwaits opened this issue 1 year ago • 0 comments

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:

  • Trigger the inclusion of BRC20 data.
  • Automatically download the brc20.sqlite file if it is not detected.

2. Enhance the --config-path flag

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

  • Use the [meta_protocols] header from Ordhook.toml.
  • Ignore the Bitcoin node configuration and rely solely on the archive for data.

ryanwaits avatar Jul 08 '24 20:07 ryanwaits