Cronos EVM Docs
  • Getting Started
    • Getting Started
    • Background
    • Architecture
    • Cronos roadmap
  • FOR USERS
    • 💳Crypto.com Card Top Up
    • 🔥Crypto Wallets
    • 🦊MetaMask Configuration
    • 🦁Brave Wallet
    • 🌉Bridges
      • From the Crypto.com App and Exchange
        • From the Crypto.com App
        • From the Crypto.com Exchange
      • IBC (Cronos POS Chain, other Cosmos chains)
        • Cronos Bridge Web App
      • Independent bridges
      • FAQs for Bridge transfers
      • FAQs for transactions from/to centralized exchanges
    • 🚰Testnet Faucet
    • 💡Tips & FAQs
    • 👮Key Principles for Wallet Security
    • GasTracker
  • FOR DAPP DEVELOPERS
    • 💡Founder FAQs
    • 🏅Hacker's Getting Started Resources
    • 📃Smart Contracts
      • Contract Development on Testnet
      • Contract Deployment and Verification
      • Contract Verification Export: Cronoscan To Cronos Explorer
      • Best Practices
      • Token Contract Addresses
    • 💻dApp Creation
      • Free and commercial RPC endpoints
      • Wallet integrations
      • Web3-wallet
      • JSON-RPC methods
      • Address Conversion
      • Swagger Playground
    • ⚙️Dev Tools & Integrations
      • All dev tools & integrations
      • Account Abstraction
      • Band Protocol
      • Banxa
      • GoldRush
      • Cronos Safe
      • Flair
      • Google Bigquery
      • Moralis
      • Pyth
      • Secret Network
      • SubQuery
      • Witnet
    • Crypto.com AI Agent SDK
  • FOR NODE HOSTS
    • Running nodes
      • Cronos Mainnet
        • Quicksync
        • State-sync
        • Public Node Sync
        • KSYNC
        • The "Huygen" upgrade guide (v0.6.* to v0.7.*)
        • The "v0.7.0-hotfix" upgrade guide (v0.7.* to v0.8.*)
        • The "Galileo" upgrade guide (v0.8.* to v1.0.*)
        • The "Titan" upgrade guide (v1.0.* to v1.1.0)
        • The "v1.2" upgrade guide (v1.1.* to v1.2.0)
        • The "v1.3" upgrade guide (v1.2.* to v1.3.0)
        • The "v1.4" Pallene upgrade guide (v1.3.* to v1.4.1)
        • Patching Unlucky & Duplicate Tx
      • Cronos Testnet
      • Devnet
      • Best Practices
      • Cronosd build with Nix
      • VersionDB
      • MemIAVL
      • Local State Sync
    • Cronosd
  • CRONOS PLAY
    • Introduction
    • Unity Engine
      • Current Version
      • Legacy Version
        • EVM
        • Login Example
        • Custom RPC
        • ERC20
        • ERC721
        • ERC1155
      • Useful Links
    • Unreal Engine
      • Installation and Enabling
      • Working with Blueprint
        • Actors and Blueprint Classes
        • Cronos Configuration
        • Connect Defi Desktop/Onchain Wallet with URI
        • Connect Wallets with QR Code
        • Connect WalletConnect Step by Step
        • WalletConnect 2.0 and Unreal Engine 5: Hello World Example
        • Wallet
        • ERC20
        • ERC721
        • ERC1155
        • Broadcast Transactions
        • Get Tokens or Transactions
      • Working with C++
        • Creating a C++ Project
        • Creating a child DefiWalletCoreActor
        • Querying a contract
        • Customizing Network
      • Demo
    • Cronos Play C++ SDK
    • Crypto.com Pay Integration
    • Cronos Play FAQ
  • Block Explorers
    • Block Explorer and API Keys
    • Cronos Explorer
    • Cronoscan
  • CRONOS CHAIN PROTOCOL
    • Chain ID and Address Format
    • Cronos General FAQ
    • Genesis
    • Modules
      • module_bank
      • module_distribution
      • module_slashing
      • module_feemarket
    • Chain Details
      • List of parameters
      • Technical glossary
      • Protocol Documentation
    • Common IBC Commands
  • Cronos zkEVM
    • Cronos zkEVM
  • Resources
    • Media / brand kit
Powered by GitBook
On this page
  • Prerequisites
  • Build Type Matrix
  • Creating a reproducible build
  • Tarball Content

Was this helpful?

Edit on GitHub
  1. FOR NODE HOSTS
  2. Running nodes

Cronosd build with Nix

PreviousBest PracticesNextVersionDB

Last updated 6 months ago

Was this helpful?

It is also possible to reproducibly build cronosd binaries locally yourself using nix.

Prerequisites

  • Install nix, following the instructions here:

  • Install cachix and enable cronos binary cache:

    nix-env -iA cachix -f https://cachix.org/api/v1/install
    cachix use cronos
    

Build Type Matrix

Below are listed the different possible parameters

  • 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.

Creating a reproducible build

The package name is constructed by joining the above three properties with a separator -, omitting the default values, for example:

  • cronosd: defaults to the mainnet rocksdb nix package.

  • cronosd-tarball: mainnet rocksdb re-distributable tarball.

  • cronosd-goleveldb-tarball: mainnet goleveldb re-distributable tarball.

  • cronosd-testnet-goleveldb-tarball: testnet goleveldb re-distributable tarball.

The nix flake url is: 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.8.1 rocksdb mainnet re-distributable tarball is:

nix build github:crypto-org-chain/cronos/v0.8.1#cronosd-tarball

result -> /nix/store/dlhqc2ii8jj1ryrgki90l6j92r2by06g-bundle-cronosd-v0.8.1

The result will reside in ./result by default, 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 dependencies are needed.

mkdir tmp/cronosd
tar xfz ./result -C /tmp/cronosd/

If you get error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override, e.g. by adding: --extra-experimental-features nix-command --extra-experimental-features flakes

Tarball Content

To keep the tarball redistributable, it has all the runtime dependencies included, the dynamic linker, and the shared libraries. They are located in a relative path, so it's important that the whole package is moved together.

  • bin/cronosd: the entry point, it's a wrapper script that executes the binary using the included dynamic linker.

  • exe/cronosd: the executable.

  • lib/: all the shared libraries.

https://nixos.org/download.html