From adc354ef47245fba16b0623582fcd8214caf15a6 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 27 Jun 2018 20:43:34 +0700 Subject: [PATCH 001/887] Add assetchains.json --- src/assetchains.json | 157 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 src/assetchains.json diff --git a/src/assetchains.json b/src/assetchains.json new file mode 100644 index 000000000..7837b95af --- /dev/null +++ b/src/assetchains.json @@ -0,0 +1,157 @@ +[ + { + "name": "REVS", + "rpcPort": 1234, + "params": "-ac_name=REVS -ac_supply=1300000" + }, + { + "name": "SUPERNET", + "rpcPort": 1234, + "params": "-ac_name=SUPERNET -ac_supply=816061" + }, + { + "name": "DEX", + "rpcPort": 1234, + "params": "-ac_name=DEX -ac_supply=999999" + }, + { + "name": "PANGEA", + "rpcPort": 1234, + "params": "-ac_name=PANGEA -ac_supply=999999" + }, + { + "name": "JUMBLR", + "rpcPort": 1234, + "params": "-ac_name=JUMBLR -ac_supply=999999" + }, + { + "name": "BET", + "rpcPort": 1234, + "params": "-ac_name=BET -ac_supply=999999" + }, + { + "name": "CRYPTO", + "rpcPort": 1234, + "params": "-ac_name=CRYPTO -ac_supply=999999" + }, + { + "name": "HODL", + "rpcPort": 1234, + "params": "-ac_name=HODL -ac_supply=9999999" + }, + { + "name": "MSHARK", + "rpcPort": 1234, + "params": "-ac_name=MSHARK -ac_supply=1400000" + }, + { + "name": "BOTS", + "rpcPort": 1234, + "params": "-ac_name=BOTS -ac_supply=999999" + }, + { + "name": "MGW", + "rpcPort": 1234, + "params": "-ac_name=MGW -ac_supply=999999" + }, + { + "name": "COQUI", + "rpcPort": 1234, + "params": "-ac_name=COQUI -ac_supply=72000000" + }, + { + "name": "WLC", + "rpcPort": 1234, + "params": "-ac_name=WLC -ac_supply=210000000" + }, + { + "name": "KV", + "rpcPort": 1234, + "params": "-ac_name=KV -ac_supply=1000000" + }, + { + "name": "CEAL", + "rpcPort": 1234, + "params": "-ac_name=CEAL -ac_supply=366666666" + }, + { + "name": "MESH", + "rpcPort": 1234, + "params": "-ac_name=MESH -ac_supply=1000007" + }, + { + "name": "MNZ", + "rpcPort": 1234, + "params": "-ac_name=MNZ -ac_supply=257142858" + }, + { + "name": "AXO", + "rpcPort": 1234, + "params": "-ac_name=AXO -ac_supply=200000000" + }, + { + "name": "ETOMIC", + "rpcPort": 1234, + "params": "-ac_name=ETOMIC -ac_supply=100000000" + }, + { + "name": "BTCH", + "rpcPort": 1234, + "params": "-ac_name=BTCH -ac_supply=20998641" + }, + { + "name": "PIZZA", + "rpcPort": 1234, + "params": "-ac_name=PIZZA -ac_supply=100000000" + }, + { + "name": "BEER", + "rpcPort": 1234, + "params": "-ac_name=BEER -ac_supply=100000000" + }, + { + "name": "NINJA", + "rpcPort": 1234, + "params": "-ac_name=NINJA -ac_supply=100000000" + }, + { + "name": "OOT", + "rpcPort": 1234, + "params": "-ac_name=OOT -ac_supply=216000000" + }, + { + "name": "BNTN", + "rpcPort": 1234, + "params": "-ac_name=BNTN -ac_supply=500000000" + }, + { + "name": "CHAIN", + "rpcPort": 1234, + "params": "-ac_name=CHAIN -ac_supply=999999" + }, + { + "name": "PRLPAY", + "rpcPort": 1234, + "params": "-ac_name=PRLPAY -ac_supply=500000000" + }, + { + "name": "DSEC", + "rpcPort": 1234, + "params": "-ac_name=DSEC -ac_supply=7000000" + }, + { + "name": "GLXT", + "rpcPort": 1234, + "params": "-ac_name=GLXT -ac_supply=100000000" + }, + { + "name": "EQL", + "rpcPort": 1234, + "params": "-ac_name=EQL -ac_supply=500000000" + }, + { + "name": "ZILLA", + "rpcPort": 1234, + "params": "-ac_name=ZILLA -ac_supply=11000000" + } +] From fc6aca1ff9263ff31101930cf74b02ce24cfbed1 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 27 Jun 2018 21:23:09 +0700 Subject: [PATCH 002/887] Update ./assetchains to use assetchains.json --- src/assetchains | 65 +++++++++---------------------------------------- 1 file changed, 12 insertions(+), 53 deletions(-) diff --git a/src/assetchains b/src/assetchains index 6697c1735..175ebe576 100755 --- a/src/assetchains +++ b/src/assetchains @@ -1,60 +1,19 @@ #!/bin/bash +set -euo pipefail + source pubkey.txt -args=("$@") +assetchain_args=`jq -r '.[].params' assetchains.json` +overide_args=("$@") seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` komodo_binary='./komodod' delay=20 -function komodo_asset () -{ - if [ $[RANDOM % 10] == 1 ] - then - gen=" -gen" - else - gen="" - fi +while read args; do + gen="" + if [ $[RANDOM % 10] == 1 ]; then + gen=" -gen" + fi - if [ -n "$2" ] - then - supply=" -ac_supply=$2" - else - supply=" " - fi - - $komodo_binary -ac_name=$1 $gen $supply $args -pubkey=$pubkey -addnode=$seed_ip & - sleep $delay -} - -#set -x - -komodo_asset REVS 1300000 -komodo_asset SUPERNET 816061 -komodo_asset DEX 999999 -komodo_asset PANGEA 999999 -komodo_asset JUMBLR 999999 -komodo_asset BET 999999 -komodo_asset CRYPTO 999999 -komodo_asset HODL 9999999 -komodo_asset MSHARK 1400000 -komodo_asset BOTS 999999 -komodo_asset MGW 999999 -komodo_asset COQUI 72000000 -komodo_asset WLC 210000000 -komodo_asset KV 1000000 -komodo_asset CEAL 366666666 -komodo_asset MESH 1000007 -komodo_asset MNZ 257142858 -komodo_asset AXO 200000000 -komodo_asset ETOMIC 100000000 -komodo_asset BTCH 20998641 -komodo_asset PIZZA 100000000 -komodo_asset BEER 100000000 -komodo_asset NINJA 100000000 -komodo_asset OOT 216000000 -komodo_asset BNTN 500000000 -komodo_asset CHAIN 999999 -komodo_asset PRLPAY 500000000 -komodo_asset DSEC 7000000 -komodo_asset GLXT 100000000 -komodo_asset EQL 500000000 -komodo_asset ZILLA 11000000 + $komodo_binary $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & + sleep $delay +done <<< "$assetchain_args" From 0a37f2072d7c3d28ca83f268670d4225ea706128 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 2 Jul 2018 23:36:33 +0200 Subject: [PATCH 003/887] add travis CI --- .travis.yml | 82 ----------------------------------------------------- 1 file changed, 82 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac331dcf9..250756396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -<<<<<<< HEAD language: cpp compiler: @@ -22,84 +21,3 @@ notifications: - "Alt Message : %{repository_slug} - (%{commit} - %{author}): %{message}, Build Time: %{duration}" - "Change view : %{compare_url}" - "Build details : %{build_url}" -======= -# errata: -# - A travis bug causes caches to trample eachother when using the same -# compiler key (which we don't use anyway). This is worked around for now by -# replacing the "compilers" with a build name prefixed by the no-op ":" -# command. See: https://github.com/travis-ci/travis-ci/issues/4393 -# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback] -# IPv6 support - -sudo: required -dist: precise -group: legacy - -os: linux -language: cpp -compiler: gcc -env: - global: - - MAKEJOBS=-j3 - - RUN_TESTS=false - - BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID - - CCACHE_SIZE=100M - - CCACHE_TEMPDIR=/tmp/.ccache-temp - - CCACHE_COMPRESS=1 - - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out - - SDK_URL=https://bitcoincore.org/depends-sources/sdks - - PYTHON_DEBUG=1 - - WINEDEBUG=fixme-all -cache: - apt: true - directories: - - depends/built - - depends/sdk-sources - - $HOME/.ccache -matrix: - fast_finish: true - include: - - compiler: ": ARM" - env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - - compiler: ": Win32" - env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports" MAKEJOBS="-j2" - - compiler: ": 32-bit + dash" - env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc python-zmq" PPA="ppa:chris-lea/zeromq" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash" - - compiler: ": Win64" - env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports" MAKEJOBS="-j2" - - compiler: ": bitcoind" - env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python-zmq" PPA="ppa:chris-lea/zeromq" DEP_OPTS="DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" - - compiler: ": No wallet" - env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - - compiler: ": Cross-Mac" - env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" - exclude: - - compiler: gcc -install: - - if [ -n "$PACKAGES" ]; then sudo rm -f /etc/apt/sources.list.d/travis_ci_zeromq3-source.list; fi - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi -before_script: - - unset CC; unset CXX - - mkdir -p depends/SDKs depends/sdk-sources - - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS -script: - - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi - - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST - - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" - - depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE - - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export CCACHE_READONLY=1; fi - - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh - - ./configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - - make distdir PACKAGE=bitcoin VERSION=$HOST - - cd bitcoin-$HOST - - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - - if [ "$RUN_TESTS" = "true" ]; then make check; fi - - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi -after_script: - - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi ->>>>>>> zcash/master From dfec6b538670091bec1d6fd2523a8624988a8c16 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 3 Jul 2018 19:27:05 +0200 Subject: [PATCH 004/887] update travisCI deployment --- .travis.yml | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 250756396..81c2092aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,33 @@ +dist: xenial language: cpp - compiler: - - gcc - +- gcc before_install: - - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa - - sudo apt-get update -qq - - sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate -#install: - -script: - - ./zcutil/build.sh -j 5 - +- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa +- sudo apt-get update -qq +- sudo apt-get install libgnutls28-dev +- sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev + m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils + automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate +script: +- "./zcutil/build.sh -j 5" notifications: irc: channels: - - "chat.freenode.net#komodoplatform" + - chat.freenode.net#komodoplatform template: - - "%{repository}/%{branch} (%{commit} - %{author}): %{message}" - - "Alt Message : %{repository_slug} - (%{commit} - %{author}): %{message}, Build Time: %{duration}" - - "Change view : %{compare_url}" - - "Build details : %{build_url}" + - "%{repository}/%{branch} (%{commit} - %{author}): %{message}" + - 'Alt Message : %{repository_slug} - (%{commit} - %{author}): %{message}, Build + Time: %{duration}' + - 'Change view : %{compare_url}' + - 'Build details : %{build_url}' +before_deploy: + - git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)" +deploy: + provider: releases + api_key: + secure: oyMB9JDSoL/val/d80Em3sd3mSJY+PPkiclUb3ktizNz7DgYZbBiStUOZIJo95GUYADEvm9RVrP0JmBiDuqneEjfFRzME9/MnpY/LmRCiYGgprMDR80ZqbLgOzSKpE10RE2XM3vZkZeXT/JcGGayUm0faElep2qx62S4ozsAxSvFJ5l/PG+wEltrlnp1z8uYdXV3PBChbjzXJ0BdMVxMrrU39kwzqwu2Ge9PnNjVv0AVxn/oZpf+bzYa7vkSuGTRe2Jcs8U9AABYnZ22wu+tdlD76pdOJzGEwR70e8CjUJmdSn+M+wwAPPHStPW/JHFwSaWsKZtUyB5EWQW2kqq6P+M1Fe7yo6srznsaAcZRWeCrbUO/k44bEfnj7HMGmxfjDJOwbxVEoHg7im+l3HLUiG8rcw5dM/TAnrmgjH/OEj/EM1lbwV2C+PdDGOjdguljEhjBABGRbRABMZjwW8w+uBFVlKlcn7y+zJbMB3mGd+FNGo/OgAcsFzRcpaN8SrC/kzUF2SeEwJjTKvAqRgA66yl7CzDPBtUv2NtoPUz/8YO9rsdGElcWfmDIVacuIEjo1CizlbDzeS7zPiFPW5MRCGryLFLt0WjA/s8lkLO+DbGYXPa4rG6+7ZNUDLfziM+lFqZH8b382/bhv+a6ctpWjaazjiW6yWemsuN8QhByuGw= + file: src/komodod + skip_cleanup: true + on: + repo: KomodoPlatform/komodo From 69cf3284baf7ba86db45abccc6d2097b7eb8b1c6 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Jul 2018 16:24:41 +0700 Subject: [PATCH 005/887] Update assetchains.json to array of param objects --- src/assetchains.json | 160 ++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 93 deletions(-) diff --git a/src/assetchains.json b/src/assetchains.json index 7837b95af..3b7bfb61e 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -1,157 +1,131 @@ [ { - "name": "REVS", - "rpcPort": 1234, - "params": "-ac_name=REVS -ac_supply=1300000" + "ac_name": "REVS", + "ac_supply": "1300000" }, { - "name": "SUPERNET", - "rpcPort": 1234, - "params": "-ac_name=SUPERNET -ac_supply=816061" + "ac_name": "SUPERNET", + "ac_supply": "816061" }, { - "name": "DEX", - "rpcPort": 1234, - "params": "-ac_name=DEX -ac_supply=999999" + "ac_name": "DEX", + "ac_supply": "999999" }, { - "name": "PANGEA", - "rpcPort": 1234, - "params": "-ac_name=PANGEA -ac_supply=999999" + "ac_name": "PANGEA", + "ac_supply": "999999" }, { - "name": "JUMBLR", - "rpcPort": 1234, - "params": "-ac_name=JUMBLR -ac_supply=999999" + "ac_name": "JUMBLR", + "ac_supply": "999999" }, { - "name": "BET", - "rpcPort": 1234, - "params": "-ac_name=BET -ac_supply=999999" + "ac_name": "BET", + "ac_supply": "999999" }, { - "name": "CRYPTO", - "rpcPort": 1234, - "params": "-ac_name=CRYPTO -ac_supply=999999" + "ac_name": "CRYPTO", + "ac_supply": "999999" }, { - "name": "HODL", - "rpcPort": 1234, - "params": "-ac_name=HODL -ac_supply=9999999" + "ac_name": "HODL", + "ac_supply": "9999999" }, { - "name": "MSHARK", - "rpcPort": 1234, - "params": "-ac_name=MSHARK -ac_supply=1400000" + "ac_name": "MSHARK", + "ac_supply": "1400000" }, { - "name": "BOTS", - "rpcPort": 1234, - "params": "-ac_name=BOTS -ac_supply=999999" + "ac_name": "BOTS", + "ac_supply": "999999" }, { - "name": "MGW", - "rpcPort": 1234, - "params": "-ac_name=MGW -ac_supply=999999" + "ac_name": "MGW", + "ac_supply": "999999" }, { - "name": "COQUI", - "rpcPort": 1234, - "params": "-ac_name=COQUI -ac_supply=72000000" + "ac_name": "COQUI", + "ac_supply": "72000000" }, { - "name": "WLC", - "rpcPort": 1234, - "params": "-ac_name=WLC -ac_supply=210000000" + "ac_name": "WLC", + "ac_supply": "210000000" }, { - "name": "KV", - "rpcPort": 1234, - "params": "-ac_name=KV -ac_supply=1000000" + "ac_name": "KV", + "ac_supply": "1000000" }, { - "name": "CEAL", - "rpcPort": 1234, - "params": "-ac_name=CEAL -ac_supply=366666666" + "ac_name": "CEAL", + "ac_supply": "366666666" }, { - "name": "MESH", - "rpcPort": 1234, - "params": "-ac_name=MESH -ac_supply=1000007" + "ac_name": "MESH", + "ac_supply": "1000007" }, { - "name": "MNZ", - "rpcPort": 1234, - "params": "-ac_name=MNZ -ac_supply=257142858" + "ac_name": "MNZ", + "ac_supply": "257142858" }, { - "name": "AXO", - "rpcPort": 1234, - "params": "-ac_name=AXO -ac_supply=200000000" + "ac_name": "AXO", + "ac_supply": "200000000" }, { - "name": "ETOMIC", - "rpcPort": 1234, - "params": "-ac_name=ETOMIC -ac_supply=100000000" + "ac_name": "ETOMIC", + "ac_supply": "100000000" }, { - "name": "BTCH", - "rpcPort": 1234, - "params": "-ac_name=BTCH -ac_supply=20998641" + "ac_name": "BTCH", + "ac_supply": "20998641" }, { - "name": "PIZZA", - "rpcPort": 1234, - "params": "-ac_name=PIZZA -ac_supply=100000000" + "ac_name": "PIZZA", + "ac_supply": "100000000" }, { - "name": "BEER", - "rpcPort": 1234, - "params": "-ac_name=BEER -ac_supply=100000000" + "ac_name": "BEER", + "ac_supply": "100000000" }, { - "name": "NINJA", - "rpcPort": 1234, - "params": "-ac_name=NINJA -ac_supply=100000000" + "ac_name": "NINJA", + "ac_supply": "100000000" }, { - "name": "OOT", - "rpcPort": 1234, - "params": "-ac_name=OOT -ac_supply=216000000" + "ac_name": "OOT", + "ac_supply": "216000000" }, { - "name": "BNTN", - "rpcPort": 1234, - "params": "-ac_name=BNTN -ac_supply=500000000" + "ac_name": "BNTN", + "ac_supply": "500000000" }, { - "name": "CHAIN", - "rpcPort": 1234, - "params": "-ac_name=CHAIN -ac_supply=999999" + "ac_name": "CHAIN", + "ac_supply": "999999" }, { - "name": "PRLPAY", - "rpcPort": 1234, - "params": "-ac_name=PRLPAY -ac_supply=500000000" + "ac_name": "PRLPAY", + "ac_supply": "500000000" }, { - "name": "DSEC", - "rpcPort": 1234, - "params": "-ac_name=DSEC -ac_supply=7000000" + "ac_name": "DSEC", + "ac_supply": "7000000" }, { - "name": "GLXT", - "rpcPort": 1234, - "params": "-ac_name=GLXT -ac_supply=100000000" + "ac_name": "GLXT", + "ac_supply": "10000000000" }, { - "name": "EQL", - "rpcPort": 1234, - "params": "-ac_name=EQL -ac_supply=500000000" + "ac_name": "EQL", + "ac_supply": "500000000" }, { - "name": "ZILLA", - "rpcPort": 1234, - "params": "-ac_name=ZILLA -ac_supply=11000000" + "ac_name": "ZILLA", + "ac_supply": "11000000" + }, + { + "ac_name": "RFOX", + "ac_supply": "1000000000", + "ac_reward": "100000000" } ] From 2e986a8a90d4572d4d62a97c85605156f23b439a Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Jul 2018 16:42:10 +0700 Subject: [PATCH 006/887] Add assetchainparams script --- src/assetchainparams | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 src/assetchainparams diff --git a/src/assetchainparams b/src/assetchainparams new file mode 100755 index 000000000..fa83437e8 --- /dev/null +++ b/src/assetchainparams @@ -0,0 +1,17 @@ +#!/usr/bin/env python2 +import os +import json + +script_dir = os.path.dirname(__file__) +with open(script_dir + '/assetchains.json') as file: + assetchains = json.load(file) + +for chain in assetchains: + params = [] + for param, value in chain.items(): + if isinstance(value, list): + for dupe_value in value: + params.append('-' + param + '=' + dupe_value) + else: + params.append('-' + param + '=' + value) + print(' '.join(params)) From 8c263066db03cbf8363e9f92426e7f5c6937e1bc Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Jul 2018 18:16:18 +0700 Subject: [PATCH 007/887] Update assetchains file to use assetchainparams script --- src/assetchains | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/assetchains b/src/assetchains index 175ebe576..959622970 100755 --- a/src/assetchains +++ b/src/assetchains @@ -1,12 +1,14 @@ #!/bin/bash -set -euo pipefail +set -eo pipefail +# You can now add delay line to pubkey.txt file source pubkey.txt -assetchain_args=`jq -r '.[].params' assetchains.json` -overide_args=("$@") +assetchain_args=`./assetchainparams` +overide_args="$@" seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` komodo_binary='./komodod' -delay=20 + +if [ -z "$delay" ]; then delay=20; fi while read args; do gen="" From 848bfdbdc485f17209e920279a8f47a9825f71dd Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 5 Jul 2018 18:37:49 +0700 Subject: [PATCH 008/887] Refactor param formatting out into function --- src/assetchainparams | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/assetchainparams b/src/assetchainparams index fa83437e8..5e6b71eb4 100755 --- a/src/assetchainparams +++ b/src/assetchainparams @@ -2,6 +2,9 @@ import os import json +def format_param(param, value): + return '-' + param + '=' + value + script_dir = os.path.dirname(__file__) with open(script_dir + '/assetchains.json') as file: assetchains = json.load(file) @@ -11,7 +14,7 @@ for chain in assetchains: for param, value in chain.items(): if isinstance(value, list): for dupe_value in value: - params.append('-' + param + '=' + dupe_value) + params.append(format_param(param, dupe_value)) else: - params.append('-' + param + '=' + value) + params.append(format_param(param, value)) print(' '.join(params)) From d719807f84203ad580387fb00757b2b6798b99af Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 6 Jul 2018 07:08:33 +0700 Subject: [PATCH 009/887] assetchainparams => listassetchainparams --- src/assetchains | 2 +- src/{assetchainparams => listassetchainparams} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/{assetchainparams => listassetchainparams} (100%) diff --git a/src/assetchains b/src/assetchains index 959622970..e33970177 100755 --- a/src/assetchains +++ b/src/assetchains @@ -3,7 +3,7 @@ set -eo pipefail # You can now add delay line to pubkey.txt file source pubkey.txt -assetchain_args=`./assetchainparams` +assetchain_args=`./listassetchainparams` overide_args="$@" seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` komodo_binary='./komodod' diff --git a/src/assetchainparams b/src/listassetchainparams similarity index 100% rename from src/assetchainparams rename to src/listassetchainparams From f192db220f71fa2405fd28f0c85fda4474374925 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 6 Jul 2018 07:10:16 +0700 Subject: [PATCH 010/887] Created listassetchains --- src/listassetchains | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 src/listassetchains diff --git a/src/listassetchains b/src/listassetchains new file mode 100755 index 000000000..768381070 --- /dev/null +++ b/src/listassetchains @@ -0,0 +1,10 @@ +#!/usr/bin/env python2 +import os +import json + +script_dir = os.path.dirname(__file__) +with open(script_dir + '/assetchains.json') as file: + assetchains = json.load(file) + +for chain in assetchains: + print(chain['ac_name']) From cd7fd0552e6de335130a422890856ac12ef228a2 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 6 Jul 2018 07:13:56 +0700 Subject: [PATCH 011/887] Update assetchains_stop to use src/listassetchains and fix lots of bugs --- src/assetchains_stop | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/src/assetchains_stop b/src/assetchains_stop index e55231b1a..f2cd234ef 100755 --- a/src/assetchains_stop +++ b/src/assetchains_stop @@ -1,40 +1,9 @@ #!/bin/bash -args=("$@") +set -eo pipefail + +assetchains=`./listassetchains` komodo_cli='./komodo-cli' -delay=20 -function komodo_stop () -{ - $komodo_cli --ac_name=$1 stop -} - -#set -x - -komodo_stop REVS -komodo_stop SUPERNET -komodo_stop DEX -komodo_stop PANGEA -komodo_stop JUMBLR -komodo_stop BET -komodo_stop CRYPTO -komodo_stop HODL -komodo_stop MSHARK -komodo_stop BOTS -komodo_stop MGW -komodo_stop COQUI -komodo_stop WLC -komodo_stop KV -komodo_stop CEAL -komodo_stop MESH -komodo_stop MNZ -komodo_stop AXO -komodo_stop ETOMIC -komodo_stop BTCH -komodo_stop PIZZA -komodo_stop BEER -komodo_stop NINJA -komodo_stop OOT -komodo_stop BNTN -komodo_stop CHAIN -komodo_stop PRLPAY -komodo_stop DSEC +while read chain; do + $komodo_cli --ac_name=$chain stop +done <<< "$assetchains" From 0467e742e3c0d98e6e78f22abfcfe883223f0256 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 6 Jul 2018 07:15:59 +0700 Subject: [PATCH 012/887] Pipe into while loops --- src/assetchains | 5 ++--- src/assetchains_stop | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/assetchains b/src/assetchains index e33970177..299028e90 100755 --- a/src/assetchains +++ b/src/assetchains @@ -3,14 +3,13 @@ set -eo pipefail # You can now add delay line to pubkey.txt file source pubkey.txt -assetchain_args=`./listassetchainparams` overide_args="$@" seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` komodo_binary='./komodod' if [ -z "$delay" ]; then delay=20; fi -while read args; do +./listassetchainparams | while read args; do gen="" if [ $[RANDOM % 10] == 1 ]; then gen=" -gen" @@ -18,4 +17,4 @@ while read args; do $komodo_binary $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & sleep $delay -done <<< "$assetchain_args" +done diff --git a/src/assetchains_stop b/src/assetchains_stop index f2cd234ef..26940e141 100755 --- a/src/assetchains_stop +++ b/src/assetchains_stop @@ -1,9 +1,8 @@ #!/bin/bash set -eo pipefail -assetchains=`./listassetchains` komodo_cli='./komodo-cli' -while read chain; do +./listassetchains | while read chain; do $komodo_cli --ac_name=$chain stop -done <<< "$assetchains" +done From b48bf090bc78d57eaf5068bada419befab87a6b3 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 6 Jul 2018 07:18:28 +0700 Subject: [PATCH 013/887] Update fiat-cli to use src/listassetchains and fix lots of bugs --- src/fiat-cli | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/src/fiat-cli b/src/fiat-cli index 2838575f9..6c7a8d732 100755 --- a/src/fiat-cli +++ b/src/fiat-cli @@ -1,35 +1,10 @@ #!/bin/bash -#set -x -echo revs; fiat/revs $1 $2 $3 $4 -echo supernet; fiat/supernet $1 $2 $3 $4 -echo dex; fiat/dex $1 $2 $3 $4 -echo pangea; fiat/pangea $1 $2 $3 $4 -echo jumblr; fiat/jumblr $1 $2 $3 $4 -echo bet; fiat/bet $1 $2 $3 $4 -echo crypto; fiat/crypto $1 $2 $3 $4 -echo hodl; fiat/hodl $1 $2 $3 $4 -echo mshark; fiat/mshark $1 $2 $3 $4 -echo bots; fiat/bots $1 $2 $3 $4 -echo mgw; fiat/mgw $1 $2 $3 $4 -echo coqui; fiat/coqui $1 $2 $3 $4 -echo wlc; fiat/wlc $1 $2 $3 $4 -echo kv; fiat/kv $1 $2 $3 $4 -echo ceal; fiat/ceal $1 $2 $3 $4 -echo mesh; fiat/mesh $1 $2 $3 $4 -echo mnz; fiat/mnz $1 $2 $3 $4 -echo axo; fiat/axo $1 $2 $3 $4 -echo etomic; fiat/etomic $1 $2 $3 $4 -echo btch; fiat/btch $1 $2 $3 $4 -echo pizza; fiat/pizza $1 $2 $3 $4 -echo beer; fiat/beer $1 $2 $3 $4 -echo ninja; fiat/ninja $1 $2 $3 $4 -echo oot; fiat/oot $1 $2 $3 $4 -echo bntn; fiat/bntn $1 $2 $3 $4 -echo chain; fiat/chain $1 $2 $3 $4 -echo prlpay; fiat/prlpay $1 $2 $3 $4 -echo dsec; fiat/dsec $1 $2 $3 $4 -echo glxt; fiat/glxt $1 $2 $3 $4 -echo eql; fiat/eql $1 $2 $3 $4 -echo zilla; fiat/zilla $1 $2 $3 $4 -echo vrsc; fiat/vrsc $1 $2 $3 $4 -echo rfox; fiat/rfox $1 $2 $3 $4 +set -eo pipefail + +args="$@" +komodo_cli='./komodo-cli' + +./listassetchains | while read chain; do + echo $chain + $komodo_cli --ac_name=$chain $args +done From 8543360b20508ed1412d8c614e4ce4f3d87d8c35 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 6 Jul 2018 07:20:31 +0700 Subject: [PATCH 014/887] Remove pointless komodo_cli variable --- src/assetchains | 3 +-- src/assetchains_stop | 4 +--- src/fiat-cli | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/assetchains b/src/assetchains index 299028e90..57e705d5c 100755 --- a/src/assetchains +++ b/src/assetchains @@ -5,7 +5,6 @@ set -eo pipefail source pubkey.txt overide_args="$@" seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` -komodo_binary='./komodod' if [ -z "$delay" ]; then delay=20; fi @@ -15,6 +14,6 @@ if [ -z "$delay" ]; then delay=20; fi gen=" -gen" fi - $komodo_binary $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & + ./komodod $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & sleep $delay done diff --git a/src/assetchains_stop b/src/assetchains_stop index 26940e141..60549dc20 100755 --- a/src/assetchains_stop +++ b/src/assetchains_stop @@ -1,8 +1,6 @@ #!/bin/bash set -eo pipefail -komodo_cli='./komodo-cli' - ./listassetchains | while read chain; do - $komodo_cli --ac_name=$chain stop + ./komodo-cli --ac_name=$chain stop done diff --git a/src/fiat-cli b/src/fiat-cli index 6c7a8d732..719141d07 100755 --- a/src/fiat-cli +++ b/src/fiat-cli @@ -2,9 +2,8 @@ set -eo pipefail args="$@" -komodo_cli='./komodo-cli' ./listassetchains | while read chain; do echo $chain - $komodo_cli --ac_name=$chain $args + ./komodo-cli --ac_name=$chain $args done From cbce9f1f65a3bca9c373577178d6e6447d09dc90 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sat, 14 Jul 2018 23:00:09 +0000 Subject: [PATCH 015/887] WIP debugging why leveldb iterator is broke --- src/main.cpp | 14 +++++++++++--- src/txdb.cpp | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b08d2e522..15d74adb2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -590,10 +590,18 @@ CBlockTreeDB *pblocktree = NULL; int64_t komodo_snapshot() { + fprintf(stderr,"komodo_snapshot\n"); int64_t total = -1; - if ( pblocktree != 0 ) - total = pblocktree->Snapshot(); - else fprintf(stderr,"null pblocktree start with -addressindex=true\n"); + if (fAddressIndex) { + if ( pblocktree != 0 ) { + total = pblocktree->Snapshot(); + } else { + fprintf(stderr,"null pblocktree start with -addressindex=true\n"); + } + } else { + fprintf(stderr,"getsnapshot requires -addressindex=true\n"); + } + fprintf(stderr,"total=%li\n", total); return(total); } diff --git a/src/txdb.cpp b/src/txdb.cpp index a0f764962..fa3766faf 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -402,18 +402,31 @@ int64_t CBlockTreeDB::Snapshot() { char chType; int64_t total = -1; std::string address; boost::scoped_ptr pcursor(NewIterator()); - pcursor->SeekToFirst(); + //boost::scoped_ptr pcursor(pdb->NewIterator(leveldb::ReadOptions()) ); + //boost::scoped_ptr pcursor(db->NewIterator()); + fprintf(stderr,"Snapshot\n"); + + //pcursor->SeekToFirst(); + pcursor->SeekToLast(); + fprintf(stderr,"SeekToLast\n"); + fprintf(stderr,"pcursor iterate\n"); while (pcursor->Valid()) { + fprintf(stderr,"pcursor valid\n"); boost::this_thread::interruption_point(); + fprintf(stderr,"about to try\n"); try { leveldb::Slice slKey = pcursor->key(); + fprintf(stderr,"made slice\n"); CDataStream ssKey(slKey.data(), slKey.data()+slKey.size(), SER_DISK, CLIENT_VERSION); + fprintf(stderr,"made ssKey\n"); CAddressIndexKey indexKey; ssKey >> chType; + fprintf(stderr,"made chType\n"); ssKey >> indexKey; + fprintf(stderr,"made indexKey\n"); fprintf(stderr,"chType.%d\n",chType); if ( chType == DB_ADDRESSINDEX ) { @@ -428,12 +441,13 @@ int64_t CBlockTreeDB::Snapshot() total = (int64_t)nValue; else total += (int64_t)nValue; //addressIndex.push_back(make_pair(indexKey, nValue)); - pcursor->Next(); + pcursor->Prev(); } catch (const std::exception& e) { return error("failed to get address index value"); } } else { break; } } catch (const std::exception& e) { + fprintf(stderr, "%s: LevelDB exception! - %s\n", __func__, e.what()); break; } } From 17839698a34ac122200fe4eaf82f709b3b1c94a8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 16 Jul 2018 00:55:48 -1100 Subject: [PATCH 016/887] block_from_future_rejecttime used in RAMstaker --- src/wallet/rpcwallet.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 084a4f752..02cea5bef 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4678,7 +4678,7 @@ uint32_t komodo_eligible(arith_uint256 bnTarget,arith_uint256 ratio,struct komod int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blocktimep,uint32_t *txtimep,uint256 *utxotxidp,int32_t *utxovoutp,uint64_t *utxovaluep,uint8_t *utxosig) { static struct komodo_staking *array; static int32_t numkp,maxkp; static uint32_t lasttime; - set setAddress; struct komodo_staking *kp; int32_t winners,segid,minage,nHeight,counter=0,i,m,siglen=0,nMinDepth = 1,nMaxDepth = 99999999; vector vecOutputs; uint32_t besttime,eligible,eligible2,earliest = 0; CScript best_scriptPubKey; arith_uint256 mindiff,ratio,bnTarget; CBlockIndex *tipindex,*pindex; CTxDestination address; bool fNegative,fOverflow; uint8_t hashbuf[256]; CTransaction tx; uint256 hashBlock; + set setAddress; struct komodo_staking *kp; int32_t winners,segid,minage,nHeight,counter=0,i,m,siglen=0,nMinDepth = 1,nMaxDepth = 99999999; vector vecOutputs; uint32_t block_from_future_rejecttime,besttime,eligible,eligible2,earliest = 0; CScript best_scriptPubKey; arith_uint256 mindiff,ratio,bnTarget; CBlockIndex *tipindex,*pindex; CTxDestination address; bool fNegative,fOverflow; uint8_t hashbuf[256]; CTransaction tx; uint256 hashBlock; bnTarget.SetCompact(nBits, &fNegative, &fOverflow); mindiff.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow); ratio = (mindiff / bnTarget); @@ -4737,6 +4737,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt lasttime = (uint32_t)time(NULL); //fprintf(stderr,"finished kp data of utxo for staking %u ht.%d numkp.%d maxkp.%d\n",(uint32_t)time(NULL),nHeight,numkp,maxkp); } + block_from_future_rejecttime = (uint32_t)GetAdjustedTime() + 57; for (i=winners=0; inHeight+1 > nHeight ) @@ -4758,7 +4759,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt { besttime = eligible; eligible--; - if ( eligible < (uint32_t)tipindex->nTime-63 ) + if ( eligible < block_from_future_rejecttime ) // nothing gained by going earlier break; m++; //fprintf(stderr,"m.%d ht.%d validated winning blocktime %u -> %.8f eligible.%u test prior\n",m,nHeight,*blocktimep,(double)kp->nValue/COIN,eligible); From d62d9d7889f7c647f19534f0986e0e9372db6377 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 01:40:24 +0000 Subject: [PATCH 017/887] Almost working snapshot, we need to sum unspent outputs for each address and return to final snapshot data in json response --- src/txdb.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index fa3766faf..dfef647e6 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -400,36 +400,30 @@ bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &addr int64_t CBlockTreeDB::Snapshot() { - char chType; int64_t total = -1; std::string address; + char chType; int64_t total = 0; std::string address; boost::scoped_ptr pcursor(NewIterator()); - //boost::scoped_ptr pcursor(pdb->NewIterator(leveldb::ReadOptions()) ); - //boost::scoped_ptr pcursor(db->NewIterator()); - fprintf(stderr,"Snapshot\n"); - + //pcursor->SeekToFirst(); pcursor->SeekToLast(); - fprintf(stderr,"SeekToLast\n"); - fprintf(stderr,"pcursor iterate\n"); while (pcursor->Valid()) { - fprintf(stderr,"pcursor valid\n"); + //fprintf(stderr,"pcursor valid\n"); boost::this_thread::interruption_point(); - fprintf(stderr,"about to try\n"); try { leveldb::Slice slKey = pcursor->key(); - fprintf(stderr,"made slice\n"); CDataStream ssKey(slKey.data(), slKey.data()+slKey.size(), SER_DISK, CLIENT_VERSION); - fprintf(stderr,"made ssKey\n"); - CAddressIndexKey indexKey; + // CAddressIndexKey indexKey; + CAddressIndexIteratorKey indexKey; ssKey >> chType; - fprintf(stderr,"made chType\n"); ssKey >> indexKey; - fprintf(stderr,"made indexKey\n"); - fprintf(stderr,"chType.%d\n",chType); - if ( chType == DB_ADDRESSINDEX ) + //fprintf(stderr,"chType.%d\n",chType); + //fprintf(stderr,"dbindex prefix=%d\n",DB_ADDRESSINDEX); + //if ( chType == 'u' ) // chType == DB_ADDRESSINDEX ) + if ( chType == DB_ADDRESSUNSPENTINDEX ) // chType == DB_ADDRESSINDEX ) { + try { leveldb::Slice slValue = pcursor->value(); CDataStream ssValue(slValue.data(), slValue.data()+slValue.size(), SER_DISK, CLIENT_VERSION); @@ -437,11 +431,9 @@ int64_t CBlockTreeDB::Snapshot() ssValue >> nValue; getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); - if ( total < 0 ) - total = (int64_t)nValue; - else total += (int64_t)nValue; + + total += (double) nValue / COIN; //addressIndex.push_back(make_pair(indexKey, nValue)); - pcursor->Prev(); } catch (const std::exception& e) { return error("failed to get address index value"); } @@ -450,6 +442,7 @@ int64_t CBlockTreeDB::Snapshot() fprintf(stderr, "%s: LevelDB exception! - %s\n", __func__, e.what()); break; } + pcursor->Prev(); } return(total); } From 920f9601222ad9d4d047e6242e75e539ed991f03 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 06:05:36 +0000 Subject: [PATCH 018/887] Correctly print out snapshot data to stderr for now --- src/txdb.cpp | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index dfef647e6..00d3d276b 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -402,38 +402,46 @@ int64_t CBlockTreeDB::Snapshot() { char chType; int64_t total = 0; std::string address; boost::scoped_ptr pcursor(NewIterator()); + std::map addressAmounts; //pcursor->SeekToFirst(); pcursor->SeekToLast(); while (pcursor->Valid()) { - //fprintf(stderr,"pcursor valid\n"); boost::this_thread::interruption_point(); try { leveldb::Slice slKey = pcursor->key(); CDataStream ssKey(slKey.data(), slKey.data()+slKey.size(), SER_DISK, CLIENT_VERSION); - // CAddressIndexKey indexKey; CAddressIndexIteratorKey indexKey; ssKey >> chType; ssKey >> indexKey; - //fprintf(stderr,"chType.%d\n",chType); - //fprintf(stderr,"dbindex prefix=%d\n",DB_ADDRESSINDEX); - //if ( chType == 'u' ) // chType == DB_ADDRESSINDEX ) - if ( chType == DB_ADDRESSUNSPENTINDEX ) // chType == DB_ADDRESSINDEX ) - { + if ( chType == DB_ADDRESSUNSPENTINDEX ) + { try { leveldb::Slice slValue = pcursor->value(); CDataStream ssValue(slValue.data(), slValue.data()+slValue.size(), SER_DISK, CLIENT_VERSION); CAmount nValue; ssValue >> nValue; + //if (!getAddressFromIndex(indexKey.type, indexKey.hashBytes, address)) { getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); - fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); - total += (double) nValue / COIN; - //addressIndex.push_back(make_pair(indexKey, nValue)); + std::map ::iterator pos = addressAmounts.find(address); + if (pos == addressAmounts.end()) { + // insert new address + utxo amount + fprintf(stderr, "inserting new address %s with amount %li\n", address.c_str(), nValue); + addressAmounts[address] = nValue; + } else { + // update unspent tally for this address + addressAmounts[address] += nValue; + } + + //fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); + total += (double) nValue / COIN; + //addressIndex.push_back(make_pair(indexKey, nValue)); + //} } catch (const std::exception& e) { return error("failed to get address index value"); } @@ -442,8 +450,14 @@ int64_t CBlockTreeDB::Snapshot() fprintf(stderr, "%s: LevelDB exception! - %s\n", __func__, e.what()); break; } - pcursor->Prev(); + pcursor->Prev(); } + + for (map ::iterator it = addressAmounts.begin(); it != addressAmounts.end(); it++) + { + fprintf(stderr,"{\"%s\", %.8f},\n",it->first.c_str(),(double) it->second / COIN); + } + return(total); } From 7000ef1af3ddfc99bde07c185c781ea198d5eea5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Jul 2018 05:26:34 -1100 Subject: [PATCH 019/887] Possible workaround for crash --- src/wallet/wallet.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ce5630fb6..e62c6e60b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1885,6 +1885,11 @@ void CWallet::ReacceptWalletTransactions() bool CWalletTx::RelayWalletTransaction() { + if ( pwallet == 0 ) + { + fprintf(stderr,"unexpected null pwallet in RelayWalletTransaction\n"); + return(false); + } assert(pwallet->GetBroadcastTransactions()); if (!IsCoinBase()) { @@ -2124,9 +2129,13 @@ std::vector CWallet::ResendWalletTransactionsBefore(int64_t nTime) } BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted) { - CWalletTx& wtx = *item.second; - if (wtx.RelayWalletTransaction()) - result.push_back(wtx.GetHash()); + CWalletTx& wtx; + if ( item.second != 0 ) + { + wtx = *item.second; + if (wtx.RelayWalletTransaction()) + result.push_back(wtx.GetHash()); + } } return result; } From 3872e9cb59b99fbffc23ea9fa3587afbb68a524c Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 17 Jul 2018 05:29:01 -1100 Subject: [PATCH 020/887] Fix --- src/wallet/wallet.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index e62c6e60b..5100a2470 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2129,10 +2129,9 @@ std::vector CWallet::ResendWalletTransactionsBefore(int64_t nTime) } BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted) { - CWalletTx& wtx; if ( item.second != 0 ) { - wtx = *item.second; + CWalletTx &wtx = *item.second; if (wtx.RelayWalletTransaction()) result.push_back(wtx.GetHash()); } From 92dc28a3c92a1b5fea3c5ccf69dd796c6664e7b6 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 18:42:30 +0000 Subject: [PATCH 021/887] Return snapshot info as JSON --- src/main.cpp | 9 ++++----- src/rpcmisc.cpp | 12 ++++++++---- src/txdb.cpp | 43 ++++++++++++++++++++++++------------------- src/txdb.h | 3 ++- 4 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 15d74adb2..dfebfec4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -588,21 +588,20 @@ CBlockTreeDB *pblocktree = NULL; #define KOMODO_ZCASH #include "komodo.h" -int64_t komodo_snapshot() +UniValue komodo_snapshot() { - fprintf(stderr,"komodo_snapshot\n"); int64_t total = -1; + UniValue result(UniValue::VOBJ); if (fAddressIndex) { if ( pblocktree != 0 ) { - total = pblocktree->Snapshot(); + result = pblocktree->Snapshot(); } else { fprintf(stderr,"null pblocktree start with -addressindex=true\n"); } } else { fprintf(stderr,"getsnapshot requires -addressindex=true\n"); } - fprintf(stderr,"total=%li\n", total); - return(total); + return(result); } ////////////////////////////////////////////////////////////////////////////// diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index bf7f345d5..198b41090 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -1015,7 +1015,7 @@ UniValue getaddressbalance(const UniValue& params, bool fHelp) } -int32_t komodo_snapshot(); +UniValue komodo_snapshot(); UniValue getsnapshot(const UniValue& params, bool fHelp) { @@ -1026,9 +1026,13 @@ UniValue getsnapshot(const UniValue& params, bool fHelp) "getsnapshot\n" ); } - if ( (total= komodo_snapshot()) >= 0 ) - result.push_back(Pair("total", (double)total/COIN)); - else result.push_back(Pair("error", "no addressindex")); + result = komodo_snapshot(); + if ( result.size() > 0 ) { + // add timestamp, maybe block height? + result.push_back(Pair("time", time(NULL))); + } else { + result.push_back(Pair("error", "no addressindex")); + } return(result); } diff --git a/src/txdb.cpp b/src/txdb.cpp index 00d3d276b..63b640123 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -10,6 +10,7 @@ #include "main.h" #include "pow.h" #include "uint256.h" +#include "core_io.h" #include @@ -398,11 +399,12 @@ bool CBlockTreeDB::ReadAddressIndex(uint160 addressHash, int type, bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &address); -int64_t CBlockTreeDB::Snapshot() +extern UniValue CBlockTreeDB::Snapshot() { - char chType; int64_t total = 0; std::string address; + char chType; int64_t total = 0; int64_t totalAddresses = 0; std::string address; boost::scoped_ptr pcursor(NewIterator()); std::map addressAmounts; + UniValue result(UniValue::VOBJ); //pcursor->SeekToFirst(); pcursor->SeekToLast(); @@ -425,23 +427,22 @@ int64_t CBlockTreeDB::Snapshot() CDataStream ssValue(slValue.data(), slValue.data()+slValue.size(), SER_DISK, CLIENT_VERSION); CAmount nValue; ssValue >> nValue; - //if (!getAddressFromIndex(indexKey.type, indexKey.hashBytes, address)) { - getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); - std::map ::iterator pos = addressAmounts.find(address); - if (pos == addressAmounts.end()) { - // insert new address + utxo amount - fprintf(stderr, "inserting new address %s with amount %li\n", address.c_str(), nValue); - addressAmounts[address] = nValue; - } else { - // update unspent tally for this address - addressAmounts[address] += nValue; - } + getAddressFromIndex(indexKey.type, indexKey.hashBytes, address); + std::map ::iterator pos = addressAmounts.find(address); + if (pos == addressAmounts.end()) { + // insert new address + utxo amount + fprintf(stderr, "inserting new address %s with amount %li\n", address.c_str(), nValue); + addressAmounts[address] = nValue; + totalAddresses++; + } else { + // update unspent tally for this address + addressAmounts[address] += nValue; + } - //fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); - total += (double) nValue / COIN; - //addressIndex.push_back(make_pair(indexKey, nValue)); - //} + //fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); + total += nValue; + //addressIndex.push_back(make_pair(indexKey, nValue)); } catch (const std::exception& e) { return error("failed to get address index value"); } @@ -453,12 +454,16 @@ int64_t CBlockTreeDB::Snapshot() pcursor->Prev(); } + // TODO: create addresses key with array of {address,amount} + + fprintf(stderr, "total=%f, totalAddresses=%li\n", (double) total / COIN, totalAddresses); for (map ::iterator it = addressAmounts.begin(); it != addressAmounts.end(); it++) { - fprintf(stderr,"{\"%s\", %.8f},\n",it->first.c_str(),(double) it->second / COIN); + fprintf(stderr,"{\"%s\", %.8f},\n",it->first.c_str(),(double) it->second / COIN); + result.push_back(make_pair( it->first.c_str(), (double) it->second / COIN ) ); } - return(total); + return(result); } bool CBlockTreeDB::WriteTimestampIndex(const CTimestampIndexKey ×tampIndex) { diff --git a/src/txdb.h b/src/txdb.h index cb4d6d19e..6c6b41917 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -13,6 +13,7 @@ #include #include #include +#include class CBlockFileInfo; class CBlockIndex; @@ -94,7 +95,7 @@ public: bool ReadFlag(const std::string &name, bool &fValue); bool LoadBlockIndexGuts(); bool blockOnchainActive(const uint256 &hash); - int64_t Snapshot(); + UniValue Snapshot(); }; #endif // BITCOIN_TXDB_H From 29a5aa99fd5090bf3ca1b1248a844807bcff377c Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 19:39:55 +0000 Subject: [PATCH 022/887] Move address+amount data to addresses key in JSON; add some useful metadata to snapshot response --- src/txdb.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 63b640123..9170ceea0 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -454,15 +454,23 @@ extern UniValue CBlockTreeDB::Snapshot() pcursor->Prev(); } - // TODO: create addresses key with array of {address,amount} + UniValue addresses(UniValue::VARR); fprintf(stderr, "total=%f, totalAddresses=%li\n", (double) total / COIN, totalAddresses); for (map ::iterator it = addressAmounts.begin(); it != addressAmounts.end(); it++) { - fprintf(stderr,"{\"%s\", %.8f},\n",it->first.c_str(),(double) it->second / COIN); - result.push_back(make_pair( it->first.c_str(), (double) it->second / COIN ) ); + UniValue obj(UniValue::VOBJ); + fprintf(stderr,"{\"%s\", %.8f},\n",it->first.c_str(),(double) it->second / COIN); + obj.push_back( make_pair("addr", it->first.c_str() ) ); + obj.push_back( make_pair("amount", (double) it->second / COIN)); + addresses.push_back(obj); } + result.push_back(make_pair("addresses", addresses)); + result.push_back(make_pair("total", total / COIN )); + result.push_back(make_pair("average",(double) (total/COIN) / totalAddresses )); + result.push_back(make_pair("total_addresses", totalAddresses)); + result.push_back(make_pair("height", chainActive.Height())); return(result); } From 6e74fd25780d8ac14d20bd89d5ced6eb368e7440 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 21:37:52 +0000 Subject: [PATCH 023/887] In memory sorting, add a few metadata fields; printing small floats correctly still not working --- src/txdb.cpp | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 9170ceea0..b4ea54f9b 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -409,6 +409,14 @@ extern UniValue CBlockTreeDB::Snapshot() //pcursor->SeekToFirst(); pcursor->SeekToLast(); + int64_t startingHeight = chainActive.Height(); + + // prevent any node updates so we can get a consistent snapshot at this height + // causes coredumps + // LOCK(cs_main); + // does not compile + //LOCK(cs_wallet); + while (pcursor->Valid()) { boost::this_thread::interruption_point(); @@ -442,7 +450,6 @@ extern UniValue CBlockTreeDB::Snapshot() //fprintf(stderr,"{\"%s\", %.8f},\n",address.c_str(),(double)nValue/COIN); total += nValue; - //addressIndex.push_back(make_pair(indexKey, nValue)); } catch (const std::exception& e) { return error("failed to get address index value"); } @@ -455,22 +462,39 @@ extern UniValue CBlockTreeDB::Snapshot() } UniValue addresses(UniValue::VARR); - fprintf(stderr, "total=%f, totalAddresses=%li\n", (double) total / COIN, totalAddresses); - for (map ::iterator it = addressAmounts.begin(); it != addressAmounts.end(); it++) - { - UniValue obj(UniValue::VOBJ); - fprintf(stderr,"{\"%s\", %.8f},\n",it->first.c_str(),(double) it->second / COIN); - obj.push_back( make_pair("addr", it->first.c_str() ) ); - obj.push_back( make_pair("amount", (double) it->second / COIN)); - addresses.push_back(obj); + + typedef std::function, std::pair)> Comparator; + Comparator compFunctor = [](std::pair elem1 ,std::pair elem2) { + return elem1.second > elem2.second; /* descending */ + }; + // This is our intermediate data structure that allows us to calculate addressSorted + std::set, Comparator> sortedSnapshot(addressAmounts.begin(), addressAmounts.end(), compFunctor); + + UniValue obj(UniValue::VOBJ); + UniValue addressesSorted(UniValue::VARR); + for (std::pair element : sortedSnapshot) { + UniValue obj(UniValue::VOBJ); + obj.push_back( make_pair("addr", element.first.c_str() ) ); + std::ostringstream strs; + strs << ((double) element.second/COIN); + std::string amount = strs.str(); + + //std::string amount = boost::lexical_cast((double) element.second/COIN); + //sprintf(amount, "%.8f", (double) element.second / COIN); + obj.push_back( make_pair("amount", amount) ); + addressesSorted.push_back(obj); } - result.push_back(make_pair("addresses", addresses)); + result.push_back(make_pair("addresses", addressesSorted)); result.push_back(make_pair("total", total / COIN )); result.push_back(make_pair("average",(double) (total/COIN) / totalAddresses )); + // Total number of addresses in this snaphot result.push_back(make_pair("total_addresses", totalAddresses)); - result.push_back(make_pair("height", chainActive.Height())); + // The snapshot began at this block height + result.push_back(make_pair("start_height", startingHeight)); + // The snapshot finished at this block height + result.push_back(make_pair("ending_height", chainActive.Height())); return(result); } From 3eb535b8b4c61e63027611aaf02f3a4dcae9626b Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 22:31:06 +0000 Subject: [PATCH 024/887] Include start_time+end_time and correctly format amount --- src/main.cpp | 1 + src/rpcmisc.cpp | 3 +-- src/txdb.cpp | 15 +++------------ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index dfebfec4f..11bc3a352 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -592,6 +592,7 @@ UniValue komodo_snapshot() { int64_t total = -1; UniValue result(UniValue::VOBJ); + if (fAddressIndex) { if ( pblocktree != 0 ) { result = pblocktree->Snapshot(); diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 198b41090..01bd813e6 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -1028,8 +1028,7 @@ UniValue getsnapshot(const UniValue& params, bool fHelp) } result = komodo_snapshot(); if ( result.size() > 0 ) { - // add timestamp, maybe block height? - result.push_back(Pair("time", time(NULL))); + result.push_back(Pair("end_time", time(NULL))); } else { result.push_back(Pair("error", "no addressindex")); } diff --git a/src/txdb.cpp b/src/txdb.cpp index b4ea54f9b..2360ed340 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -405,18 +405,13 @@ extern UniValue CBlockTreeDB::Snapshot() boost::scoped_ptr pcursor(NewIterator()); std::map addressAmounts; UniValue result(UniValue::VOBJ); + result.push_back(Pair("start_time", time(NULL))); //pcursor->SeekToFirst(); pcursor->SeekToLast(); int64_t startingHeight = chainActive.Height(); - // prevent any node updates so we can get a consistent snapshot at this height - // causes coredumps - // LOCK(cs_main); - // does not compile - //LOCK(cs_wallet); - while (pcursor->Valid()) { boost::this_thread::interruption_point(); @@ -476,12 +471,8 @@ extern UniValue CBlockTreeDB::Snapshot() for (std::pair element : sortedSnapshot) { UniValue obj(UniValue::VOBJ); obj.push_back( make_pair("addr", element.first.c_str() ) ); - std::ostringstream strs; - strs << ((double) element.second/COIN); - std::string amount = strs.str(); - - //std::string amount = boost::lexical_cast((double) element.second/COIN); - //sprintf(amount, "%.8f", (double) element.second / COIN); + char amount[32]; + sprintf(amount, "%.8f", (double) element.second / COIN); obj.push_back( make_pair("amount", amount) ); addressesSorted.push_back(obj); } From 539080b3a4109285dc1a3b77fb5a15e782d7cc7e Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 17 Jul 2018 22:33:19 +0000 Subject: [PATCH 025/887] Less noise to stderr --- src/txdb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 2360ed340..cb0358403 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -435,7 +435,7 @@ extern UniValue CBlockTreeDB::Snapshot() std::map ::iterator pos = addressAmounts.find(address); if (pos == addressAmounts.end()) { // insert new address + utxo amount - fprintf(stderr, "inserting new address %s with amount %li\n", address.c_str(), nValue); + //fprintf(stderr, "inserting new address %s with amount %li\n", address.c_str(), nValue); addressAmounts[address] = nValue; totalAddresses++; } else { From 4ac134db0c5c0e7e99222bfd3f2fb62f255094eb Mon Sep 17 00:00:00 2001 From: Alrighttt Date: Wed, 18 Jul 2018 02:34:10 -0400 Subject: [PATCH 026/887] change zcashd reference, update example conf --- contrib/debian/examples/komodo.conf | 140 ++++++++++++++++++++++++++++ src/bitcoind.cpp | 12 +-- 2 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 contrib/debian/examples/komodo.conf diff --git a/contrib/debian/examples/komodo.conf b/contrib/debian/examples/komodo.conf new file mode 100644 index 000000000..656a43533 --- /dev/null +++ b/contrib/debian/examples/komodo.conf @@ -0,0 +1,140 @@ +## +## komodo.conf configuration file. Lines beginning with # are comments. +## + +# Network-related settings: + +# Run a regression test network +#regtest=0 + +# Connect via a SOCKS5 proxy +#proxy=127.0.0.1:9050 + +# Bind to given address and always listen on it. Use [host]:port notation for IPv6 +#bind= + +# Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6 +#whitebind= + +############################################################## +## Quick Primer on addnode vs connect ## +## Let's say for instance you use addnode=4.2.2.4 ## +## addnode will connect you to and tell you about the ## +## nodes connected to 4.2.2.4. In addition it will tell ## +## the other nodes connected to it that you exist so ## +## they can connect to you. ## +## connect will not do the above when you 'connect' to it. ## +## It will *only* connect you to 4.2.2.4 and no one else.## +## ## +## So if you're behind a firewall, or have other problems ## +## finding nodes, add some using 'addnode'. ## +## ## +## If you want to stay private, use 'connect' to only ## +## connect to "trusted" nodes. ## +## ## +## If you run multiple nodes on a LAN, there's no need for ## +## all of them to open lots of connections. Instead ## +## 'connect' them all to one node that is port forwarded ## +## and has lots of connections. ## +## Thanks goes to [Noodle] on Freenode. ## +############################################################## + +# Use as many addnode= settings as you like to connect to specific peers +#addnode=69.164.218.197 +#addnode=10.0.0.2:8233 + +# Alternatively use as many connect= settings as you like to connect ONLY to specific peers +#connect=69.164.218.197 +#connect=10.0.0.1:8233 + +# Listening mode, enabled by default except when 'connect' is being used +#listen=1 + +# Maximum number of inbound+outbound connections. +#maxconnections= + +# +# JSON-RPC options (for controlling a running Komodo/komodod process) +# + +# server=1 tells komodod to accept JSON-RPC commands (set as default if not specified) +#server=1 + +# Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. +# This option can be specified multiple times (default: bind to all interfaces) +#rpcbind= + +# You must set rpcuser and rpcpassword to secure the JSON-RPC api +#rpcuser=Ulysses +#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593 + +# How many seconds komodo will wait for a complete RPC HTTP request. +# after the HTTP connection is established. +#rpcclienttimeout=30 + +# By default, only RPC connections from localhost are allowed. +# Specify as many rpcallowip= settings as you like to allow connections from other hosts, +# either as a single IPv4/IPv6 or with a subnet specification. + +# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED, +# because the rpcpassword is transmitted over the network unencrypted and also because anyone +# that can authenticate on the RPC port can steal your keys + take over the account running komodod +# For more information see https://github.com/zcash/zcash/issues/1497 + +#rpcallowip=10.1.1.34/255.255.255.0 +#rpcallowip=1.2.3.4/24 +#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96 + +# Listen for RPC connections on this TCP port: +#rpcport=8232 + +# You can use Komodo or komodod to send commands to Komodo/komodod +# running on another host using this option: +#rpcconnect=127.0.0.1 + +# Transaction Fee + +# Send transactions as zero-fee transactions if possible (default: 0) +#sendfreetransactions=0 + +# Create transactions that have enough fees (or priority) so they are likely to # begin confirmation within n blocks (default: 1). +# This setting is overridden by the -paytxfee option. +#txconfirmtarget=n + +# Miscellaneous options + +# Enable attempt to mine komodo. +#gen=0 + +# Set the number of threads to be used for mining komodo (-1 = all cores). +#genproclimit=1 + +# Specify a different Equihash solver (e.g. "tromp") to try to mine komodo +# faster when gen=1. +#equihashsolver=default + +# Pre-generate this many public/private key pairs, so wallet backups will be valid for +# both prior transactions and several dozen future transactions. +#keypool=100 + +# Pay an optional transaction fee every time you send komodo. Transactions with fees +# are more likely than free transactions to be included in generated blocks, so may +# be validated sooner. This setting does not affect private transactions created with +# 'z_sendmany'. +#paytxfee=0.00 + +#Rewind the chain to specific block height. This is useful for creating snapshots at a given block height. +#rewind=777777 + +#Stop the chain a specific block height. This is useful for creating snapshots at a given block height. +#stopat=1000000 + +#Set an address to use as change address for all transactions. This value must be set to a 33 byte pubkey. All mined coins will also be sent to this address. +#pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 + +#Forfeit all user rewards to miners. Set this to explicitly not claim user rewards. +#exchange=1 + +#Donate all user rewards to a a specific address. This value must be set to a 33 byte pubkey. +#donation=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392 + diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 5c12cfa2f..36fea57bf 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -144,21 +144,21 @@ bool AppInit(int argc, char* argv[]) ReadConfigFile(mapArgs, mapMultiArgs); } catch (const missing_zcash_conf& e) { fprintf(stderr, - (_("Before starting zcashd, you need to create a configuration file:\n" + (_("Before starting komodod, you need to create a configuration file:\n" "%s\n" "It can be completely empty! That indicates you are happy with the default\n" - "configuration of zcashd. But requiring a configuration file to start ensures\n" - "that zcashd won't accidentally compromise your privacy if there was a default\n" + "configuration of komodod. But requiring a configuration file to start ensures\n" + "that komodod won't accidentally compromise your privacy if there was a default\n" "option you needed to change.\n" "\n" "You can look at the example configuration file for suggestions of default\n" "options that you may want to change. It should be in one of these locations,\n" - "depending on how you installed Zcash:\n") + + "depending on how you installed Komodo:\n") + _("- Source code: %s\n" "- .deb package: %s\n")).c_str(), GetConfigFile().string().c_str(), - "contrib/debian/examples/zcash.conf", - "/usr/share/doc/zcash/examples/zcash.conf"); + "contrib/debian/examples/komodo.conf", + "/usr/share/doc/komodo/examples/komodo.conf"); return false; } catch (const std::exception& e) { fprintf(stderr,"Error reading configuration file: %s\n", e.what()); From 9ef7fec1efd4f45ca603fbd7a25aa2beae4a5f64 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Wed, 18 Jul 2018 06:54:43 +0000 Subject: [PATCH 027/887] Protect komodo_snapshot() by cs_main lock --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index 1376c3c7b..aa4435843 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -590,6 +590,7 @@ CBlockTreeDB *pblocktree = NULL; UniValue komodo_snapshot() { + LOCK(cs_main); int64_t total = -1; UniValue result(UniValue::VOBJ); From f345b95386d1ac73bc136b549dbf6f41e1854b86 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 18 Jul 2018 03:02:37 -1100 Subject: [PATCH 028/887] Initial assets --- src/cc/assets.cpp | 191 ++++++++++++++++++++ src/cc/betprotocol.cpp | 15 ++ src/cc/betprotocol.h | 15 ++ src/cc/eval.cpp | 19 ++ src/cc/eval.h | 19 +- src/cc/import.cpp | 15 ++ src/cc/utils.h | 15 ++ src/cryptoconditions/src/anon.c | 14 ++ src/cryptoconditions/src/cryptoconditions.c | 15 ++ src/cryptoconditions/src/ed25519.c | 15 ++ src/cryptoconditions/src/eval.c | 15 ++ src/cryptoconditions/src/internal.h | 15 ++ src/cryptoconditions/src/json_rpc.c | 15 ++ src/cryptoconditions/src/prefix.c | 14 ++ src/cryptoconditions/src/preimage.c | 14 ++ src/cryptoconditions/src/threshold.c | 14 ++ src/cryptoconditions/src/utils.c | 15 ++ 17 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 src/cc/assets.cpp diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp new file mode 100644 index 000000000..1e7dc61a8 --- /dev/null +++ b/src/cc/assets.cpp @@ -0,0 +1,191 @@ +/****************************************************************************** + * Copyright © 2014-2018 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +#include +#include