Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CYB-439 small refactoring, fixes, and renaming #42

Merged
merged 1 commit into from
Dec 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/build-debug/

/doxygen
/daobet.doxygen
/*.doxygen

/genesis.json

Expand Down
14 changes: 7 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
[submodule "libraries/chainbase"]
path = libraries/chainbase
url = https://github.com/eosio/chainbase
ignore = dirty
ignore = dirty
[submodule "libraries/appbase"]
path = libraries/appbase
url = https://github.com/mixbytes/appbase
ignore = dirty
branch = queue_thread_safety
ignore = dirty
branch = queue_thread_safety
[submodule "libraries/softfloat"]
path = libraries/softfloat
url = https://github.com/eosio/berkeley-softfloat-3
[submodule "libraries/fc"]
path = libraries/fc
url = https://github.com/EOSIO/fc
[submodule "libraries/wabt"]
path = libraries/wabt
url = https://github.com/EOSIO/wabt
Expand All @@ -19,7 +22,4 @@
[submodule "plugins/telemetry_plugin/lib/prometheus-cpp"]
path = plugins/telemetry_plugin/lib/prometheus-cpp
url = git://github.com/jupp0r/prometheus-cpp.git
branch = v0.6.0
[submodule "libraries/fc"]
path = libraries/fc
url = https://github.com/EOSIO/fc
branch = v0.6.0
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# DAO.Casino - blockchain for Gambling 3.0 with fast finality and on-chain pRNG

Welcome to DAO.Casino Blockchain repository!
Welcome to DAO.Casino Blockchain repository!

This project is based on [Haya](https://github.com/mixbytes/haya), which implements RANDPA finality for [EOSio](https://github.com/EOSIO/eos).

RANDPA was inspired by [GRANDPA](https://github.com/w3f/consensus/blob/master/pdf/grandpa.pdf). It achieves deterministic finality within 2-3 seconds in the real-world network conditions. This improvement significantly reduces waiting time for transactions and all smart contract based operations, including [Game Channels](https://github.com/DaoCasino/Protocol). RANDPA is implementation is still in development, so please use it for the test purposes only.
RANDPA was inspired by [GRANDPA](https://github.com/w3f/consensus/blob/master/pdf/grandpa.pdf). It achieves
deterministic finality within 2-3 seconds in the real-world network conditions. This improvement significantly reduces
waiting time for transactions and all smart contract based operations, including
[Game Channels](https://github.com/DaoCasino/Protocol). RANDPA is implementation is still in development, so please use
it for the test purposes only.

We also provide some test and benchmarking tools, so you can actually run RANDPA on your own machine.

## Build Status

Branch|Build Status
---|---
Master|[![master](https://travis-ci.org/DaoCasino/DAObet.svg?branch=master)](https://travis-ci.org/DaoCasino/DAObet)
Develop|[![develop](https://travis-ci.org/DaoCasino/DAObet.svg?branch=develop)](https://travis-ci.org/DaoCasino/DAObet)
Master | [![master](https://travis-ci.org/DaoCasino/DAObet.svg?branch=master)](https://travis-ci.org/DaoCasino/DAObet)
Develop | [![develop](https://travis-ci.org/DaoCasino/DAObet.svg?branch=develop)](https://travis-ci.org/DaoCasino/DAObet)

## Build

Expand All @@ -35,7 +39,7 @@ Develop|[![develop](https://travis-ci.org/DaoCasino/DAObet.svg?branch=develop)](
./plugins/randpa_plugin/tests/randpa_plugin_unit_test
```

We have also coded our own blockchain simulator for testing. It
We have also coded our own blockchain simulator for testing. It
saves us a ton of time when debugging.

Run `randpa_finality.three_nodes` test:
Expand All @@ -46,12 +50,12 @@ Run `randpa_finality.three_nodes` test:

### Run one node

For the purpose of this tutorial we have provided basic config files in the tutorials/randpa-tutorial/configs
For the purpose of this tutorial we have provided basic config files in the tutorials/randpa-tutorial/configs
directory.

Assuming you have your executable in the build directory you can start the node
by running

```bash

./bin/daobet-node --delete-all-blocks -c ../tutorials/randpa-tutorial/configs/config0.ini
Expand All @@ -74,7 +78,7 @@ If you see "Randpa reached supermajority" messages then you have successfully la

### Run multiple nodes

Running N nodes is as easy as running one with an additional step
Running N nodes is as easy as running one with an additional step
of setting block producers

1.Run 3 nodes
Expand All @@ -92,7 +96,7 @@ of setting block producers
```

3.Check for "Randpa reached suppermajority" messages in node logs

### Contributing to DAO.Casino Blockchain

Interested in contributing? That's awesome! Please follow our git flow:
Expand Down
2 changes: 2 additions & 0 deletions run-node.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

NODE_PATH=$HOME/.dao-node
NODE_IMAGE='daocasino/daobet:v0.4.0'
CONFIG_URL='https://explorer.daobet.org/config'
Expand Down
4 changes: 2 additions & 2 deletions scripts/daobet_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ printf "| | | | | | | | | | | | | |\n"
printf "| | | | | | | | ______/ | | | | |\n"
printf "|_| |_| |_| |_| \______/ |_| |_|\n\n${txtrst}"

printf "\\daobet has been successfully built. %02d:%02d:%02d\\n" $(($TIME_END/3600)) $(($TIME_END%3600/60)) $(($TIME_END%60))
printf "DAOBet has been successfully built. %02d:%02d:%02d\\n" $(($TIME_END/3600)) $(($TIME_END%3600/60)) $(($TIME_END%60))
printf "==============================================================================================\\n${bldred}"
printf "(Optional) Testing Instructions:\\n"
print_instructions
printf "${BIN_LOCATION}/mongod --dbpath ${MONGODB_DATA_LOCATION} -f ${MONGODB_CONF} --logpath ${MONGODB_LOG_LOCATION}/mongod.log &\\n"
printf "cd ./build && PATH=\$PATH:$INSTALL_PREFIX/opt/mongodb/bin make test\\n" # PATH is set as currently 'mongo' binary is required for the mongodb test
printf "${txtrst}==============================================================================================\\n"
printf "For more information:\\n"
printf "daobet Github: https://github.com/DaoCasino/DAObet\\n"
printf "DAOBet sources: https://github.com/DaoCasino/DAObet\\n"

18 changes: 9 additions & 9 deletions scripts/daobet_install.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#!/bin/bash
##########################################################################
# This is the EOSIO automated install script for Linux and Mac OS.
# This file was downloaded from https://github.com/DaoCasino/dc-blockchain
# This file was downloaded from https://github.com/DaoCasino/DAObet
#
# Copyright (c) 2017, Respective Authors all rights reserved.
#
# After June 1, 2018 this software is available under the following terms:
#
#
# The MIT License
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
#
# 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
Expand All @@ -27,7 +27,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# https://github.com/mixbytes/daobet/blob/master/LICENSE.txt
# https://github.com/DaoCasino/DAObet/blob/master/LICENSE
##########################################################################

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand Down Expand Up @@ -62,7 +62,7 @@ if ! make install; then
printf "\\nMAKE installing DAOBET has exited with the above error.\\n\\n"
exit -1
fi
popd &> /dev/null
popd &> /dev/null

printf "\n\n${bldred}"
printf " _ _ ______ _ _ _____\n"
Expand All @@ -75,8 +75,8 @@ printf "| | | | | | | | ______/ | | | | |\n"
printf "|_| |_| |_| |_| \______/ |_| |_|\n\n${txtrst}"

printf "==============================================================================================\\n"
printf "daobet has been installed into ${OPT_LOCATION}/daobet/bin!\\n"
printf "Daobet has been installed into ${OPT_LOCATION}/daobet/bin!\\n"
printf "If you need to, you can fully uninstall using daobet_uninstall.sh && scripts/clean_old_install.sh.\\n"
printf "==============================================================================================\\n\\n"

printf "daobet Github: https://github.com/DaoCasino/dc-blockchain\\n"
printf "Daobet sources: https://github.com/DaoCasino/DAObet\\n"
18 changes: 11 additions & 7 deletions testnet.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
set -eu

readonly core_symbol=BET
readonly project=daobet

readonly prog_cli="programs/$project-cli/$project-cli"
readonly prog_wallet="programs/$project-wallet/$project-wallet"

# set up a wallet just for holding the key used during blockchain ignition

Expand Down Expand Up @@ -41,15 +45,15 @@ echo "Initializing ignition sequence at $(date)" | tee $logfile

echo "http-server-address = $wdaddr" > $wddir/config.ini

programs/daobet-wallet/daobet-wallet --config-dir $wddir --data-dir $wddir 2> $wddir/wdlog.txt &
"$prog_wallet" --config-dir $wddir --data-dir $wddir 2> $wddir/wdlog.txt &
echo $$ > ignition_wallet.pid
echo keosd log in $wddir/wdlog.txt >> $logfile
sleep 1

ecmd () {
echo ===== Start: $step ============ >> $logfile
set -x
programs/daobet-cli/daobet-cli --wallet-url $wdurl --url http://$bioshost:$biosport $* >> $logfile 2>&1
"programs/$project-cli/$project-cli" --wallet-url $wdurl --url http://$bioshost:$biosport $* >> $logfile 2>&1
set +x
echo ==== End: $step ============== >> $logfile
step=$(($step + 1))
Expand All @@ -60,7 +64,7 @@ wcmd () {
}

cacmd () {
programs/daobet-cli/daobet-cli \
"$prog_cli" \
--wallet-url $wdurl \
--url http://$bioshost:$biosport \
system newaccount \
Expand Down Expand Up @@ -113,14 +117,14 @@ ecmd set contract eosio.wrap unittests/contracts/eosio.wrap eosio.wrap.wasm eosi

echo "===== Start: $step ============" >> $logfile
set -x
programs/daobet-cli/daobet-cli \
"$prog_cli" \
--wallet-url $wdurl \
--url http://$bioshost:$biosport \
push action eosio.token create "[ \"eosio\", \"10000000000.0000 $core_symbol\" ]" \
-p eosio.token \
>> $logfile 2>&1

programs/daobet-cli/daobet-cli \
"$prog_cli" \
--wallet-url $wdurl \
--url http://$bioshost:$biosport \
push action eosio.token issue "[ \"eosio\", \"1000000000.0000 $core_symbol\", \"memo\" ]" \
Expand All @@ -131,7 +135,7 @@ echo ==== End: $step ============== >> $logfile
step=$(($step + 1))

ecmd set contract eosio unittests/contracts/eosio.system eosio.system.wasm eosio.system.abi
programs/daobet-cli/daobet-cli \
"$prog_cli" \
--wallet-url $wdurl \
--url http://$bioshost:$biosport \
push action eosio init "[0, \"4,$core_symbol\"]" \
Expand All @@ -148,4 +152,4 @@ programs/daobet-cli/daobet-cli \
# ------ DO NOT ALTER THE NEXT LINE -------
###INSERT cacmd

pkill -15 daobet-wallet
pkill -15 "$project-wallet"
10 changes: 5 additions & 5 deletions unittests/currency_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ BOOST_FIXTURE_TEST_CASE(test_symbol, TESTER) try {
}

{
symbol sys(4, CORE_SYMBOL_NAME);
BOOST_REQUIRE_EQUAL(::eosio::chain::string_to_symbol_c(4, CORE_SYMBOL_NAME), sys.value());
BOOST_REQUIRE_EQUAL("4," CORE_SYMBOL_NAME, sys.to_string());
BOOST_REQUIRE_EQUAL(CORE_SYMBOL_NAME, sys.name());
BOOST_REQUIRE_EQUAL(4, sys.decimals());
symbol sym(4, CORE_SYMBOL_NAME);
BOOST_REQUIRE_EQUAL(::eosio::chain::string_to_symbol_c(4, CORE_SYMBOL_NAME), sym.value());
BOOST_REQUIRE_EQUAL("4," CORE_SYMBOL_NAME, sym.to_string());
BOOST_REQUIRE_EQUAL(CORE_SYMBOL_NAME, sym.name());
BOOST_REQUIRE_EQUAL(4, sym.decimals());
}

// default is ("4," CORE_SYMBOL_NAME)
Expand Down