hirosystems / ordhook

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

Update getting-started steps #130

Closed sabbyanandan closed 1 year ago

sabbyanandan commented 1 year ago

After a series of trial and error, I still cannot get hord up and running locally.

It appears SQLite, Redis and RosckDB .. either all are optional or everything is required?? At least from the errors, SQLite appears to be a requirement.

Errors:

╭─sabbyanandan ~/hiro/hord ‹develop●›
╰─$ hord scan inscription 6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0 --mainnet
thread 'main' panicked at 'FATAL: could not find /Users/sabbyanandan/hiro/hord/cache/hord.sqlite', components/hord-cli/src/db/mod.rs:171:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
╭─sabbyanandan ~/hiro/hord ‹develop●›
╰─$ hord scan blocks 100 111 --post-to=http://localhost:3000/api/events --config-path=./Hord.toml
Jul 19 20:24:14.705 INFO Streaming blocks from bitcoind http://localhost:18443/
thread 'main' panicked at 'FATAL: could not find cache/hord.sqlite', components/hord-cli/src/db/mod.rs:171:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

And with Redis running locally at 6379, I uncommented database_uri = "redis://localhost:6379/" in Hord.toml, and when running the DB check, I ended up with a RocksDB error.

╭─sabbyanandan ~/hiro/hord ‹develop●›
╰─$ hord db check --config-path ./Hord.toml
Jul 19 20:31:21.845 ERRO unable to open blocks_db: IO error: No such file or directory: While opening a file for sequentially reading: cache/hord.rocksdb/CURRENT: No such file or directory

Overall, I am entirely confused. I can't understand what is required to get hord up and running.

lgalabru commented 1 year ago

Thanks for testing @sabbyanandan. Resolving this issue should fix the flow that you're trying to experience: https://github.com/hirosystems/devops/issues/1213#issuecomment-1642958582

lgalabru commented 1 year ago

@sabbyanandan with the file mentioned above back online, and a few additional adjustments, I think we should be in a better place with the first impression. Feel free to close or add to this issue if you see some details that can be improved.

sabbyanandan commented 1 year ago

Okay, things are in the right direction. Although, I had to run into a DB corrupt situation when I locked my laptop.

=> https://archive.hiro.so/mainnet/chainhooks/hord.sqlite.gz
Jul 20 21:43:20.451 INFO Unable to retrieve hord.sqlite file locally
Jul 20 21:43:20.451 INFO Downloading https://archive.hiro.so/mainnet/chainhooks/hord.sqlite.gz
Jul 20 21:43:20.846 INFO [>.....................................] (0/4800001704)
^[[CJul 20 21:45:05.642 INFO [===>..................................] (480016039/4800001704)
Jul 20 21:46:48.861 INFO [=======>..............................] (960001703/4800001704)
Jul 20 21:48:32.666 INFO [===========>..........................] (1440003751/4800001704)
Jul 20 21:50:18.000 INFO [===============>......................] (1920005799/4800001704)
Jul 20 21:52:04.130 INFO [===================>..................] (2400007847/4800001704)
Jul 20 21:53:50.048 INFO [======================>...............] (2880009895/4800001704)
Jul 20 21:54:29.085 ERRO Error while downloading file
╭─sabbyanandan ~/hiro/hord ‹develop●›
╰─$ hord scan blocks 100 111 --post-to=http://localhost:3000/api/events --config-path=./Hord.toml
Jul 20 22:19:39.705 INFO A fully synchronized bitcoind node is required for retrieving inscriptions content.
Jul 20 22:19:39.706 INFO Checking http://localhost:18443/...
Jul 20 22:19:39.711 INFO Starting scan
Jul 20 22:19:39.711 INFO Streaming blocks from bitcoind http://localhost:18443/
Jul 20 22:19:39.711 INFO Starting predicate evaluation on Bitcoin blocks
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malformed"))', components/hord-cli/src/db/mod.rs:442:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

But the initial issue is resolved. Closing it for now.

sabbyanandan commented 1 year ago

Btw, @lgalabru, I proposed https://github.com/hirosystems/hord/pull/134 to polish the intro, but the general steps can be improved eventually also.