From 308a5a65eafff1b38e63bb6fca6e84e8e1e7d14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Ren=C3=A9=20Rideau?= Date: Fri, 19 Jul 2024 08:29:31 -0400 Subject: [PATCH] Nix Update (#39) * Nix update * Update README.md --------- Co-authored-by: Mihailo Milenkovic --- README-nix.md | 21 ++++++++++++++++++ README.md | 61 +++++++++++++++++++++++++++++++-------------------- pkgs.nix | 5 +++-- shell.nix | 1 + 4 files changed, 62 insertions(+), 26 deletions(-) diff --git a/README-nix.md b/README-nix.md index 9145e90d67..07f469359f 100644 --- a/README-nix.md +++ b/README-nix.md @@ -58,3 +58,24 @@ that would be used by Nix, you may enter a nix shell as follows: ```shell nix-shell ``` + +You may then configure with the following command: +```bash +configurePhase +``` + +And build with this one: +```bash +buildPhase +``` + +Finally, you can run the tests with: +```bash +checkPhase +``` + +The `./src/` directory will have been added to your `PATH` +so you can run commands simply with: +```bash +elements-cli -? +``` diff --git a/README.md b/README.md index ba8791a311..8d9501d1b4 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,56 @@ -Sequentia Project blockchain platform -==================================== +# Sequentia Project blockchain platform +Sequentia is a Bitcoin sidechain dedicated to asset tokenization and decentralized exchanges. https://sequentia.io/ -Sequentia is a Bitcoin sidechain dedicated to asset tokenization and decentralized exchanges. - Current code is based on Elements Version: 23.2.1 -Quick Ubuntu build instructions for development: ------ +## Installing Prerequisistes -Install build tools +### Install build tools +On Ubuntu (and probably Debian), you should be able to install the prerequisite +build tools with the following command: ```bash sudo apt install ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 ``` -Setup ccache: +YMMV on other software distributions. + +### Setup ccache +You may achieve speedups when building and rebuilding by using ccache, +that you may install and configure as follows: ```bash sudo /usr/sbin/update-ccache-symlinks echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc source ~/.bashrc ``` -Build: + +## Configure and Build + +### Prepare configuration + ```bash ./autogen.sh make -j$(nproc) -C depends NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 export CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site NOWARN_CXXFLAGS='-Wno-deprecated -Wno-unused-result' +``` + +### Configure +```bash ./configure --enable-any-asset-fees --enable-debug --disable-bench --disable-tests --disable-fuzz-binary -make -j$(nproc) ``` -Modes ------ +Note that the `--enable-any-asset-fees` flag is an addition by Sequentia, +that will configure RPC documentation to denominate fee rates +using RFU and rfa instead of BTC and sat. + +### Last But Not Least, Build +```bash +make -j$(nproc) +``` -Elements supports a few different pre-set chains for syncing. Note though some are intended for QA and debugging only: +## Modes +Elements supports a few different pre-set chains for syncing. +Note though some are intended for QA and debugging only: * Liquid mode: `elementsd -chain=liquidv1` (syncs with Liquid network) * Bitcoin mainnet mode: `elementsd -chain=main` (not intended to be run for commerce) @@ -40,8 +58,7 @@ Elements supports a few different pre-set chains for syncing. Note though some a * Bitcoin regtest mode: `elementsd -chain=regtest` * Elements custom chains: Any other `-chain=` argument. It has regtest-like default parameters that can be over-ridden by the user by a rich set of start-up options. -Confidential Assets ----------------- +## Confidential Assets The latest feature in the Elements blockchain platform is Confidential Assets, the ability to issue multiple assets on a blockchain where asset identifiers and amounts are blinded yet auditable through the use of applied cryptography. @@ -52,10 +69,9 @@ and amounts are blinded yet auditable through the use of applied cryptography. * [Confidential Assets Demo](https://github.com/ElementsProject/confidential-assets-demo) * [Elements Code Tutorial](https://elementsproject.org/elements-code-tutorial/overview) covering blockchain configuration and how to use the main features. -Features of the Elements blockchain platform ----------------- +## Features of the Elements blockchain platform -Compared to Bitcoin itself, it adds the following features: +Compared to Bitcoin itself, Elements adds the following features: * [Confidential Assets][asset-issuance] * [Confidential Transactions][confidential-transactions] * [Federated Two-Way Peg][federated-peg] @@ -75,8 +91,7 @@ Additional RPC commands and parameters: The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically. -License -------- +## License Elements is released under the terms of the MIT license. See [COPYING](COPYING) for more information or see http://opensource.org/licenses/MIT. @@ -87,14 +102,12 @@ information or see http://opensource.org/licenses/MIT. [asset-issuance]: https://elementsproject.org/features/issued-assets [schnorr-signatures]: https://elementsproject.org/features/schnorr-signatures -What is the Elements Project? ------------------ +## What is the Elements Project? Elements is an open source, sidechain-capable blockchain platform. It also allows experiments to more rapidly bring technical innovation to the Bitcoin ecosystem. Learn more on the [Elements Project website](https://elementsproject.org) https://github.com/ElementsProject/elementsproject.github.io -Secure Reporting ------------------- +## Secure Reporting See [our vulnerability reporting guide](SECURITY.md) diff --git a/pkgs.nix b/pkgs.nix index dc372f5404..502d7ec1b1 100644 --- a/pkgs.nix +++ b/pkgs.nix @@ -9,8 +9,8 @@ let nixpkgs-gerbil = systemPkgs.fetchFromGitHub { owner = "MuKnIO"; repo = "nixpkgs"; - rev = "b34dfaf64b324157ee3bed43b319f947ca4e93f1"; - sha256 = "sha256-sY1OtbCe4bYA8/izsR+wMCP+25QvGeeHe6H9eJ3FF0U="; + rev = "3494555347ea7c4c2a273b5308cde2d8f30424ea"; + sha256 = "sha256-0Rlh/mUFi3s3flhlDK0WSb0TPD0MAiHcRrHq15I6Sso="; }; pg = import nixpkgs-gerbil {}; pkgs = import nixpkgs-repo { @@ -71,6 +71,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-boost-libdir=${boost.out}/lib" "--disable-bench" + "--enable-any-asset-fees" ] ++ lib.optionals (!doCheck) [ "--disable-tests" "--disable-gui-tests" diff --git a/shell.nix b/shell.nix index 8677160cba..6534541370 100644 --- a/shell.nix +++ b/shell.nix @@ -14,6 +14,7 @@ in pkgs.mkShell { # Until gerbil-support includes static compilation objects, # let's not use gerbilLoadPath and instead copy the sources into the writable GERBIL_PATH. shellHook = '' + export PATH=$PWD/src:$PATH export GERBIL_PATH=$PWD/.gerbil mkdir -p $GERBIL_PATH chmod -R u+w .gerbil