diff --git a/.gitignore b/.gitignore index b2e5cb99..4ad2d7ba 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,6 @@ share/setup.nsi cache/ venv-mnf/ -src/univalue/gen .deps .dirstamp diff --git a/configure.ac b/configure.ac index 37d9a221..c011ad4d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 3) define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_REVISION, 0) -define(_CLIENT_VERSION_BUILD, 0) +define(_CLIENT_VERSION_REVISION, 1) +define(_CLIENT_VERSION_BUILD, 1) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 800c424c..06df125c 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,8 +1,8 @@ package=boost -$(package)_version=1_66_0 -$(package)_download_path=https://dl.bintray.com/boostorg/release/1.66.0/source -$(package)_sha256_hash=5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9 +$(package)_version=1_72_0 +$(package)_download_path=https://dl.bintray.com/boostorg/release/1.72.0/source +$(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722 $(package)_file_name=$(package)_$($(package)_version).tar.bz2 define $(package)_set_vars diff --git a/depends/packages/native_ccache.mk b/depends/packages/native_ccache.mk index b63c18b9..ac2bb9f2 100644 --- a/depends/packages/native_ccache.mk +++ b/depends/packages/native_ccache.mk @@ -1,8 +1,8 @@ package=native_ccache -$(package)_version=3.3.1 -$(package)_download_path=https://www.samba.org/ftp/ccache -$(package)_file_name=ccache-$($(package)_version).tar.bz2 -$(package)_sha256_hash=cb6e4bafbb19ba0a2ec43386b123a5f92a20e1e3384c071d5d13e0cb3c84bf73 +$(package)_version=3.7.4 +$(package)_download_path=https://github.com/ccache/ccache/releases/download/v$($(package)_version) +$(package)_file_name=ccache-$($(package)_version).tar.xz +$(package)_sha256_hash=04c0af414b8cf89e541daed59735547fbfd323b1aaa983da0216f6b6731e6836 define $(package)_set_vars $(package)_config_opts= diff --git a/src/Makefile.am b/src/Makefile.am index c0075d82..b7745b11 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,6 +3,7 @@ DIST_SUBDIRS = secp256k1 univalue cryptoconditions AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(SAN_LDFLAGS) $(HARDENED_LDFLAGS) AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) AM_CPPFLAGS = $(HARDENED_CPPFLAGS) +EXTRA_LIBRARIES = if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include @@ -20,7 +21,7 @@ $(LIBLEVELDB) $(LIBMEMENV): endif BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config -BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include BITCOIN_INCLUDES += -I$(srcdir)/cc/includes diff --git a/src/assetchains b/src/assetchains old mode 100644 new mode 100755 index ce6c3aac..feecbda3 --- a/src/assetchains +++ b/src/assetchains @@ -4,7 +4,8 @@ set -eo pipefail # You can now add delay line to pubkey.txt file source pubkey.txt overide_args="$@" -seed_ip=`getent hosts zero.kolo.supernet.org | awk '{ print $1 }'` +seed_ip=`getent hosts zero.komodoseeds.com | awk '{ print $1 }'` +komodo_binary='./qt/komodo-qt' if [ -z "$delay" ]; then delay=20; fi @@ -14,6 +15,6 @@ if [ -z "$delay" ]; then delay=20; fi gen=" -gen -genproclimit=1" fi - ./komodod $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & + $komodo_binary $gen $args $overide_args -pubkey=$pubkey -addnode=$seed_ip & sleep $delay done diff --git a/src/assetchains.json b/src/assetchains.json index 86dc7756..66952c08 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -44,9 +44,16 @@ "ac_supply": "999999" }, { - "ac_name": "COQUI", + "ac_name": "COQUICASH", "ac_supply": "72000000", - "ac_ccactivate": "200000" + "ac_reward": "7200000000", + "ac_staked": "50", + "ac_halving": "420000", + "ac_cc": "2", + "ac_ccenable": "227,235,236,241", + "addnode": [ + "78.47.108.168" + ] }, { "ac_name": "WLC", @@ -226,20 +233,22 @@ "ac_supply": "90000000000", "ac_reward": "100000000", "ac_cc": "3", - "addnode": ["138.201.136.145"] + "ac_staked": "10", + "addnode": [ + "138.201.136.145", + "95.217.44.58" + ] }, { "ac_name": "MORTY", "ac_supply": "90000000000", "ac_reward": "100000000", "ac_cc": "3", - "addnode": ["138.201.136.145"] - }, - { - "ac_name": "VOTE2019", - "ac_supply": "123651638", - "ac_public": "1", - "addnode": ["95.213.238.98"] + "ac_staked": "10", + "addnode": [ + "138.201.136.145", + "95.217.44.58" + ] }, { "ac_name": "KOIN", @@ -268,5 +277,73 @@ "ac_supply": "64000777", "ac_staked": "10", "addnode": ["18.197.20.21"] - } + }, + { + "ac_name": "HUSH3", + "ac_sapling": "1", + "ac_founders": "1", + "ac_reward": "0,1125000000,562500000", + "ac_end": "128,340000,5422111", + "ac_blocktime": "150", + "ac_supply": "6178674", + "ac_halving": "129,340000,840000", + "ac_cc": "2", + "ac_cclib": "hush3", + "ac_ccenable": "228,234,235,236,241", + "ac_perc": "11111111", + "ac_eras": "3", + "ac_script": "76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac", + "clientname": "GoldenSandtrout", + "addnode": [ + "188.165.212.101", + "136.243.227.142", + "5.9.224.250" + ] + }, + { + "ac_name": "THC", + "ac_supply": "251253103", + "ac_reward": "360000000,300000000,240000000,180000000,150000000,90000000,0", + "ac_staked": "100", + "ac_eras": "7", + "ac_end": "500001,1000001,1500001,2000001,2500001,4500001,0", + "ac_perc": "233333333", + "ac_cc": "2", + "ac_ccenable": "229,236,240", + "ac_script": "2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8", + "ac_founders": "150", + "ac_cbmaturity": "1", + "ac_sapling": "1", + "earlytxid": "7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1", + "addnode": [ + "157.230.45.184", + "165.22.52.123" + ] + }, + { + "ac_name": "COMMOD", + "ac_supply": "0", + "ac_reward": "204800000000,100000000", + "ac_end": "482130,0", + "ac_halving": "43830,525960", + "ac_decay": "50000000,10000000", + "ac_eras": "2", + "ac_cc": "777", + "ac_public": "1", + "addnode": [ + "34.246.186.176", + "34.251.151.148" + ] + }, + { + "ac_name": "WLC21", + "ac_supply": "21000000", + "ac_reward": "190258751", + "ac_staked": "90", + "ac_public": "1", + "addnode": [ + "37.187.225.231", + "51.38.38.134" + ] + } ] diff --git a/src/assetchains.old b/src/assetchains.old index 4cf427c4..3e4917ff 100644 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -4,38 +4,38 @@ delay=60 source pubkey.txt echo $pubkey -./komodod -pubkey=$pubkey -ac_name=REVS -ac_supply=1300000 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=DEX -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=PANGEA -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=JUMBLR -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=BET -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=MSHARK -ac_supply=1400000 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=COQUI -ac_supply=72000000 -ac_ccactivate=200000 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=WLC -ac_supply=210000000 -addnode=148.251.190.89 $1 & -./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000007 -addnode=78.47.196.146 $1 & -./komodod -pubkey=$pubkey -ac_name=AXO -ac_supply=200000000 -ac_ccactivate=130000 -addnode=78.47.196.146 & -./komodod -pubkey=$pubkey -ac_name=ETOMIC -ac_supply=100000000 -addnode=78.47.196.146 & -./komodod -pubkey=$pubkey -ac_name=BTCH -ac_supply=20998641 -addnode=78.47.196.146 & -./komodod -pubkey=$pubkey -ac_name=BEER -ac_supply=100000000 -addnode=78.47.196.146 & -./komodod -pubkey=$pubkey -ac_name=PIZZA -ac_supply=100000000 -addnode=78.47.196.146 & -./komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=78.47.196.146 & -./komodod -pubkey=$pubkey -ac_name=OOT -ac_supply=216000000 -ac_sapling=5000000 -addnode=174.138.107.226 & -./komodod -pubkey=$pubkey -ac_name=BNTN -ac_supply=500000000 -addnode=94.130.169.205 & -./komodod -pubkey=$pubkey -ac_name=CHAIN -ac_supply=999999 -addnode=78.47.146.222 & +./komodod -pubkey=$pubkey -ac_name=REVS -ac_supply=1300000 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=SUPERNET -ac_supply=816061 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=DEX -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=PANGEA -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=JUMBLR -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=BET -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=CRYPTO -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=HODL -ac_supply=9999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=MSHARK -ac_supply=1400000 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=BOTS -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=MGW -ac_supply=999999 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=COQUICASH -ac_supply=72000000 -ac_reward=7200000000 -ac_staked=50 -ac_halving=420000 -ac_cc=2 -ac_ccenable=227,235,236,241 -addnode=78.47.108.168 & +./komodod -pubkey=$pubkey -ac_name=WLC -ac_supply=210000000 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=KV -ac_supply=1000000 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=CEAL -ac_supply=366666666 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=MESH -ac_supply=1000007 -addnode=95.213.238.98 $1 & +./komodod -pubkey=$pubkey -ac_name=AXO -ac_supply=200000000 -ac_ccactivate=130000 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=ETOMIC -ac_supply=100000000 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=BTCH -ac_supply=20998641 -addnode=95.213.238.98 & +#./komodod -pubkey=$pubkey -ac_name=BEER -ac_supply=100000000 -addnode=95.213.238.98 & +#./komodod -pubkey=$pubkey -ac_name=PIZZA -ac_supply=100000000 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=NINJA -ac_supply=100000000 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=OOT -ac_supply=216000000 -ac_sapling=5000000 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=BNTN -ac_supply=500000000 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=CHAIN -ac_supply=999999 -addnode=95.213.238.98 & ./komodod -pubkey=$pubkey -ac_name=PRLPAY -ac_supply=500000000 -addnode=13.250.226.125 & ./komodod -pubkey=$pubkey -ac_name=DSEC -ac_supply=7000000 -addnode=185.148.147.30 & -./komodod -pubkey=$pubkey -ac_name=GLXT -ac_supply=10000000000 -addnode=13.230.224.15 & +#./komodod -pubkey=$pubkey -ac_name=GLXT -ac_supply=10000000000 -addnode=13.230.224.15 & ./komodod -pubkey=$pubkey -ac_name=EQL -ac_supply=500000000 -ac_ccactivate=205000 -addnode=46.101.124.153 & ./komodod -pubkey=$pubkey -ac_name=ZILLA -ac_supply=11000000 -ac_sapling=5000000 -addnode=51.68.215.104 & -./komodod -pubkey=$pubkey -ac_name=RFOX -ac_supply=1000000000 -ac_reward=100000000 -addnode=78.47.196.146 & -~/VerusCoin/src/komodod -pubkey=$pubkey -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -ac_veruspos=50 -ac_supply=0 -ac_eras=3 -ac_reward=0,38400000000,2400000000 -ac_halving=1,43200,1051920 -ac_decay=100000000,0,0 -ac_end=10080,226080,0 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -addnode=185.25.48.236 -addnode=185.64.105.111 & +./komodod -pubkey=$pubkey -ac_name=RFOX -ac_supply=1000000000 -ac_reward=100000000 -addnode=95.213.238.98 & +#~/VerusCoin/src/komodod -pubkey=$pubkey -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -ac_veruspos=50 -ac_supply=0 -ac_eras=3 -ac_reward=0,38400000000,2400000000 -ac_halving=1,43200,1051920 -ac_decay=100000000,0,0 -ac_end=10080,226080,0 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -addnode=185.25.48.236 -addnode=185.64.105.111 & ./komodod -pubkey=$pubkey -ac_name=SEC -ac_cc=333 -ac_supply=1000000000 -addnode=185.148.145.43 & ./komodod -pubkey=$pubkey -ac_name=CCL -ac_supply=200000000 -ac_end=1 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=142.93.136.89 -addnode=195.201.22.89 & ./komodod -pubkey=$pubkey -ac_name=PIRATE -ac_supply=0 -ac_reward=25600000000 -ac_halving=77777 -ac_private=1 -addnode=178.63.77.56 & @@ -46,9 +46,13 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=KSB -ac_supply=1000000000 -ac_end=1 -ac_public=1 -addnode=37.187.225.231 & ./komodod -pubkey=$pubkey -ac_name=OUR -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_supply=100000000 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c -ac_public=1 -addnode=51.255.195.65 -addnode=217.182.129.38 -addnode=37.187.225.231 & ./komodod -pubkey=$pubkey -ac_name=ILN -ac_supply=10000000000 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=51.75.122.83 & -./komodod -pubkey=$pubkey -ac_name=RICK -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 & -./komodod -pubkey=$pubkey -ac_name=MORTY -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -addnode=138.201.136.145 & -./komodod -pubkey=$pubkey -ac_name=VOTE2019 -ac_supply=123651638 -ac_public=1 -addnode=95.213.238.98 & +./komodod -pubkey=$pubkey -ac_name=RICK -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -ac_staked=10 -addnode=95.217.44.58 -addnode=138.201.136.145 & +./komodod -pubkey=$pubkey -ac_name=MORTY -ac_supply=90000000000 -ac_reward=100000000 -ac_cc=3 -ac_staked=10 -addnode=95.217.44.58 -addnode=138.201.136.145 & ./komodod -pubkey=$pubkey -ac_name=KOIN -ac_supply=125000000 -addnode=3.0.32.10 & ./komodod -pubkey=$pubkey -ac_name=ZEXO -ac_supply=100000000 -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_ccenable=236 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02713bd85e054db923694b6b7a85306264edf4d6bd6d331814f2b40af444b3ebbc -ac_public=1 -addnode=80.240.17.222 & ./komodod -pubkey=$pubkey -ac_name=K64 -ac_supply=64000777 -ac_reward=0 -ac_staked=10 -addnode=18.197.20.211 & +./komodod -pubkey=$pubkey -ac_name=HUSH3 -ac_sapling=1 -ac_reward=0,1125000000,562500000 -ac_halving=129,340000,840000 -ac_end=128,340000,5422111 -ac_eras=3 -ac_blocktime=150 -ac_cc=2 -ac_ccenable=228,234,235,236,241 -ac_founders=1 -ac_supply=6178674 -ac_perc=11111111 -clientname=GoldenSandtrout -addnode=188.165.212.101 -addnode=136.243.227.142 -addnode=5.9.224.250 -ac_cclib=hush3 -ac_script=76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac & +./komodod -pubkey=$pubkey -ac_name=THC -ac_supply=251253103 -ac_reward=360000000,300000000,240000000,180000000,150000000,90000000,0 -ac_staked=100 -ac_eras=7 -ac_end=500001,1000001,1500001,2000001,2500001,4500001,0 -ac_perc=233333333 -ac_cc=2 -ac_ccenable=229,236,240 -ac_script=2ea22c8020987fad30df055db6fd922c3a57e55d76601229ed3da3b31340112e773df3d0d28103120c008203000401ccb8 -ac_founders=150 -ac_cbmaturity=1 -ac_sapling=1 -addnode=157.230.45.184 -addnode=165.22.52.123 -earlytxid=7e4a76259e99c9379551389e9f757fc5f46c33ae922a8644dc2b187af2a6adc1 & +./komodod -pubkey=$pubkey -ac_name=COMMOD -ac_supply=0 -ac_reward=204800000000,100000000 -ac_end=482130,0 -ac_halving=43830,525960 -ac_decay=50000000,10000000 -ac_eras=2 -ac_cc=777 -ac_public=1 -addnode=34.246.186.176 -addnode=34.251.151.148 & +./komodod -pubkey=$pubkey -ac_name=WLC21 -ac_supply=21000000 -ac_reward=190258751 -ac_staked=90 -ac_public=1 -addnode=37.187.225.231 -addnode=51.38.38.134 & + diff --git a/src/assetchains_stop b/src/assetchains_stop index 60549dc2..6fb8f6f7 100644 --- a/src/assetchains_stop +++ b/src/assetchains_stop @@ -1,6 +1,7 @@ #!/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/bitcoind.cpp b/src/bitcoind.cpp index 17290376..1a684634 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -65,11 +65,25 @@ void komodo_passport_iteration(); uint64_t komodo_interestsum(); int32_t komodo_longestchain(); void komodo_cbopretupdate(int32_t forceflag); +CBlockIndex *komodo_chainactive(int32_t height); void WaitForShutdown(boost::thread_group* threadGroup) { - int32_t i; bool fShutdown = ShutdownRequested(); + int32_t i,height; CBlockIndex *pindex; bool fShutdown = ShutdownRequested(); const uint256 zeroid; // Tell the main threads to shutdown. + if (komodo_currentheight()>KOMODO_EARLYTXID_HEIGHT && KOMODO_EARLYTXID!=zeroid && ((height=tx_height(KOMODO_EARLYTXID))==0 || height>KOMODO_EARLYTXID_HEIGHT)) + { + LogPrintf("error: earlytx must be before block height %d or tx does not exist\n",KOMODO_EARLYTXID_HEIGHT); + StartShutdown(); + } + /*if ( ASSETCHAINS_STAKED == 0 && ASSETCHAINS_ADAPTIVEPOW == 0 && (pindex= komodo_chainactive(1)) != 0 ) + { + if ( pindex->nTime > ADAPTIVEPOW_CHANGETO_DEFAULTON ) + { + ASSETCHAINS_ADAPTIVEPOW = 1; + fprintf(stderr,"default activate adaptivepow\n"); + } else fprintf(stderr,"height1 time %u vs %u\n",pindex->nTime,ADAPTIVEPOW_CHANGETO_DEFAULTON); + } //else fprintf(stderr,"cant find height 1\n");*/ if ( ASSETCHAINS_CBOPRET != 0 ) komodo_pricesinit(); while (!fShutdown) @@ -77,7 +91,8 @@ void WaitForShutdown(boost::thread_group* threadGroup) //LogPrintf("call passport iteration\n"); if ( ASSETCHAINS_SYMBOL[0] == 0 ) { - komodo_passport_iteration(); + if ( KOMODO_NSPV_FULLNODE ) + komodo_passport_iteration(); for (i=0; i<10; i++) { fShutdown = ShutdownRequested(); @@ -155,23 +170,21 @@ bool AppInit(int argc, char* argv[]) try { + // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) + if (!SelectParamsFromCommandLine()) { + LogPrintf("Error: Invalid combination of -regtest and -testnet.\n"); + return false; + } void komodo_args(char *argv0); komodo_args(argv[0]); + void chainparams_commandline(); + chainparams_commandline(); + LogPrintf("call komodo_args.(%s) NOTARY_PUBKEY.(%s)\n",argv[0],NOTARY_PUBKEY.c_str()); - while ( ASSETCHAIN_INIT == 0 ) - { - //if ( komodo_is_issuer() != 0 ) - // komodo_passport_iteration(); - #ifdef _WIN32 - boost::this_thread::sleep_for(boost::chrono::seconds(1)); - #else - sleep(1); - #endif - } LogPrintf("initialized %s at %u\n",ASSETCHAINS_SYMBOL,(uint32_t)time(NULL)); if (!boost::filesystem::is_directory(GetDataDir(false))) { - LogPrintf( "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); + LogPrintf("Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; } try @@ -199,11 +212,6 @@ bool AppInit(int argc, char* argv[]) LogPrintf("Error reading configuration file: %s\n", e.what()); return false; } - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) - if (!SelectParamsFromCommandLine()) { - LogPrintf( "Error: Invalid combination of -regtest and -testnet.\n"); - return false; - } // Command-line RPC bool fCommandLine = false; diff --git a/src/cc/CCGateways.h b/src/cc/CCGateways.h index 8dfed186..8793c0dc 100644 --- a/src/cc/CCGateways.h +++ b/src/cc/CCGateways.h @@ -20,16 +20,16 @@ #include "CCinclude.h" bool GatewaysValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); -std::string GatewaysBind(uint64_t txfee,std::string coin,uint256 tokenid,int64_t totalsupply,uint256 oracletxid,uint8_t M,uint8_t N,std::vector pubkeys,uint8_t p1,uint8_t p2,uint8_t p3,uint8_t p4); -std::string GatewaysDeposit(uint64_t txfee,uint256 bindtxid,int32_t height,std::string refcoin,uint256 cointxid,int32_t claimvout,std::string deposithex,std::vectorproof,CPubKey destpub,int64_t amount); -std::string GatewaysClaim(uint64_t txfee,uint256 bindtxid,std::string refcoin,uint256 deposittxid,CPubKey destpub,int64_t amount); -std::string GatewaysWithdraw(uint64_t txfee,uint256 bindtxid,std::string refcoin,CPubKey withdrawpub,int64_t amount); -std::string GatewaysPartialSign(uint64_t txfee,uint256 txidaddr,std::string refcoin,std::string hex); -std::string GatewaysCompleteSigning(uint64_t txfee,uint256 txidaddr,std::string refcoin,std::string hex); -std::string GatewaysMarkDone(uint64_t txfee,uint256 withdrawtxid,std::string refcoin); -UniValue GatewaysPendingDeposits(uint256 bindtxid,std::string refcoin); -UniValue GatewaysPendingWithdraws(uint256 bindtxid,std::string refcoin); -UniValue GatewaysProcessedWithdraws(uint256 bindtxid,std::string refcoin); +UniValue GatewaysBind(const CPubKey& pk, uint64_t txfee,std::string coin,uint256 tokenid,int64_t totalsupply,uint256 oracletxid,uint8_t M,uint8_t N,std::vector pubkeys,uint8_t p1,uint8_t p2,uint8_t p3,uint8_t p4); +UniValue GatewaysDeposit(const CPubKey& pk, uint64_t txfee,uint256 bindtxid,int32_t height,std::string refcoin,uint256 cointxid,int32_t claimvout,std::string deposithex,std::vectorproof,CPubKey destpub,int64_t amount); +UniValue GatewaysClaim(const CPubKey& pk, uint64_t txfee,uint256 bindtxid,std::string refcoin,uint256 deposittxid,CPubKey destpub,int64_t amount); +UniValue GatewaysWithdraw(const CPubKey& pk, uint64_t txfee,uint256 bindtxid,std::string refcoin,CPubKey withdrawpub,int64_t amount); +UniValue GatewaysPartialSign(const CPubKey& pk, uint64_t txfee,uint256 txidaddr,std::string refcoin,std::string hex); +UniValue GatewaysCompleteSigning(const CPubKey& pk, uint64_t txfee,uint256 txidaddr,std::string refcoin,std::string hex); +UniValue GatewaysMarkDone(const CPubKey& pk, uint64_t txfee,uint256 withdrawtxid,std::string refcoin); +UniValue GatewaysPendingDeposits(const CPubKey& pk, uint256 bindtxid,std::string refcoin); +UniValue GatewaysPendingWithdraws(const CPubKey& pk, uint256 bindtxid,std::string refcoin); +UniValue GatewaysProcessedWithdraws(const CPubKey& pk, uint256 bindtxid,std::string refcoin); // CCcustom UniValue GatewaysInfo(uint256 bindtxid); diff --git a/src/cc/CCImportGateway.h b/src/cc/CCImportGateway.h index 671b431c..9be54f23 100644 --- a/src/cc/CCImportGateway.h +++ b/src/cc/CCImportGateway.h @@ -28,7 +28,6 @@ std::string ImportGatewayWithdraw(uint64_t txfee,uint256 bindtxid,std::string re std::string ImportGatewayPartialSign(uint64_t txfee,uint256 lasttxid,std::string refcoin, std::string hex); std::string ImportGatewayCompleteSigning(uint64_t txfee,uint256 lasttxid,std::string refcoin,std::string hex); std::string ImportGatewayMarkDone(uint64_t txfee,uint256 completetxid,std::string refcoin); -UniValue ImportGatewayPendingDeposits(uint256 bindtxid,std::string refcoin); UniValue ImportGatewayPendingWithdraws(uint256 bindtxid,std::string refcoin); UniValue ImportGatewayProcessedWithdraws(uint256 bindtxid,std::string refcoin); UniValue ImportGatewayExternalAddress(uint256 bindtxid,CPubKey pubkey); diff --git a/src/cc/CCOracles.h b/src/cc/CCOracles.h index bb7d4557..10dbfae9 100644 --- a/src/cc/CCOracles.h +++ b/src/cc/CCOracles.h @@ -20,13 +20,13 @@ #include "CCinclude.h" bool OraclesValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); -std::string OracleCreate(int64_t txfee,std::string name,std::string description,std::string format); -std::string OracleFund(int64_t txfee,uint256 oracletxid); -std::string OracleRegister(int64_t txfee,uint256 oracletxid,int64_t datafee); -std::string OracleSubscribe(int64_t txfee,uint256 oracletxid,CPubKey publisher,int64_t amount); -std::string OracleData(int64_t txfee,uint256 oracletxid,std::vector data); - +UniValue OracleCreate(const CPubKey& pk, int64_t txfee,std::string name,std::string description,std::string format); +UniValue OracleFund(const CPubKey& pk, int64_t txfee,uint256 oracletxid); +UniValue OracleRegister(const CPubKey& pk, int64_t txfee,uint256 oracletxid,int64_t datafee); +UniValue OracleSubscribe(const CPubKey& pk, int64_t txfee,uint256 oracletxid,CPubKey publisher,int64_t amount); +UniValue OracleData(const CPubKey& pk, int64_t txfee,uint256 oracletxid,std::vector data); // CCcustom +UniValue OracleDataSample(uint256 reforacletxid,uint256 txid); UniValue OracleDataSamples(uint256 reforacletxid,char* batonaddr,int32_t num); UniValue OracleInfo(uint256 origtxid); UniValue OraclesList(); diff --git a/src/cc/CCPegs.h b/src/cc/CCPegs.h index 8d2a268f..78f1acca 100644 --- a/src/cc/CCPegs.h +++ b/src/cc/CCPegs.h @@ -22,6 +22,15 @@ bool PegsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); // CCcustom -UniValue PegsInfo(); +UniValue PegsCreate(const CPubKey& pk,uint64_t txfee,int64_t amount,std::vector bindtxids); +UniValue PegsFund(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount); +UniValue PegsGet(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount); +UniValue PegsRedeem(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid); +UniValue PegsLiquidate(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, uint256 liquidatetxid); +UniValue PegsExchange(const CPubKey& pk,uint64_t txfee,uint256 pegstxid, uint256 tokenid, int64_t amount); +UniValue PegsAccountHistory(const CPubKey& pk,uint256 pegstxid); +UniValue PegsAccountInfo(const CPubKey& pk,uint256 pegstxid); +UniValue PegsWorstAccounts(uint256 pegstxid); +UniValue PegsInfo(uint256 pegstxid); #endif diff --git a/src/cc/CCassetstx.cpp b/src/cc/CCassetstx.cpp index 1961e360..c2b0ad93 100644 --- a/src/cc/CCassetstx.cpp +++ b/src/cc/CCassetstx.cpp @@ -19,7 +19,6 @@ UniValue AssetOrders(uint256 refassetid, CPubKey pk, uint8_t additionalEvalCode) { - static uint256 zero; UniValue result(UniValue::VARR); struct CCcontract_info *cpAssets, assetsC; @@ -35,19 +34,19 @@ UniValue AssetOrders(uint256 refassetid, CPubKey pk, uint8_t additionalEvalCode) std::vector origpubkey; CTransaction ordertx; uint8_t funcid, evalCode; - char numstr[32], funcidstr[16], origaddr[64], origtokenaddr[64], assetidstr[65]; + char numstr[32], funcidstr[16], origaddr[64], origtokenaddr[64]; txid = it->first.txhash; LOGSTREAM("ccassets", CCLOG_DEBUG2, stream << "addOrders() checking txid=" << txid.GetHex() << std::endl); - if ( GetTransaction(txid, ordertx, hashBlock, false) != 0 ) + if ( myGetTransaction(txid, ordertx, hashBlock) != 0 ) { // for logging: funcid = DecodeAssetOpRet(vintx.vout[vintx.vout.size() - 1].scriptPubKey, evalCode, assetid, assetid2, price, origpubkey); if (ordertx.vout.size() > 0 && (funcid = DecodeAssetTokenOpRet(ordertx.vout[ordertx.vout.size()-1].scriptPubKey, evalCode, assetid, assetid2, price, origpubkey)) != 0) { LOGSTREAM("ccassets", CCLOG_DEBUG2, stream << "addOrders() checking ordertx.vout.size()=" << ordertx.vout.size() << " funcid=" << (char)(funcid ? funcid : ' ') << " assetid=" << assetid.GetHex() << std::endl); - if (refassetid != zero && assetid == refassetid || - pk != CPubKey() && pk == pubkey2pk(origpubkey) && (funcid == 'S' || funcid == 's')) + if (pk == CPubKey() && (refassetid == zeroid || assetid == refassetid) // tokenorders + || pk != CPubKey() && pk == pubkey2pk(origpubkey) && (funcid == 'S' || funcid == 's')) // mytokenorders, returns only asks (is this correct?) { LOGSTREAM("ccassets", CCLOG_DEBUG2, stream << "addOrders() it->first.index=" << it->first.index << " ordertx.vout[it->first.index].nValue=" << ordertx.vout[it->first.index].nValue << std::endl); @@ -61,7 +60,7 @@ UniValue AssetOrders(uint256 refassetid, CPubKey pk, uint8_t additionalEvalCode) funcidstr[0] = funcid; funcidstr[1] = 0; item.push_back(Pair("funcid", funcidstr)); - item.push_back(Pair("txid", uint256_str(assetidstr, txid))); + item.push_back(Pair("txid", txid.GetHex())); item.push_back(Pair("vout", (int64_t)it->first.index)); if (funcid == 'b' || funcid == 'B') { @@ -77,7 +76,7 @@ UniValue AssetOrders(uint256 refassetid, CPubKey pk, uint8_t additionalEvalCode) sprintf(numstr, "%llu", (long long)ordertx.vout[0].nValue); item.push_back(Pair("askamount", numstr)); } - if (origpubkey.size() == 33) + if (origpubkey.size() == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE) { GetCCaddress(cp, origaddr, pubkey2pk(origpubkey)); item.push_back(Pair("origaddress", origaddr)); @@ -86,9 +85,9 @@ UniValue AssetOrders(uint256 refassetid, CPubKey pk, uint8_t additionalEvalCode) } if (assetid != zeroid) - item.push_back(Pair("tokenid", uint256_str(assetidstr, assetid))); + item.push_back(Pair("tokenid", assetid.GetHex())); if (assetid2 != zeroid) - item.push_back(Pair("otherid", uint256_str(assetidstr, assetid2))); + item.push_back(Pair("otherid", assetid2.GetHex())); if (price > 0) { if (funcid == 's' || funcid == 'S' || funcid == 'e' || funcid == 'e') @@ -273,7 +272,7 @@ std::string CreateBuyOffer(int64_t txfee, int64_t bidamount, uint256 assetid, in LogPrintf("negative bidamount %lld, pricetotal %lld\n",(long long)bidamount,(long long)pricetotal); return(""); } - if (GetTransaction(assetid, vintx, hashBlock, false) == 0) + if (myGetTransaction(assetid, vintx, hashBlock) == 0) { LogPrintf("cant find assetid\n"); return(""); @@ -467,7 +466,7 @@ std::string CancelBuyOffer(int64_t txfee,uint256 assetid,uint256 bidtxid) if (AddNormalinputs(mtx, mypk, txfee, 3) > 0) { mask = ~((1LL << mtx.vin.size()) - 1); - if (GetTransaction(bidtxid, vintx, hashBlock, false) != 0) + if (myGetTransaction(bidtxid, vintx, hashBlock) != 0) { std::vector vopretNonfungible; GetNonfungibleData(assetid, vopretNonfungible); @@ -516,7 +515,7 @@ std::string CancelSell(int64_t txfee,uint256 assetid,uint256 asktxid) if (AddNormalinputs(mtx, mypk, txfee, 3) > 0) { mask = ~((1LL << mtx.vin.size()) - 1); - if (GetTransaction(asktxid, vintx, hashBlock, false) != 0) + if (myGetTransaction(asktxid, vintx, hashBlock) != 0) { std::vector vopretNonfungible; GetNonfungibleData(assetid, vopretNonfungible); @@ -589,7 +588,7 @@ std::string FillBuyOffer(int64_t txfee,uint256 assetid,uint256 bidtxid,int64_t f if (AddNormalinputs(mtx, mypk, 2*txfee, 3) > 0) { mask = ~((1LL << mtx.vin.size()) - 1); - if (GetTransaction(bidtxid, vintx, hashBlock, false) != 0) + if (myGetTransaction(bidtxid, vintx, hashBlock) != 0) { bidamount = vintx.vout[bidvout].nValue; SetAssetOrigpubkey(origpubkey, origprice, vintx); @@ -691,7 +690,7 @@ std::string FillSell(int64_t txfee, uint256 assetid, uint256 assetid2, uint256 a //if (AddNormalinputs(mtx, mypk, 2*txfee, 3) > 0) //{ //mask = ~((1LL << mtx.vin.size()) - 1); - if (GetTransaction(asktxid, vintx, hashBlock, false) != 0) + if (myGetTransaction(asktxid, vintx, hashBlock) != 0) { orig_assetoshis = vintx.vout[askvout].nValue; SetAssetOrigpubkey(origpubkey, total_nValue, vintx); diff --git a/src/cc/CCchannels.h b/src/cc/CCchannels.h index 10cb4d22..ecca145d 100644 --- a/src/cc/CCchannels.h +++ b/src/cc/CCchannels.h @@ -21,12 +21,12 @@ #define CHANNELS_MAXPAYMENTS 1000 bool ChannelsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); -std::string ChannelOpen(uint64_t txfee,CPubKey destpub,int32_t numpayments,int64_t payment,uint256 tokenid); -std::string ChannelPayment(uint64_t txfee,uint256 opentxid,int64_t amount, uint256 secret); -std::string ChannelClose(uint64_t txfee,uint256 opentxid); -std::string ChannelRefund(uint64_t txfee,uint256 opentxid,uint256 closetxid); -UniValue ChannelsList(); +UniValue ChannelOpen(const CPubKey& pk,uint64_t txfee,CPubKey destpub,int32_t numpayments,int64_t payment,uint256 tokenid); +UniValue ChannelPayment(const CPubKey& pk,uint64_t txfee,uint256 opentxid,int64_t amount, uint256 secret); +UniValue ChannelClose(const CPubKey& pk,uint64_t txfee,uint256 opentxid); +UniValue ChannelRefund(const CPubKey& pk,uint64_t txfee,uint256 opentxid,uint256 closetxid); +UniValue ChannelsList(const CPubKey& pk); // CCcustom -UniValue ChannelsInfo(uint256 opentxid); +UniValue ChannelsInfo(const CPubKey& pk,uint256 opentxid); #endif diff --git a/src/cc/CCfaucet.h b/src/cc/CCfaucet.h index 3cb6c66e..af3237ab 100644 --- a/src/cc/CCfaucet.h +++ b/src/cc/CCfaucet.h @@ -25,8 +25,8 @@ bool FaucetValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &tx, uint32_t nIn); // CCcustom -std::string FaucetFund(uint64_t txfee,int64_t funds); -std::string FaucetGet(uint64_t txfee); +UniValue FaucetFund(const CPubKey& mypk,uint64_t txfee,int64_t funds); +UniValue FaucetGet(const CPubKey& mypk,uint64_t txfee); UniValue FaucetInfo(); #endif diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index 1d8cf669..1d28e2cc 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -16,26 +16,43 @@ #ifndef CC_INCLUDE_H #define CC_INCLUDE_H -/* -there are only a very few types in bitcoin. pay to pubkey, pay to pubkey hash and pay to script hash -p2pk, p2pkh, p2sh -there are actually more that are possible, but those three are 99%+ of bitcoin transactions -so you can pay to a pubkey, or to its hash. or to a script's hash. the last is how most of the more complex scripts are invoked. to spend a p2sh vout, you need to provide the redeemscript, this script's hash is what the p2sh address was. -all of the above are the standard bitcoin vout types and there should be plenty of materials about it -Encrypted by a verified device -what I did with the CC contracts is created a fourth type of vout, the CC vout. this is using the cryptoconditions standard and it is even a different signature mechanism. ed25519 instead of secp256k1. it is basically a big extension to the bitcoin script. There is a special opcode that is added that says it is a CC script. - -but it gets more interesting -each CC script has an evalcode -this is just an arbitrary number. but what it does is allows to create a self-contained universe of CC utxo that all have the same evalcode and that is how a faucet CC differentiates itself from a dice CC, the eval code is different - -one effect from using a different eval code is that even if the rest of the CC script is the same, the bitcoin address that is calculated is different. what this means is that for each pubkey, there is a unique address for each different eval code! -and this allows efficient segregation of one CC contracts transactions from another -the final part that will make it all clear how the funds can be locked inside the contract. this is what makes a contract, a contract. I put both the privkey and pubkey for a randomly chosen address and associate it with each CC contract. That means anybody can sign outputs for that privkey. However, it is a CC output, so in addition to the signature, whatever constraints a CC contract implements must also be satistifed. This allows funds to be locked and yet anybody is able to spend it, assuming they satisfy the CC's rules - -one other technical note is that komodod has the insight-explorer extensions built in. so it can lookup directly all transactions to any address. this is a key performance boosting thing as if it wasnt there, trying to get all the utxo for an address not in the wallet is quite time consuming +/*! \file CCinclude.h +\brief A Documented file. + +Details. */ +/// \mainpage Brief introduction into cryptocondition contracts +/// There are only a very few types in bitcoin: pay to pubkey, pay to pubkey hash and pay to script hash (p2pk, p2pkh, p2sh). +/// There are actually more that are possible, but those three are 99%+ of bitcoin transactions. +/// So you can pay to a pubkey, or to its hash or to a script's hash. The last is how most of the more complex scripts are invoked. To spend a p2sh vout, you need to provide the redeemscript, +/// this script's hash is what the p2sh address was. +/// All of the above are the standard bitcoin vout types and there should be plenty of materials about it. +/// +/// What I did with the cryptoconditions (CC) contracts (now rebranded as Antara modules) is created a fourth type of vout, the CC vout. This is using the cryptoconditions standard and it is even a different signature mechanism, +/// ed25519 instead of secp256k1. It is basically a big extension to the bitcoin script. There is a special opcode that is added that says it is a CC script. +/// +/// But it gets more interesting. Each CC script has an evalcode. +/// This is just an arbitrary number but what it does is allows to create a self-contained universe of CC utxo that all have the same evalcode and that is +/// how a faucet CC contract differentiates itself from a dice CC contract, the eval code is different. +/// +/// One effect from using a different eval code is that even if the rest of the CC script is the same, the bitcoin address that is calculated is different. +/// What this means is that for each pubkey, there is a unique address for each different eval code! +/// And this allows efficient segregation of one CC contracts transactions from another. +/// The final part that will make it all clear how the funds can be locked inside the contract. +/// This is what makes a contract, a contract. +/// I put both the privkey and pubkey for a randomly chosen address and associate it with each CC contract. +/// That means anybody can sign outputs for that privkey. +/// However, it is a CC output, so in addition to the signature, whatever constraints a CC contract implements must also be satistifed. +/// This allows funds to be locked and yet anybody is able to spend it, assuming they satisfy the CC's rules. +/// +/// One other technical note is that komodod has the insight-explorer extensions built in +/// so it can lookup directly all transactions to any address. +/// This is a key performance boosting thing as if it wasnt there, trying to get all the utxo for an address not in the wallet is quite time consuming. +/// +/// More information about Antara framework: +/// https://developers.komodoplatform.com/basic-docs/start-here/about-komodo-platform/product-introductions.html#smart-chains-antara + #include #include