Provenance uses make
to define build operations.
Built executables are placed in the build/
directory.
Building provenanced
requires Go 1.18+ (or higher).
By default, provenanced
is built with CLevelDB support.
Building without CLevelDB support is also possible. See WITH_CLEVELDB
in Build Options below.
To download, build, and install the C LevelDB library on your system:
$ make cleveldb
Environment variables that can control the behavior of this command:
CLEVELDBDB_VERSION
will install a version other than the one defined in theMakefile
. Do not include thev
at the beginning of the version number. Example:CLEVELDBDB_VERSION=1.22 make cleveldb
. The default is1.23
CLEVELDB_JOBS
will control the number of parallel jobs used to build the library. The default is the result of thenproc
command. More parallel jobs can speed up the build. Fewer parallel jobs can alleviate memory problems/crashes that can be encountered during a build.CLEVELDB_DO_BUILD
defines whether to build cleveldb. The default istrue
.CLEVELDB_DO_INSTALL
defines whether to install cleveldb. The default istrue
.CLEVELDB_SUDO
defines whether to usesudo
for the installation of the built library. The difference betweensudo make cleveldb
andCLEVELDB_SUDO=true make cleveldb
is that the latter will usesudo
only for the installation (the download and build still use your current user). Some systems (e.g. Ubuntu) might require this. The default istrue
if thesudo
command is found, orfalse
otherwise.CLEVELDB_DO_CLEANUP
defines whether to delete the downloaded and unpacked repo when done. The default istrue
.
By default, provenanced
is built without RocksDB support.
Building with RocksDB support is also possible. See WITH_ROCKSDB
in Build Options below.
To download, build, and install the RocksDB library on your system:
$ make rocksdb
Environment variables that can control the behavior of this command:
ROCKSDB_VERSION
will install a version other than the one defined in theMakefile
. Do not include thev
at the beginning of the version number. Example:ROCKSDB_VERSION=6.17.3 make rocksdb
. The default is6.29.4
ROCKSDB_JOBS
will control the number of parallel jobs used to build the library. The default is the result of thenproc
command. More parallel jobs can speed up the build. Fewer parallel jobs can alleviate memory problems/crashes that can be encountered during a build.ROCKSDB_WITH_SHARED
defines whether to build and install the shared (dynamic) library. The default istrue
.ROCKSDB_WITH_STATIC
defines whether to build and install the static library. The default isfalse
.ROCKSDB_DO_BUILD
defines whether to build rocksdb. The default istrue
.ROCKSDB_DO_INSTALL
defines whether to install rocksdb. The default istrue
.ROCKSDB_SUDO
defines whether to usesudo
for the installation of the built library. The difference betweensudo make rocksdb
andROCKSDB_SUDO=true make rocksdb
is that the latter will usesudo
only for the installation (the download and build still use your current user). Some systems (e.g. Ubuntu) might require this. The default istrue
if thesudo
command is found, orfalse
otherwise.ROCKSDB_DO_CLEANUP
defines whether to delete the downloaded and unpacked repo when done. The default istrue
.
To build the provenanced
executable and place it in the build/
directory:
$ make build
To build the provenanced
executable and place it in your system's default Go bin/
directory.
$ make install
To use a specific version of provenanced
, check out that version's tag, then build or install it.
For example:
$ git checkout "v1.7.6" -b "tag-v1.7.6"
$ make install
A few aspects of make build
and make install
can be controlled through environment variables.
WITH_CLEVELDB
: Enables/Disables building with CLevelDB support. The default istrue
. If this is nottrue
the builtprovenanced
, executable will not be able to use CLevelDB as a database backend.LEVELDB_PATH
: Defines the location of the leveldb library and includes. This is only used if compiling with CLevelDB support on a Mac. The default is the result ofbrew --prefix leveldb
.WITH_ROCKSDB
: Enables/Disables building with RocksDB support. The default isfalse
. If this is nottrue
the builtprovenanced
, executable will not be able to use RocksDB as a database backend.WITH_BADGERDB
: Enables/Disables building with BadgerDB support. The default istrue
. If this is nottrue
the builtprovenanced
, executable will not be able to use BadgerDB as a database backend.WITH_LEDGER
: Enables/Disables building with Ledger hardware wallet support. The default istrue
. If this is nottrue
the builtprovenanced
, executable will not work with Ledger hardware wallets.GO
: The GoLang executable. The default isgo
.BINDIR
: The path to the Go binary directory. The default is${GOPATH}/bin
.BUILDDIR
: The path to the directory where the built executable should be placed. The default is./build
.VERSION
: The string to use as the output ofprovenanced version
. The default is{branch name}-{short commit hash}
.BUILD_TAGS
: Any extra-tags
to supply to thego build
orgo install
invocations. These are appended to a list constructed by the Makefile.LDFLAGS
: Any extra-ldflags
to supply to thego build
orgo install
invocations. These are appended to a list constructed by the Makefile.CGO_LDFLAGS
: Anything extra to include in the CGO_LDFLAGS env var when invokinggo build
orgo install
. These are appended to a list constructed by the Makefile.CGO_CFLAGS
: Anything extra to include in the CGO_CFLAGS env var when invokinggo build
orgo install
. These are appended to a list constructed by the Makefile.BUILD_FLAGS
: Any extra flags to include when invokinggo build
orgo install.
. These are appended to a list constructed by the Makefile.
The dbmigrate
utility can be used to migrate a node's data directory to a use a different db backend.
To build the dbmigrate
executable and place it in the build/
directory:
$ make build-dbmigrate
To build the dbmigrate
executable and place it in your system's default Go bin/
directory.
$ make install-dbmigrate
Building dbmigrate
uses the same Build Options as provenanced
.
The dbmigrate program will:
- Create a new
data/
directory, and copy the contents of the existingdata/
directory into it, converting the database files appropriately. - Back up the existing
data/
directory to${home}/data-dbmigrate-backup-{timestamp}-{dbtypes}/
. - Move the newly created
data/
directory into place. - Update the config's
db_backend
value to the new db backend type.
The dbmigrate
utility uses the same configs, environment variables, and flags as provenanced
.
For example, if you have the environment variable PIO_HOME defined, then dbmigrate
will use that as the --home
directory (unless a --home
is provided in the command line arguments).