-
Notifications
You must be signed in to change notification settings - Fork 262
Reproducible Build With Nix
yihuang edited this page May 9, 2022
·
10 revisions
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 seperator -
, omitting the default one, for example:
-
cronosd
meansmainnet
rocksdb
nix package. -
cronosd-tarball
meansmainnet
rocksdb
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 needed.