safex / safexcore

reference implementation of Safex Blockchain in C++
Other
28 stars 28 forks source link
blockchain cryptocurrency ecommerce safex

Safex Project

Releases

Network has performed hard fork 6 with Fix for token overflow issue, Wallet fix and other bug fixes. Current hard fork ready release of Ubuntu, Windows and Mac safexd node binaries and source code is available here.

Build Test

Build Instructions

MacOS

Check if you have Developer Tools Installed

$ xcode-select -p

If you don't have Developer Tools, install it. If you do, skip this step

$ xcode-select --install

Clone the git repository with recursive

$ git clone --recursive https://github.com/safex/safexcore.git

Go into safexcore folder

$ cd safexcore

Check if brew is installed

$ which brew

If you don't have brew installed, install it. If you have it, skip this step

$ brew install wget

Install all libraries

$ brew tap jmuncaster/homebrew-header-only
$ brew install cmake boost zmq czmq zeromq jmuncaster/header-only/cppzmq openssl pkg-config protbuf

You will need to have MacPorts installed. If you don't have it install it from here https://guide.macports.org/. Download the package for your OS version from the website. Open new terminal window and check if MacPorts are installed

$ port version

If the installation was successful, install readline using MacPorts

$ sudo port install readline

Build it and insert the number of cores you have

$ make -j<Your number of cores> debug-all

If you want to build safexd with protobuf support you need to install protobuf build dependency by starting install_protobuf_dep_macos.sh

Ubuntu 18.04

A one liner for installing all dependencies on Ubuntu 18.04 is

$ sudo apt update && sudo apt install build-essential cmake pkg-config \
    libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libminiupnpc-dev \
    libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev \
    libgtest-dev doxygen graphviz libpcsclite-dev libprotobuf-dev

Clone the git repository with recursive

$ git clone --recursive https://github.com/safex/safexcore.git

To build a debug version run:

make -j <Your number of cores> debug-all > build.log

to use all cores.

To build a release version run:

make -j <Your number of cores> release-all > build.log

to use all cores.

Docker

    # Build using all available cores
    docker build -t safex . > docker_build.log

    # or build using a specific number of cores (reduce RAM requirement)
    docker build --build-arg NPROC=1 -t safex . > docker_build.log

    # either run in foreground
    docker run -it -v /safex/chain:/root/.safex -v /safex/wallet:/wallet -p 18080:18080 safex

    # or in background
    docker run -it -d -v /safex/chain:/root/.safex -v /safex/wallet:/wallet -p 18080:18080 safex

Testing

To test the code, run:

$ cd build/debug/tests
$ ctest -j <Your number of cores> -VV > tests.log

On Windows:

Binaries for Windows are built on Windows using the MinGW toolchain within MSYS2 environment. The MSYS2 environment emulates a POSIX system. The toolchain runs within the environment and cross-compiles binaries that can run outside of the environment as a regular Windows application.

Preparing the build environment

Cloning

Building

Running

Built binaries are located in build/debug/bin and/or build/release/bin, depending upon which build was used. To run Ubuntu 18.04 statically built binaries on another machine, libnorm1 and libpcsclite1 libraries must be installed.

To run the node:

$ ./build/debug/bin/safexd --testnet

To run the wallet:

$ /path/to/binaries/safex-wallet-cli --testnet <other wallet parameters>

To list all wallet parameters use:

$ /path/to/binaries/safex-wallet-cli --testnet --help




Copyright (c) 2018 The Safex Project.

Portions Copyright (c) 2014-2018 The Monero Project.

Portions Copyright (c) 2012-2013 The Cryptonote developers.