hirosystems / chainhook

Extract transactions from Stacks and Bitcoin and build event driven re-org resistant indexers and databases.
GNU General Public License v3.0
144 stars 57 forks source link

can't match any ordinals when using chainhook predicates scan #409

Closed Hodgewhj closed 1 year ago

Hodgewhj commented 1 year ago

when starting chainhook to scan btc ordinals, there seems to be not match any data.

here is predicate json file:

{
  "uuid": "1",
  "name": "Hello Ordinals",
  "chain": "bitcoin",
  "version": 1,
  "networks": {
      "mainnet": {
          "start_block": 777534,
          "end_block": 777540,
          "if_this": {
              "scope": "ordinals_protocol",
              "operation": "inscription_feed"
          },
          "then_that": {
              "file_append": {
                  "path": "ordinals.txt"
              }
          }
      }

  }
}

start command is :

chainhook predicates scan hello-ordinals.json  --config-path ./Chainhook.toml
image

I also try another range below startblock 767430 end block 767753

image image
qustavo commented 1 year ago

Which bitcoind version are you using? I believe you are on v22.x or below?

Hodgewhj commented 1 year ago

Which bitcoind version are you using? I believe you are on v22.x or below? yes, i check the bitcoind version and found is v22.0.0. which version should i use? thanks a lot !

image

qustavo commented 1 year ago

try to update to v23+. This might be related to https://github.com/hirosystems/chainhook/issues/405

Hodgewhj commented 1 year ago

try to update to v23+. This might be related to #405

got it, thanks a lot for your reply. i will try it and see if works

Hodgewhj commented 1 year ago

try to update to v23+. This might be related to #405 i updated the bitcoind version to v25.0.0 and tried again. the result is blew, there seems not to change

image
qustavo commented 1 year ago

interesting, just to be 100% sure that your running version is 23+, could you run bitcoin-cli getnetworkinfo?

Hodgewhj commented 1 year ago

bitcoin-cli getnetworkinfo yes, i run the command, and the network seem to be normal , i also telnet port 8332 and 18543 which metioned in the doc: https://github.com/hirosystems/chainhook/blob/augment-get-chainhooks/docs/how-to-guides/how-to-run-chainhook-as-a-service-using-bitcoind.md

image image
qustavo commented 1 year ago

version still returns 22 (see version and subversion). Did you restart the deamon after upgrading?

Hodgewhj commented 1 year ago

version still returns 22 (see version and subversion). Did you restart the deamon after upgrading? yes, you are right, i updated the version but forgot to restart. but still exists some problems

when the range : startblock 767430 end block 767753

image

when the range: startblock:807430, end block:860000 seems can't fetch and parse block

image
Hodgewhj commented 1 year ago

version still returns 22 (see version and subversion). Did you restart the deamon after upgrading?

guess maybe i configure wrong somewhere, do you need other configurations or node status?

Hodgewhj commented 1 year ago

version still returns 22 (see version and subversion). Did you restart the deamon after upgrading?

i seem to know the reason why range 807430 to 860000 occur error, cause the btc node sync height is 806309.

i readjust the range , the problem now is that, still can't match any ordinals data

image
qustavo commented 1 year ago

@Hodgewhj from what I see, you upgraded your bitcoind software, but you are still running the old version, hence the /Satoshi:22.0.0 subversion. The problem you are having is due to a missing field returned by the bitcoind rpc api. That field has been added on newer versions, and this is why you should upgrade. Try restarting your bitcoin node with the upgraded software and check if that does the job.

Hodgewhj commented 1 year ago

bitcoin-cli getnetworkinfo yeah, i know what you mean, the first time you said , i have restart the node, and the version is 25.0

image
qustavo commented 1 year ago

cool, and that fixed the initial error retrieving prevout?

Hodgewhj commented 1 year ago

cool, and that fixed the initial error retrieving prevout?

yeah,the error is fixed !!!

Hodgewhj commented 1 year ago

cool, and that fixed the initial error retrieving prevout?

now,it throw no error and scan no things ,😭

sabbyanandan commented 1 year ago

@Hodgewhj: Thanks for opening the issue. And @qustavo, appreciate your support in the community.

As for,

now,it throw no error and scan no things ,😭

@Hodgewhj: Likely, the criteria you're trying to scan for the event aren't reconciling correctly, or no matching events exist in the network. Could you share your latest predicate JSON?

Hodgewhj commented 1 year ago

@Hodgewhj: Thanks for opening the issue. And @qustavo, appreciate your support in the community.

As for,

now,it throw no error and scan no things ,😭

@Hodgewhj: Likely, the criteria you're trying to scan for the event aren't reconciling correctly, or no matching events exist in the network. Could you share your latest predicate JSON?

thanks for your reply, the predicate json is below, i copy it from the chainhook project test module, i only change the append file path.

{ "uuid": "1", "name": "Hello Ordinals", "chain": "bitcoin", "version": 1, "networks": { "mainnet": { "start_block": 777534, "end_block": 777540, "if_this": { "scope": "ordinals_protocol", "operation": "inscription_feed" }, "then_that": { "file_append": { "path": "ordinals.txt" } } }

} }

image
Hodgewhj commented 1 year ago

@Hodgewhj: Thanks for opening the issue. And @qustavo, appreciate your support in the community.

As for,

now,it throw no error and scan no things ,😭

@Hodgewhj: Likely, the criteria you're trying to scan for the event aren't reconciling correctly, or no matching events exist in the network. Could you share your latest predicate JSON?

i guess if the condition related to bitcoind configuration, such as zeromq, i don't know exactly the function of the point, i just configure it, and now it can be telnet

image
lgalabru commented 1 year ago

hey @Hodgewhj, when working with ordinals, you should be using ordhook instead. Feel free to re-open an issue in the repo mentioned above if you're facing some issues.