-
Notifications
You must be signed in to change notification settings - Fork 263
Reproducible Build With Nix
It's possible to reproducibly build cronosd binaries locally using nix.
- Install nix, follow the instructions here: https://nixos.org/download.html
- Install cachix and enable cronos binary cache:
$ nix-env -iA cachix -f https://cachix.org/api/v1/install $ cachix use cronos
- network type
-
mainnet
(default) testnet
-
- db backend
-
rocksdb
(default) goleveldb
-
- build type
- normal nix package (default)
- re-distributable bundle
- re-distributable tarball, the tarball of the above bundle.
The package name is constructed by joining the above properties with separator -
, omitting the default values, for example:
-
cronosd
meansmainnet
rocksdb
nix package. -
cronosd-tarball
meansmainnet
rocksdb
re-distributable tarball. -
cronosd-goleveldb-tarball
meansmainnet
goleveldb
re-distributable tarball. -
cronosd-testnet-goleveldb-tarball
meanstestnet
goleveldb
re-distributable tarball.
The nix flake url is like: github:crypto-org-chain/cronos/$TAG_NAME#$PACKAGE_NAME
, replace the $TAG_NAME
and $PACKAGE_NAME
to the one you needed, for example, the full command to build a v0.7.0
rocksdb
mainnet
re-distributable tarball is:
$ nix build github:crypto-org-chain/cronos/v0.7.0#cronosd-tarball
The result is reside at ./result
by default, then you can copy the tarball to other machines with the same OS and arch.
The re-distributable bundle/tarball has dynamic libraries included, no extra runtime dependency is needed.
To keep the tarball redistributable, it has all the runtime dependencies included, the dynamic linker, and the shared libraries, and they are founded with a relative path, so it's important that the whole package is moved together.
-
bin
, a wrapper script that executes the binary with included dynamic linker. -
exe
, the executable. -
lib
, all the shared libraries.