kwil-admin snapshot create
kwil-admin snapshot create
Creates a snapshot of the database.
Synopsis
This command creates a logical snapshot and prepares a genesis.json for a new network based on that snapshot. This command interacts directly with the underlying PostgreSQL server, bypassing any interactions with the kwild node. It requires a database user with superuser privileges.
The snapshots generated by kwild during normal operation are different from the snapshots generated by this tool. This tool is to prepare a new network based on the final state of an existing network, while kwild's snapshots support fast "state sync" for nodes joining an existing network.
kwil-admin snapshot create [flags]
Examples
# Create database snapshot and the genesis file to initialize a new network
# Password is optional if the db is operating in a trust authentication mode.
kwil-admin snapshot create --dbname kwildb --user user1 --password pass1 --host localhost --port 5432 --snapdir /path/to/snapshot/dir
# Snapshot and genesis files will be created in the snapshot directory
ls /path/to/snapshot/dir
genesis.json kwildb-snapshot.sql.gz
Options
--dbname string Name of the database to snapshot (default "kwild")
-h, --help help for create
--host string Host of the database (default "localhost")
--password string Password for the database user
--port string Port of the database (default "5432")
--snapdir string Directory to store the snapshot and hash files (default "kwild-snaps")
--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 snapshot - The
snapshot
command is used to create and manage snapshots.