hirosystems / ordhook

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

Understanding BRC-20 indexing #329

Closed GuutBoy closed 3 months ago

GuutBoy commented 4 months ago

I see that in a recent release you added BRC-20 indexing, and I see there is a brc20.sqlite database in the data directory now. But is brc-20 data also included in the data posted by ordhook to the http endpoint? Because I cant really find that.

rafaelcr commented 4 months ago

That's correct @GuutBoy but we still need to update the README for that. To receive BRC-20 data in your predicates, you should add the meta_protocols key like so:

            "if_this": {
                "scope": "ordinals_protocol",
                "operation": "inscription_feed",
                "meta_protocols": ["all"]
            },

If you're only interested in BRC-20 transactions and not the rest of ordinals set it to brc20 instead of all

GuutBoy commented 3 months ago

This is not clear to me. Where do I add this? In the config file?

rafaelcr commented 3 months ago

@GuutBoy you should add this to your .toml file so ordhook indexes BRC-20

[meta_protocols]
brc20 = true

Then, when getting data through a predicate, add the meta_protocols key like this

"if_this": {
    "scope": "ordinals_protocol",
    "operation": "inscription_feed",
    "meta_protocols": ["all"]
},
GuutBoy commented 3 months ago

Sorry, I am not sure what "getting data through a predicate" means. Ordhook just POSTs a bunch of json to an end point?

GuutBoy commented 3 months ago

I guess maybe I am using ordhook wrong 😅

rafaelcr commented 3 months ago

@GuutBoy take a look at this Chainhook README which will explain how to use predicates, etc. This also applies to ordhook