ordhook icon indicating copy to clipboard operation
ordhook copied to clipboard

Extend auto-download of missing `cache/hord.sqlite` when using hord as a service

Open ryanwaits opened this issue 2 years ago • 4 comments

description

the single binary hord scan works as expected by downloading the cache/hord.sqlite if it does not exist, but when trying to spin up hord as a service and stream ordinal activity for the first time (if the file does not exist yet) we get an error

"FATAL: could not find cache/hord.sqlite"

the current workaround for anyone trying to stream ordinal activity is to first run the default binary, something like hord scan blocks 767430 767753 --mainnet which will download the cache/hord.sqlite if it does not exist yet.

expected behavior

run the hord service start commands and if cache/hord.sqlite does not exist auto-download - if it does exist, use it.

actual results

error: "FATAL: could not find cache/hord.sqlite"

ryanwaits avatar Aug 14 '23 18:08 ryanwaits

@lgalabru Thoughts on this one?

chresko avatar Aug 21 '23 14:08 chresko

Hello @ryanwaits !

The hord.sqlite db file is generated upon the start of hord as a service. An empty file is created to make possible the service running.

Can you please detail which branch are you using? Or if possible, can you please update your code and try to run the service again. Thanks!

csgui avatar Aug 29 '23 13:08 csgui

@csgui I'm on v2.1.0 (latest release), I can still reproduce this error

0x8f701 avatar Apr 03 '24 07:04 0x8f701

ordhook scan blocks --post-to=http://localhost:1337/api/events --config-path=./Ordhook.toml  --interval 1:10
[storage]
working_dir = "ordhook"

# The Http Api allows you to register / deregister
# dynamically predicates.
# Disable by default.
#
# [http_api]
# http_port = 20456

[network]
mode = "devnet"
bitcoind_rpc_url = "http://127.0.0.1:18443"
bitcoind_rpc_username = "devnet"
bitcoind_rpc_password = "devnet"
# Bitcoin block events can be received by Chainhook
# either through a Bitcoin node's ZeroMQ interface,
# or through the Stacks node. Zmq is being
# used by default:
bitcoind_zmq_url = "tcp://127.0.0.1:30001"
# but stacks can also be used:
# stacks_node_rpc_url = "http://0.0.0.0:20443"

[resources]
ulimit = 2048
cpu_core_available = 16
memory_available = 32
bitcoind_rpc_threads = 4
bitcoind_rpc_timeout = 15
expected_observers_count = 1
max_caching_memory_size_mb = 1024

# Disable the following section if the state
# must be built locally
# [snapshot]
# download_url = "https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest"

[logs]
ordinals_internals = true
chainhook_internals = true

0x8f701 avatar Apr 03 '24 07:04 0x8f701