You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wownero-ng/README.md

3.7 KiB

wownero-ng

This is a version of Wownero that is easier to integrate for third-party applications.

Support: Linux only for now

Example

cmake -Bbuild .
make -Cbuild -j12
sudo make -Cbuild install 

wownero-ng will be installed to /usr/local/, including a CMake config, which then allows:

cmake_minimum_required(VERSION 3.25)
set(CMAKE_VERBOSE_MAKEFILE ON)

project(test)

set(CMAKE_CXX_STANDARD 17)

find_package(Wownero 11.1.0 REQUIRED)
add_executable(test main.cpp)

target_link_libraries(removeme PUBLIC wownero::mnemonics)
#include "mnemonics/electrum-words.h"
#include "mnemonics/language_base.h"

using namespace std;
int main() {
  //auto x = crypto::ElectrumWords::get_language_list();
  vector<string> language_list;
  crypto::ElectrumWords::get_language_list(language_list);

  for(const auto &lang: language_list) {
    cout << lang << "\n";
  }
}

Static builds

Add -DSTATIC=1 to the CMake config statement.

You'll need these dependencies in the static version:

#!/bin/bash
#run as root/sudo

export OPENSSL_ROOT_DIR=/usr/local/openssl/
export CFLAGS="-fPIC"
export CPPFLAGS="-fPIC"
export CXXFLAGS="-fPIC"

# boost
wget https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz
tar -xzf boost_1_73_0.tar.gz
pushd boost_1_73_0
./bootstrap.sh
./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="-fPIC" cxxflags="-fPIC" install -a --prefix=/usr/local/
popd
rm -rf boost_1_73_0

# openssl
wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz
tar -xvf openssl-1.1.1i.tar.gz
rm -xvf openssl-1.1.1i.tar.gz
pushd openssl-1.1.1i
./config no-shared no-dso --prefix=/usr/local/openssl
make -j8
make install
popd
rm -rf openssl-1.1.1i

# expat
wget https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.bz2
tar -xf expat-2.4.8.tar.bz2
rm expat-2.4.8.tar.bz2
pushd expat-2.4.8
./configure --enable-static --disable-shared --prefix=/usr/local/expat/
make -j8
make -j8 install
popd
rm -rf expat-2.4.8

# libunbound
wget https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.2.tar.gz
tar -xzf unbound-1.16.2.tar.gz
rm unbound-1.16.2.tar.gz
pushd unbound-1.16.2
./configure --disable-shared --enable-static --without-pyunbound --with-libexpat=/usr/local/expat/ --with-ssl=/usr/local/openssl/ --with-libevent=no --without-pythonmodule --disable-flto --with-pthreads --with-libunbound-only --with-pic
make -j8
make -j8 install
popd
rm -rf unbound-1.16.2

# zmq
git clone -b v4.3.2 --depth 1 https://github.com/zeromq/libzmq
pushd libzmq
git reset --hard a84ffa12b2eb3569ced199660bac5ad128bff1f0
./autogen.sh
./configure --disable-shared --enable-static --disable-libunwind --with-libsodium
make -j8
make -j8 install
popd
rm -rf libzmq

# zlib
git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib
pushd zlib
git reset --hard cacf7f1d4e3d44d871b605da3b647f07d718623f
./configure --static --prefix=/usr/local/zlib
make -j8
make -j8 install
popd
rm -rf zlib

# libusb
git clone -b v1.0.23 --depth 1 https://github.com/libusb/libusb
pushd libusb
git reset --hard e782eeb2514266f6738e242cdcb18e3ae1ed06fa
./autogen.sh --disable-shared --enable-static
make -j8
make -j8 install
popd
rm -rf libusb

# libsodium
# on ubuntu, `libsodium-dev` already comes with a static .a

# miniupnp
git clone -b miniupnpc_2_2_1 --depth 1 https://github.com/miniupnp/miniupnp.git
pushd miniupnp/miniupnpc
git reset --hard 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0
cmake -Bbuild -DUPNPC_BUILD_STATIC=1 -DUPNPC_BUILD_SHARED=OFF -DUPNPC_BUILD_TESTS=OFF -DUPNPC_BUILD_SAMPLE=OFF .
sudo make -Cbuild -j8 install
popd
rm -rf miniupnp