Skip to main content

kwil-admin setup genesis-hash

kwil-admin setup genesis-hash

Compute genesis hash from existing PostgreSQL datasets, and optionally update genesis.json.

Synopsis

Compute the genesis hash from existing PostgreSQL datasets, and optionally update a genesis.json file. It can be configured to connect to Postgres either using the root directory (from which the config.toml will be read), or by specifying the connection details directly.

Alternatively, a snapshot file can be provided to compute the genesis hash from a snapshot file instead of the database. The snapshot can either be a .sql or .sql.gz file.

By default, it will print the genesis hash to stdout. To specify a genesis file to update as well, use the --genesis flag.

kwil-admin setup genesis-hash [flags]

Examples

# Compute the genesis hash from an existing PostgreSQL database using a connection, and add it to a genesis file
kwil-admin setup genesis-hash --dbname kwild --host "127.0.0.1" --port "5432" --user kwild --genesis "~/.kwild/abci/config/genesis.json"

# Compute the genesis hash from an existing PostgreSQL database using the root directory
kwil-admin setup genesis-hash --genesis "~/.kwild/abci/config/genesis.json" --root-dir "~/.kwild"

# Compute the genesis hash from a snapshot file
kwil-admin setup genesis-hash --snapshot "/path/to/snapshot.sql.gz" --genesis "~/.kwild/abci/config/genesis.json"

Options

      --dbname string     Name of the database in the PostgreSQL server (default "kwild")
-g, --genesis string optional path to the genesis file to patch with the computed app hash
-h, --help help for genesis-hash
--host string Host of the database (default "localhost")
--password string Password for the database user
--port string Port of the database (default "5432")
-r, --root-dir string optional path to the root directory of the kwild node from which the genesis hash will be computed
-s, --snapshot string optional path to the snapshot file to use for the genesis hash computation
--user string User with administrative privileges on the database (default "postgres")

Options inherited from parent commands

      --output string   the format for command output - either 'text' or 'json' (default "text")
-S, --silence Silence logs

SEE ALSO

  • kwil-admin setup - The setup command provides functions for creating and managing node configuration and data.