diff --git a/Dockerfile b/Dockerfile index 877067db07..c858895f9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -151,5 +151,8 @@ RUN mkdir -p /etc/service/steemd ADD contrib/steemd.run /etc/service/steemd/run RUN chmod +x /etc/service/steemd/run +# add seednodes from documentation to image +ADD doc/seednodes.txt /etc/steemd/seednodes.txt + # the following adds lots of logging info to stdout ADD contrib/config-for-docker.ini /etc/steemd/config.ini diff --git a/README.md b/README.md index a9f8f5193d..e4ad4b2293 100644 --- a/README.md +++ b/README.md @@ -1,137 +1,86 @@ -Introducing Steem (beta) ------------------ +# Introducing Steem (beta) Steem is an experimental Proof of Work blockchain with an unproven consensus algorithm. - - Currency Symbol STEEM + - Currency symbol STEEM - 1.000 STEEM block reward at launch - Approximately 100% APR long term inflation rate -Public Announcement & Discussion --------------------------------- +# Public Announcement & Discussion -Steem was announced on [Bitcointalk](https://bitcointalk.org/index.php?topic=1410943.new) prior to the start of any mining. +Steem was announced on the +[Bitcointalk forum](https://bitcointalk.org/index.php?topic=1410943.new) prior to +the start of any mining. + +# No Support & No Warranty -No Support & No Warranty ------------------------- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. -Code is Documentation ---------------------- +# Code is Documentation Rather than attempt to describe the rules of the blockchain, it is up to each individual to inspect the code to understand the consensus rules. -Seed Nodes ----------- - - xeldal 45.55.217.111:12150 (USA) - ihashfury 104.168.154.160:40696 - lafona 52.4.250.181:39705 - steempty 109.74.206.93:2001 steem.clawmap.com (UK) - steem-id 45.114.118.146:2001 (Indonesia) - cyrano.witness 81.89.101.133:2001 (Jena, Germany) - kushed 40.76.37.6:2001 steem.kushed.com (Azure) - nextgencrypto 104.207.152.44:2201 steemwitness.com (Los Angeles, USA) - pharesim 78.46.32.4 steemd.pharesim.me (Falkenstein, German) - liondani 212.117.213.186:2016 (Switzerland) - someguy123 199.241.186.130:2001 steemit-seed.someguy123.com:2001 - smooth.witness 52.74.152.79:2001 - - 52.38.66.234:2001 - 52.37.169.52:2001 - 52.26.78.244:2001 - 192.99.4.226:2001 - 46.252.27.1:1337 - 81.89.101.133:2001 - 52.4.250.181:39705 - steemd.pharesim.me:2001 - seed.steemed.net:2001 - steem.clawmap.com:2001 - seed.steemwitness.com:2001 - steem-seed1.abit-more.com:2001 - - -How to Mine ------------ - -The mining algorithm used by Steem requires the owner to have access to the private key -used by the account. This means it does not favor mining pools. - - ./steemd --miner=["accountname","${WIFPRIVATEKEY}"] --witness="accountname" --seed-node="52.38.66.234:2001" - -Make sure that your accountname is unique and not already used by someone else or your proof of work -might not be accepted by the blockchain. +# Quickstart -OS-specific build instructions ------------------------------- +Just want to get up and running quickly? Try deploying a prebuilt +dockerized container. Both common binary types are included. -See [here](doc/build-ubuntu.md) for Linux and [here](doc/build-osx.md) for OSX (Apple). +## Dockerized p2p Node -cmake Build Options --------------------------- +To run a p2p node (ca. 2GB of memory is required at the moment): -### CMAKE_BUILD_TYPE=[Release/Debug] + docker run \ + -d -p 2001:2001 -p 8090:8090 --name steemd-default \ + steemit/steem -Specifies whether to build with or without optimization and without or with the symbol table for debugging. Unless you are specifically -debugging or running tests, it is recommended to build as release. + docker logs -f steemd-default # follow along -### LOW_MEMORY_NODE=[OFF/ON] +## Dockerized Full Node -Builds steemd to be a consensus only low memory node. Data and fields not needed for consensus are not stored in the object database. -This option is recommended for witnesses and seed-nodes. +To run a node with *all* the data (e.g. for supporting a content website) +that uses ca. 14GB of memory and growing: -### ENABLE_CONTENT_PATCHING=[ON/OFF] + docker run \ + --env USE_WAY_TOO_MUCH_RAM=1 \ + -d -p 2001:2001 -p 8090:8090 --name steemd-full \ + steemit/steem -Allows content to be updated using a patch rather than a complete replacement. -If you do not need an API server or need to see the result of patching content then you can set this to OFF. + docker logs -f steemd-full -### CLEAR_VOTES=[ON/OFF] +# Seed Nodes -Clears old votes from memory that are not longer required for consensus. +A list of some seed nodes to get you started can be found in +[doc/seednodes.txt](doc/seednodes.txt). -### BUILD_STEEM_TESTNET=[OFF/ON] +This same file is baked into the docker images and can be overridden by +setting `STEEMD_SEED_NODES` in the container environment at `docker run` +time to a whitespace delimited list of seed nodes (with port). -Builds steemd for use in a private testnet. Also required for correctly building unit tests +# How to Mine -Testing -------- +The mining algorithm used by Steem requires the owner to have access to the +private key used by the account. This means it does not favor mining pools. -The unit test target is `make chain_test` -This creates an executable `./tests/chain_test` that will run all unit tests. + ./steemd --miner=["accountname","${WIFPRIVATEKEY}"] \ + --witness="accountname" --seed-node="52.38.66.234:2001" -Tests are broken in several categories: -``` -basic_tests // Tests of "basic" functionality -block_tests // Tests of the block chain -live_tests // Tests on live chain data (currently only past hardfork testing) -operation_tests // Unit Tests of Steem operations -operation_time_tests // Tests of Steem operations that include a time based component (ex. vesting withdrawals) -serialization_tests // Tests related of serialization -``` +Make sure that your accountname is unique and not already used by someone +else or your proof of work might not be accepted by the blockchain. -Code Coverage Testing ---------------------- +# Building -If you have not done so, install lcov `brew install lcov` +See [doc/building.md](doc/building.md) for detailed build instructions, including +compile-time options, and specific commands for Linux (Ubuntu LTS) or macOS X. -``` -cmake -D BUILD_STEEM_TESTNET=ON -D ENABLE_COVERAGE_TESTING=true -D CMAKE_BUILD_TYPE=Debug . -make -lcov --capture --initial --directory . --output-file base.info --no-external -tests/chain_test -lcov --capture --directory . --output-file test.info --no-external -lcov --add-tracefile base.info --add-tracefile test.info --output-file total.info -lcov -o interesting.info -r total.info tests/\* -mkdir -p lcov -genhtml interesting.info --output-directory lcov --prefix `pwd` -``` +# Testing -Now open `lcov/index.html` in a browser \ No newline at end of file +See [doc/testing.md](doc/testing.md) for test build targets and info +on how to use lcov to check code test coverage. diff --git a/contrib/steemd.run b/contrib/steemd.run index 9262670fc3..3d58754ea1 100644 --- a/contrib/steemd.run +++ b/contrib/steemd.run @@ -10,20 +10,9 @@ fi chown -R steemd:steemd $HOME -SEED_NODES=" - 52.38.66.234:2001 - 52.37.169.52:2001 - 52.26.78.244:2001 - 192.99.4.226:2001 - 46.252.27.1:1337 - 81.89.101.133:2001 - 52.4.250.181:39705 - steemd.pharesim.me:2001 - seed.steemed.net:2001 - steem.clawmap.com:2001 - seed.steemwitness.com:2001 - steem-seed1.abit-more.com:2001 -" +# seed nodes come from doc/seednodes.txt which is +# installed by docker into /etc/steemd/seednodes.txt +SEED_NODES="$(cat /etc/steemd/seednodes.txt | awk -F' ' '{print $1}')" ARGS="" diff --git a/doc/build-osx.md b/doc/build-osx.md deleted file mode 100644 index 9f3a3dfe32..0000000000 --- a/doc/build-osx.md +++ /dev/null @@ -1,64 +0,0 @@ -Steem OS X Build Instructions -=============================== - -1. Install XCode and its command line tools by following the instructions here: https://guide.macports.org/#installing.xcode. - In OS X 10.11 (El Capitan) and newer, you will be prompted to install developer tools when running a devloper command in the terminal. This step may not be needed. - - -2. Install Homebrew by following the instructions here: http://brew.sh/ - -3. Initialize Homebrew: - ``` - brew doctor - brew update - brew tap homebrew/versions - ``` - -4. Install dependencies: - ``` - brew install homebrew/versions/boost160 cmake git openssl autoconf automake libtool python3 - ``` - Note: brew recently updated to boost 1.61.0, which is not yet supported by Steem. Until then, this will allow you to - install boost 1.60.0. - - -5. *Optional.* To use TCMalloc in LevelDB: - ``` - brew install google-perftools - ``` - -6. Clone the Steem repository: - ``` - git clone https://github.com/steemit/steem.git - cd steem - ``` - -7. Build Steem: - ``` - export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2h_1/ - export BOOST_ROOT=/usr/local/Cellar/boost160/1.60.0/ - git submodule update --init --recursive - cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release . - make - ``` - - Note, if you have multiple cores and you would like to compile faster, you can append `-j ` to `make` e.g.: - ``` - make -j4 - ``` - - Also, some useful build targets for `make` are: - ``` - steemd - chain_test - cli_wallet - ``` - - e.g.: - ``` - make steemd - ``` - This will only build steemd - -8. cmake Build Options: - See README.md for a detailed description of available cmake options diff --git a/doc/build-ubuntu.md b/doc/build-ubuntu.md deleted file mode 100644 index 3528787728..0000000000 --- a/doc/build-ubuntu.md +++ /dev/null @@ -1,65 +0,0 @@ -### Ubuntu 16.04 - -For Ubuntu 16.04 users, after installing the right packages with `apt` Steem will build out of the box without further effort: - - # Required packages - sudo apt-get install git make automake cmake g++ libssl-dev autoconf libtool - - # Boost packages (also required) - sudo apt-get install libboost-thread-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-signals-dev libboost-serialization-dev libboost-chrono-dev libboost-test-dev libboost-context-dev libboost-locale-dev libboost-coroutine-dev libboost-iostreams-dev - - # Optional packages (not required, but will make a nicer experience) - sudo apt-get install doxygen perl libreadline-dev libncurses5-dev - - git clone https://github.com/steemit/steem - cd steem - git submodule update --init --recursive - cmake -DCMAKE_BUILD_TYPE=Release . - make steemd - make cli_wallet - -You can add the `-j` parameter to the `make` command to compile in parallel on a machine with lots of memory and multiple cores (e.g. `make -j4 steemd`). - -### Ubuntu 14.04 - -Here are the required packages: - - # Required packages - sudo apt-get install git make cmake g++ libssl-dev autoconf libtool - - # Packages required to build Boost - sudo apt-get install python-dev libbz2-dev - - # Optional packages (not required, but will make a nicer experience) - sudo apt-get install doxygen perl libreadline-dev libncurses5-dev - -Steem requires Boost 1.57 or later. The Boost provided in the Ubuntu 14.04 package manager (Boost 1.55) is too old. So building Steem on Ubuntu 14.04 requires downloading and installing a more recent version of Boost. - -According to [this mailing list post](http://boost.2283326.n4.nabble.com/1-58-1-bugfix-release-necessary-td4674686.html), Boost 1.58 is not compatible with gcc 4.8 (the default C++ compiler for Ubuntu 16.04) when compiling in C++11 mode (which Steem does). So we will use Boost 1.57; if you try to build with any other version, you will probably have a bad time. - -Here is how to build and install Boost 1.57 into your user's home directory (make sure you install all the packages above first): - - BOOST_ROOT=$HOME/opt/boost_1_57_0 - wget -c 'http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.bz2/download' -O boost_1_57_0.tar.bz2 - [ $( sha256sum boost_1_57_0.tar.bz2 | cut -d ' ' -f 1 ) == "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967" ] || ( echo 'Corrupt download' ; exit 1 ) - tar xjf boost_1_57_0.tar.bz2 - cd boost_1_57_0 - ./bootstrap.sh "--prefix=$BOOST_ROOT" - ./b2 install - -Then the instructions are the same as for Steem: - - git clone https://github.com/steemit/steem - cd steem - git submodule update --init --recursive - cmake -DCMAKE_BUILD_TYPE=Release . - make steemd - make cli_wallet - -### Other setups - -- OSX (Apple) build instructions are [here](BUILD_OSX.md). -- Windows build instructions do not yet exist. - -- The developers normally compile with gcc and clang. These compilers should be well-supported. -- Community members occasionally attempt to compile the code with mingw, Intel and Microsoft compilers. These compilers may work, but the developers do not use them. Pull requests fixing warnings / errors from these compilers are accepted. diff --git a/doc/building.md b/doc/building.md new file mode 100644 index 0000000000..470417d148 --- /dev/null +++ b/doc/building.md @@ -0,0 +1,226 @@ +# Building Steem + +## Compile-Time Options (cmake) + +### CMAKE_BUILD_TYPE=[Release/Debug] + +Specifies whether to build with or without optimization and without or with +the symbol table for debugging. Unless you are specifically debugging or +running tests, it is recommended to build as release. + +### LOW_MEMORY_NODE=[OFF/ON] + +Builds steemd to be a consensus only low memory node. Data and fields not +needed for consensus are not stored in the object database. This option is +recommended for witnesses and seed-nodes. + +### ENABLE_CONTENT_PATCHING=[ON/OFF] + +Allows content to be updated using a patch rather than a complete +replacement. If you do not need an API server or need to see the result of +patching content then you can set this to OFF. + +### CLEAR_VOTES=[ON/OFF] + +Clears old votes from memory that are not longer required for consensus. + +### BUILD_STEEM_TESTNET=[OFF/ON] + +Builds steem for use in a private testnet. Also required for correctly +building unit tests + +## Building under Docker + +We ship a Dockerfile. This builds both common node type binaries. + + git clone https://github.com/steemit/steem + cd steem + docker build -t steemit/steem . + +## Building on Ubuntu 16.04 + +For Ubuntu 16.04 users, after installing the right packages with `apt` Steem +will build out of the box without further effort: + + # Required packages + sudo apt-get install -y \ + autoconf \ + automake \ + cmake \ + g++ \ + git \ + libssl-dev \ + libtool \ + make + + # Boost packages (also required) + sudo apt-get install -y \ + libboost-chrono-dev \ + libboost-context-dev \ + libboost-coroutine-dev \ + libboost-date-time-dev \ + libboost-filesystem-dev \ + libboost-iostreams-dev \ + libboost-locale-dev \ + libboost-program-options-dev \ + libboost-serialization-dev \ + libboost-signals-dev \ + libboost-system-dev \ + libboost-test-dev \ + libboost-thread-dev + + # Optional packages (not required, but will make a nicer experience) + sudo apt-get install -y \ + doxygen \ + libncurses5-dev \ + libreadline-dev \ + perl + + git clone https://github.com/steemit/steem + cd steem + git submodule update --init --recursive + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(nproc) steemd + make -j$(nproc) cli_wallet + # optional + make install # defaults to /usr/local + +## Building on Ubuntu 14.04 + +Here are the required packages: + + # Required packages + sudo apt-get install -y \ + autoconf \ + cmake \ + g++ \ + git \ + libssl-dev \ + libtool \ + make + + # Packages required to build Boost + sudo apt-get install -y \ + libbz2-dev \ + python-dev + + # Optional packages (not required, but will make a nicer experience) + sudo apt-get install -y + doxygen \ + libncurses5-dev \ + libreadline-dev \ + perl + +Steem requires Boost 1.57 or later. The Boost provided in the Ubuntu 14.04 +package manager (Boost 1.55) is too old. So building Steem on Ubuntu 14.04 +requires downloading and installing a more recent version of Boost. + + + +According to [this mailing list +post](http://boost.2283326.n4.nabble.com/1-58-1-bugfix-release-necessary-td4674686.html), +Boost 1.58 is not compatible with gcc 4.8 (the default C++ compiler for +Ubuntu 16.04) when compiling in C++11 mode (which Steem does). So we will +use Boost 1.57; if you try to build with any other version, you will +probably have a bad time. + +Here is how to build and install Boost 1.57 into your user's home directory +(make sure you install all the packages above first): + + BOOST_ROOT=$HOME/opt/boost_1_57_0 + URL='http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.bz2/download' + wget -c "$URL" -O boost_1_57_0.tar.bz2 + [ $( sha256sum boost_1_57_0.tar.bz2 | cut -d ' ' -f 1 ) == \ + "910c8c022a33ccec7f088bd65d4f14b466588dda94ba2124e78b8c57db264967" ] \ + || ( echo 'Corrupt download' ; exit 1 ) + tar xjf boost_1_57_0.tar.bz2 + cd boost_1_57_0 + ./bootstrap.sh "--prefix=$BOOST_ROOT" + ./b2 install + +Then the instructions are the same as for steem: + + git clone https://github.com/steemit/steem + cd steem + git submodule update --init --recursive + mkdir build && cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(nproc) steemd + make -j$(nproc) cli_wallet + +## Building on macOS X + +Install Xcode and its command line tools by following the instructions here: +https://guide.macports.org/#installing.xcode. In OS X 10.11 (El Capitan) +and newer, you will be prompted to install developer tools when running a +developer command in the terminal. + +Accept the Xcode license if you have not already: + + sudo xcodebuild -license accept + +Install Homebrew by following the instructions here: http://brew.sh/ + +### Initialize Homebrew: + + brew doctor + brew update + brew tap homebrew/versions + +### Install steem dependencies: + + brew install \ + autoconf \ + automake \ + cmake \ + git \ + homebrew/versions/boost160 \ + libtool \ + openssl \ + python3 + +Note: brew recently updated to boost 1.61.0, which is not yet supported by +steem. Until then, this will allow you to install boost 1.60.0. + +*Optional.* To use TCMalloc in LevelDB: + + brew install google-perftools + +### Clone the Repository + + git clone https://github.com/steemit/steem.git + cd steem + +### Compile + + export OPENSSL_ROOT_DIR=$(brew --prefix)/Cellar/openssl/1.0.2h_1/ + export BOOST_ROOT=$(brew --prefix)/Cellar/boost160/1.60.0/ + git submodule update --init --recursive + mkdir build && cd build + cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .. + make -j$(sysctl -n hw.logicalcpu) + +Also, some useful build targets for `make` are: + + steemd + chain_test + cli_wallet + +e.g.: + + make -j$(sysctl -n hw.logicalcpu) steemd + +This will only build `steemd`. + +## Building on Other Platforms + +- Windows build instructions do not yet exist. + +- The developers normally compile with gcc and clang. These compilers should + be well-supported. +- Community members occasionally attempt to compile the code with mingw, + Intel and Microsoft compilers. These compilers may work, but the + developers do not use them. Pull requests fixing warnings / errors from + these compilers are accepted. diff --git a/doc/seednodes.txt b/doc/seednodes.txt new file mode 100644 index 0000000000..9e2af2cd96 --- /dev/null +++ b/doc/seednodes.txt @@ -0,0 +1,21 @@ +104.168.154.160:40696 # ihashfury +104.207.152.44:2201 # nextgencrypto, steemwitness.com (Los Angeles, USA) +109.74.206.93:2001 # steempty, steem.clawmap.com (UK) +192.99.4.226:2001 # unknown +199.241.186.130:2001 # someguy123, steemit-seed.someguy123.com:2001 +212.117.213.186:2016 # liondani (Switzerland) +40.76.37.6:2001 # kushed, steem.kushed.com (Azure) +45.114.118.146:2001 # steem-id (Indonesia) +45.55.217.111:12150 # xeldal (USA) +46.252.27.1:1337 # unknown +52.26.78.244:2001 # unknown +52.37.169.52:2001 # unknown +52.38.66.234:2001 # unknown +52.4.250.181:39705 # lafona +52.74.152.79:2001 # smooth.witness +81.89.101.133:2001 # cyrano.witness (Jena, Germany) +seed.steemed.net:2001 +seed.steemwitness.com:2001 +steem-seed1.abit-more.com:2001 +steem.clawmap.com:2001 +steemd.pharesim.me:2001 diff --git a/doc/testing.md b/doc/testing.md new file mode 100644 index 0000000000..1d1eff8596 --- /dev/null +++ b/doc/testing.md @@ -0,0 +1,32 @@ +# Testing + +The unit test target is `make chain_test` +This creates an executable `./tests/chain_test` that will run all unit tests. + +Tests are broken in several categories: +``` +basic_tests // Tests of "basic" functionality +block_tests // Tests of the block chain +live_tests // Tests on live chain data (currently only past hardfork testing) +operation_tests // Unit Tests of Steem operations +operation_time_tests // Tests of Steem operations that include a time based component (ex. vesting withdrawals) +serialization_tests // Tests related of serialization +``` + +# Code Coverage Testing + +If you have not done so, install lcov `brew install lcov` + +``` +cmake -D BUILD_STEEM_TESTNET=ON -D ENABLE_COVERAGE_TESTING=true -D CMAKE_BUILD_TYPE=Debug . +make +lcov --capture --initial --directory . --output-file base.info --no-external +tests/chain_test +lcov --capture --directory . --output-file test.info --no-external +lcov --add-tracefile base.info --add-tracefile test.info --output-file total.info +lcov -o interesting.info -r total.info tests/\* +mkdir -p lcov +genhtml interesting.info --output-directory lcov --prefix `pwd` +``` + +Now open `lcov/index.html` in a browser