Granola-Team / mina-indexer

The Mina Indexer is a re-imagined version of the software collectively called the "Mina archive node."
Apache License 2.0
18 stars 10 forks source link

Undo reversion of PR 1250 #1252

Closed robinbb closed 2 months ago

robinbb commented 2 months ago

@Isaac-DeFrain the PR produces new faulty behaviour with 'db-version', which is supposed to tell the database version, but now gives:

Unable to connect to the Unix domain socket server: No such file or directory (os error 2)

It is important that no server exist when that command is run.

robinbb commented 2 months ago

Note that in your original PR, the following command line options should not have appeared in 'database' commands, since they are offline commands:

      --web-hostname <WEB_HOSTNAME>
          Web server hostname for REST and GraphQL [default: localhost]
      --web-port <WEB_PORT>
          Web server port for REST and GraphQL [default: 8080]
robinbb commented 2 months ago
Create a new mina indexer database to use with `mina-indexer start`

Usage: mina-indexer database create [OPTIONS] [GENESIS_CONSTANTS] [CONSTRAINT_SYSTEM_DIGESTS]... [-- <PID>]

Arguments:
  [GENESIS_CONSTANTS]             Path to the genesis constants (JSON)
  [CONSTRAINT_SYSTEM_DIGESTS]...  Override the constraint system digests
  [PID]                           Indexer process ID

It is impossible to dictate a process ID, so that should not be taken as an argument.

robinbb commented 2 months ago

This diff against the original PR causes tier3 to work:

--- a/ops/helpers.rb
+++ b/ops/helpers.rb
@@ -95,9 +95,10 @@ end

 # Database directory

-v = JSON.parse(`#{EXE_SRC} db-version`)
-DB_VERSION_JSON = v
-DB_VERSION = v['major'].to_s + '.' + v['minor'].to_s + '.' + v['patch'].to_s
+# v = JSON.parse(`#{EXE_SRC} db-version`)
+# DB_VERSION_JSON = v
+# DB_VERSION = v['major'].to_s + '.' + v['minor'].to_s + '.' + v['patch'].to_s
+DB_VERSION = "0.7.2"

 def db_dir(block_height)
   BASE_DIR + '/db/' + DB_VERSION + '-' + block_height.to_s

So, also just making 'mina-indexer db-version' should work, too.

robinbb commented 2 months ago

I could also push the above hack on top of the reversion to this reversion while 'mina-indexer db-version' gets fixed?