Skip to content

Commit

Permalink
Merge master into ublocks (nanocurrency#714)
Browse files Browse the repository at this point in the history
* Fix typos (nanocurrency#683)

* Move to C++14

Replaces a single reset with make_unique to see if things compile in CI. Also reverts a CI-specific RPATH change which prevented the wallet from running on macOS dev machines

* Update CMakeLists.txt to support gtest linking for Windows

* Fix test for wallet_create_max to allow for utx database addition (nanocurrency#691)

* Remove unused code (nanocurrency#686)

* Fix docker boost url

* Revert nonWalletDbs 

Revert to fix failing tests

* Improved error handling in message parser (nanocurrency#704)

*  Replacing bool get_optional with get default values (nanocurrency#670)

* Revert "Watch only accounts"

This reverts commit 1b0809a.

* Replacing bool get_optional with get default values

* RPC tests for optional bool values

* RPC tests for wallet_ledger & wallet_add_watch

* Improve account history RPC endpoint (nanocurrency#668)

* Checking ledger::forked_block preconditions which were asserting.

* Update README (nanocurrency#709)

* update docs to add guides and update "what is nano?" system

* add whitepaper to guides and docs

* update features list

* update what is nano header level

* Build of Boost Cleanup (nanocurrency#707)

* Updated to check the boost SHA256 when downloading

* Fixed invalid shell option

* Allow the user to request a minimal build of Boost

* Ensure boost build script exits on error

* Removed apparently unused "mkdir"

* Docker altnets (nanocurrency#708)

* Updated to check the boost SHA256 when downloading

* Fixed invalid shell option

* Allow the user to request a minimal build of Boost

* Ensure boost build script exits on error

* Removed apparently unused "mkdir"

* Updated Docker build for node to support altnets

* Allow user-supplied arguments to "docker build"

* Updated Docker auto deploy to build a live and beta image for each tag

* Print the correct image name when building the docker image

* Corrected typo for the test network

* Broadcasting active elections blocks to discovered representatives (nanocurrency#711)

* Broadcasting active elections blocks

* Improve formatting for clang

* Connecting to rai-beta for beta network.

* Specify beta network representatives (nanocurrency#712)

* Update the beta network configuration (nanocurrency#713)

* Specify beta network representatives

* Update beta network genesis block

* Use port 54000 for beta nodes

* Add history RPC raw support to ublocks

* Fix test for wallet_create_max to allow for utx database addition (nanocurrency#691)
  • Loading branch information
PlasmaPower authored and clemahieu committed Mar 8, 2018
1 parent f5c462a commit 755dae8
Show file tree
Hide file tree
Showing 36 changed files with 1,007 additions and 456 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Expand Up @@ -7,12 +7,8 @@ set (CPACK_PACKAGE_VERSION_PATCH "1")

set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks")
else()
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:\$ORIGIN/")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib:\$ORIGIN/")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

set (RAIBLOCKS_GUI OFF CACHE BOOL "")
set (RAIBLOCKS_TEST OFF CACHE BOOL "")
Expand Down Expand Up @@ -70,7 +66,7 @@ endif (WIN32)
if (WIN32)
set (PLATFORM_CXX_FLAGS "/bigobj")
else (WIN32)
set (PLATFORM_CXX_FLAGS "-std=c++11")
set (PLATFORM_CXX_FLAGS "-std=c++14")
endif (WIN32)

if (WIN32)
Expand Down Expand Up @@ -146,6 +142,11 @@ else ()
set (ARGON_CORE phc-winner-argon2/src/ref.c)
endif ()

if (WIN32)
set (gtest_force_shared_crt ON)
else ()
set (gtest_force_shared_crt OFF)
endif()
add_subdirectory (gtest)
include_directories ("gtest/include")

Expand Down
2 changes: 1 addition & 1 deletion FindBoost.cmake
Expand Up @@ -925,7 +925,7 @@ function(_Boost_MISSING_DEPENDENCIES componentvar extravar)
endfunction()

#
# Some boost libraries may require particular set of compler features.
# Some boost libraries may require particular set of compiler features.
# The very first one was `boost::fiber` introduced in Boost 1.62.
# One can check required compiler features of it in
# `${Boost_ROOT}/libs/fiber/build/Jamfile.v2`.
Expand Down
62 changes: 41 additions & 21 deletions README.md
@@ -1,33 +1,53 @@
<hr />
<div align="center">
<img src="images/logo.svg" alt="Logo" width='300px' height='auto'/>
</div>
<hr />

[![Build Status](https://travis-ci.org/nanocurrency/raiblocks.svg?branch=master)](https://travis-ci.org/nanocurrency/raiblocks)

# What is Nano?
Nano is designed to be a feeless, instant, high throughput cryptocurrency.
### What is Nano?

---

Nano's goal is to become _"a global currency with instantaneous transactions and zero fees over a secure, decentralized network."_

We've applied the philosophy of _"do one thing and do it well"_, we are focused on building the best medium for value exchange in the world.

---

We've applied the philosophy of "do one thing and do it well", giving you performance and scalability unmatched by any other platform.
### Key Features

### Key features
* Nano utilizes a novel block-lattice architecture, unlike conventional blockchains used in many other cryptocurrencies.
* Nano utilizes a novel [block-lattice](https://github.com/nanocurrency/raiblocks/wiki/Block-lattice) architecture, unlike conventional blockchains used in many other cryptocurrencies.
* The network requires minimal resources, no high-power mining hardware, and can process high transaction throughput.
* Offers feeless, instantaneous transactions, as well as unlimited scalability, making Nano ideal for peer-to-peer transactions.
* Offers instantaneous transactions with zero fees and unlimited scalability, making Nano an ideal solution for peer-to-peer transactions.
* As of December 2017, the Nano network has processed over four million transactions with an unpruned ledger size of only 1.7GB.

For more information, see [Nano.org](https://nano.org/) or read the [whitepaper](https://nano.org/en/whitepaper).

### Resources
- [Nano website](https://nano.org)
- [Whitepaper](https://nano.org/en/whitepaper)
- [Roadmap](https://raiblocks.net/media/raiblocks-roadmap-v2-en.png)
- [Discord chat](https://chat.nano.org/)
- [Reddit](https://reddit.com/r/nanocurrency)
- [Medium](https://medium.com/@nanocurrency)
- [Twitter](https://twitter.com/nanocurrency)
- [Forum](https://forum.raiblocks.net/)
- [GitHub wiki](https://github.com/nanocurrency/raiblocks/wiki)

### Build instructions
https://github.com/nanocurrency/raiblocks/wiki/Build-Instructions

### Want to contribute?
### Guides & Documentation

* [White Paper](https://nano.org/en/whitepaper)
* [Build Instructions](https://github.com/nanocurrency/raiblocks/wiki/Build-Instructions)
* [Command Line Interface](https://github.com/nanocurrency/raiblocks/wiki/Command-line-interface)
* [RPC Protocol](https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol)
* [Wallet Design](https://github.com/nanocurrency/raiblocks/wiki/Wallet-design)
* [Block Lattice](https://github.com/nanocurrency/raiblocks/wiki/Block-lattice)
* [Design Features](https://github.com/nanocurrency/raiblocks/wiki/Design-features)

### Links & Resources

* [Nano Website](https://nano.org)
* [Nano Roadmap](https://raiblocks.net/media/raiblocks-roadmap-v2-en.png)
* [Discord Chat](https://chat.nano.org/)
* [Reddit](https://reddit.com/r/nanocurrency)
* [Medium](https://medium.com/@nanocurrency)
* [Twitter](https://twitter.com/nanocurrency)
* [Forum](https://forum.raiblocks.net/)
* [GitHub wiki](https://github.com/nanocurrency/raiblocks/wiki)

### Want to Contribute?

Please see the [contributors guide](https://github.com/nanocurrency/raiblocks/wiki/Contributing).

### Contact us
Expand Down
31 changes: 25 additions & 6 deletions ci/bootstrap_boost.sh
@@ -1,18 +1,37 @@
#!/usr/bin/env bash

set -o unset
set -o nounset
set -o errexit
set -o xtrace

bootstrapArgs=()
while getopts 'm' OPT; do
case "${OPT}" in
m)
bootstrapArgs+=('--with-libraries=atomic,chrono,thread,log,date_time,filesystem,program_options,regex')
;;
esac
done

BOOST_BASENAME=boost_1_66_0
BOOST_ROOT=${BOOST_ROOT-/usr/local/boost}
BOOST_URL=https://downloads.sourceforge.net/project/boost/boost/1.66.0/${BOOST_BASENAME}.tar.bz2
BOOST_ARCHIVE="${BOOST_BASENAME}.tar.bz2"
BOOST_ARCHIVE_SHA256='5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9'

wget --quiet -O "${BOOST_ARCHIVE}.new" "${BOOST_URL}"
checkHash="$(openssl dgst -sha256 "${BOOST_ARCHIVE}.new" | sed 's@^.*= *@@')"
if [ "${checkHash}" != "${BOOST_ARCHIVE_SHA256}" ]; then
echo "Checksum mismatch. Expected ${BOOST_ARCHIVE_SHA256}, got ${checkHash}" >&2

exit 1
fi
mv "${BOOST_ARCHIVE}.new" "${BOOST_ARCHIVE}"

wget --quiet -O ${BOOST_BASENAME}.tar.gz "${BOOST_URL}"
tar xf ${BOOST_BASENAME}.tar.gz
tar xf "${BOOST_ARCHIVE}"
cd ${BOOST_BASENAME}
./bootstrap.sh
./bootstrap.sh "${bootstrapArgs[@]}"
./b2 -d0 --prefix=${BOOST_ROOT} link=static install
cd ..
rm -rf ${BOOST_BASENAME}
rm -f ${BOOST_BASENAME}.tar.gz
mkdir -p app
rm -f "${BOOST_ARCHIVE}"
15 changes: 12 additions & 3 deletions ci/build-docker-image.sh
@@ -1,8 +1,17 @@
#!/bin/bash
set -eu

if [ "$#" -lt 2 ]; then
echo 'Usage: build-docker-image.sh <dockerFile> <dockerImageTag> [<dockerBuildArgs>...]' >&2
exit 1
fi

dockerFile="$1"
dockerTag="$2"
shift; shift

scripts="$(dirname "$0")"

"$scripts"/custom-timeout.sh 20 docker pull "$2" || true
echo "Building $2"
"$scripts"/custom-timeout.sh 30 docker build -f "$1" -t "$2" --cache-from "$2" .
"$scripts"/custom-timeout.sh 20 docker pull "${dockerTag}" || true
echo "Building $dockerTag"
"$scripts"/custom-timeout.sh 30 docker build "$@" -f "${dockerFile}" -t "${dockerTag}" --cache-from "${dockerTag}" .
26 changes: 18 additions & 8 deletions ci/deploy-docker.sh
Expand Up @@ -15,13 +15,23 @@ elif [ -n "$TRAVIS_TAG" ]; then
tags+=("$TRAVIS_TAG" latest)
fi

ci/build-docker-image.sh docker/node/Dockerfile nanocurrency/nano
for tag in "${tags[@]}"; do
# Sanitize docker tag
# https://docs.docker.com/engine/reference/commandline/tag/
tag="$(printf '%s' "$tag" | tr -c '[a-z][A-Z][0-9]_.-' -)"
if [ "$tag" != "latest" ]; then
docker tag nanocurrency/nano nanocurrency/nano:"$tag"
for network in live beta; do
if [ "${network}" = 'live' ]; then
network_tag_suffix=''
else
network_tag_suffix="-${network}"
fi
"$scripts"/custom-timeout.sh 30 docker push nanocurrency/nano:"$tag"

docker_image_name="nanocurrency/nano${network_tag_suffix}"

ci/build-docker-image.sh docker/node/Dockerfile "$docker_image_name" --build-arg NETWORK="${network}"
for tag in "${tags[@]}"; do
# Sanitize docker tag
# https://docs.docker.com/engine/reference/commandline/tag/
tag="$(printf '%s' "$tag" | tr -c '[a-z][A-Z][0-9]_.-' -)"
if [ "$tag" != "latest" ]; then
docker tag "$docker_image_name" "${docker_image_name}:$tag"
fi
"$scripts"/custom-timeout.sh 30 docker push "${docker_image_name}:$tag"
done
done
2 changes: 1 addition & 1 deletion docker/ci/Dockerfile
@@ -1,7 +1,7 @@
FROM ubuntu:16.04

ENV BOOST_BASENAME=boost_1_66_0 \
BOOST_URL=https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.gz/download
BOOST_URL=https://netix.dl.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.gz

RUN apt-get update -qq && apt-get install -yqq \
build-essential \
Expand Down
26 changes: 11 additions & 15 deletions docker/node/Dockerfile
@@ -1,35 +1,31 @@
FROM ubuntu:16.04

ENV BOOST_BASENAME=boost_1_66_0 \
BOOST_ROOT=/tmp/boost_install \
BOOST_URL=https://sourceforge.net/projects/boost/files/boost/1.66.0/boost_1_66_0.tar.gz/download
ARG NETWORK=live

ENV BOOST_ROOT=/tmp/boost_install

ADD ci /tmp/ci

RUN apt-get update -qq && apt-get install -yqq \
build-essential \
cmake \
g++ \
wget && \
wget -qO ${BOOST_BASENAME}.tar.gz ${BOOST_URL} && \
tar xzf ${BOOST_BASENAME}.tar.gz && \
cd ${BOOST_BASENAME} && \
./bootstrap.sh && \
./b2 -d0 --prefix=${BOOST_ROOT} link=static install && \
rm -rf ${BOOST_BASENAME} && \
rm -f ${BOOST_BASENAME}.tar.gz && \
cd .. && \
mkdir /usr/share/raiblocks/
/tmp/ci/bootstrap_boost.sh -m

ADD ./ /tmp/src

RUN mkdir /tmp/build && \
cd /tmp/build && \
cmake /tmp/src -DBOOST_ROOT=${BOOST_ROOT} && \
cmake /tmp/src -DBOOST_ROOT=${BOOST_ROOT} -DACTIVE_NETWORK=rai_${NETWORK}_network && \
make rai_node && \
cd ..
cd .. && \
echo ${NETWORK} > /etc/nano-network

FROM ubuntu:16.04
COPY --from=0 /tmp/build/rai_node /usr/bin
COPY --from=0 /etc/nano-network /etc
COPY docker/node/entry.sh /entry.sh
COPY docker/node/config.json /usr/share/raiblocks/config.json
COPY docker/node/config /usr/share/raiblocks/config
RUN chmod +x /entry.sh
CMD ["/bin/bash", "/entry.sh"]
38 changes: 37 additions & 1 deletion docker/node/build.sh
@@ -1,6 +1,42 @@
#!/bin/bash

network='live'

print_usage() {
echo 'build.sh [-h] [-n {live|beta|test}]'
}

while getopts 'hn:' OPT; do
case "${OPT}" in
h)
print_usage
exit 0
;;
n)
network="${OPTARG}"
;;
*)
print_usage >&2
exit 1
;;
esac
done

case "${network}" in
live)
network_tag=''
;;
test|beta)
network_tag="-${network}"
;;
*)
echo "Invalid network: ${network}" >&2
exit 1
;;
esac

REPO_ROOT=`git rev-parse --show-toplevel`
COMMIT_SHA=`git rev-parse --short HEAD`
pushd $REPO_ROOT
docker build -f docker/node/Dockerfile -t raiblocks-node:latest .
docker build --build-arg NETWORK="${network}" -f docker/node/Dockerfile -t raiblocks-node${network_tag}:latest .
popd
60 changes: 60 additions & 0 deletions docker/node/config/beta.json
@@ -0,0 +1,60 @@
{
"version": "2",
"rpc_enable": "true",
"rpc": {
"address": "::ffff:0.0.0.0",
"port": "7076",
"enable_control": "true",
"frontier_request_limit": "16384",
"chain_request_limit": "16384"
},
"node": {
"version": "8",
"peering_port": "54000",
"bootstrap_fraction_numerator": "1",
"receive_minimum": "1000000000000000000000000",
"logging": {
"version": "2",
"ledger": "false",
"ledger_duplicate": "false",
"vote": "false",
"network": "true",
"network_message": "false",
"network_publish": "false",
"network_packet": "false",
"network_keepalive": "false",
"node_lifetime_tracing": "false",
"insufficient_work": "true",
"log_rpc": "true",
"bulk_pull": "false",
"work_generation_time": "true",
"log_to_cerr": "false",
"max_size": "16777216",
"rotation_size": "4194304",
"flush": "false"
},
"work_peers": "",
"preconfigured_peers": [
"rai-beta.raiblocks.net"
],
"preconfigured_representatives": [
"xrb_3kbzg73bjsi85scbwnouj44iinrsqtdqphzay1x3pwmgmhkdwg8yjntxff33"
],
"inactive_supply": "0",
"password_fanout": "1024",
"io_threads": "4",
"work_threads": "4",
"enable_voting": "true",
"bootstrap_connections": "16",
"callback_address": "",
"callback_port": "0",
"callback_target": "",
"lmdb_max_dbs": "128"
},
"opencl_enable": "false",
"opencl": {
"platform": "0",
"device": "0",
"threads": "1048576"
}
}
File renamed without changes.

0 comments on commit 755dae8

Please sign in to comment.