Merge pull request #38 from VerusCoin/dev
Get all the changes. Mikes bug fix, Asher's CI work, Dave's verus-cli stuff.
This commit is contained in:
53
.travis.yml
53
.travis.yml
@@ -6,12 +6,10 @@ compiler:
|
|||||||
- gcc
|
- gcc
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
|
|
||||||
- KOMODO_BUILD_DIR=Komodo-build
|
|
||||||
- COMPRESSED_BUILD=Komodo-build.tar.gz
|
|
||||||
- CCACHE_SIZE=100M
|
- CCACHE_SIZE=100M
|
||||||
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
- CCACHE_TEMPDIR=/tmp/.ccache-temp
|
||||||
- CCACHE_COMPRESS=1
|
- CCACHE_COMPRESS=1
|
||||||
|
- STORAGE_DEST=gs://$BUCKET/$PROJECT/$TRAVIS_BRANCH/
|
||||||
cache:
|
cache:
|
||||||
apt: true
|
apt: true
|
||||||
directories:
|
directories:
|
||||||
@@ -23,48 +21,47 @@ matrix:
|
|||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
- compiler: ": Linux"
|
- compiler: ": Linux"
|
||||||
env: HOST=x86_64-unknown-linux-gnu TARGET_PLATFORM=linux64 BUILD_SCRIPT=build.sh
|
env: BUILD_SCRIPT=build.sh
|
||||||
TRAVIS_OS_NAME=linux PACKAGES="build-essential pkg-config libc6-dev m4 g++-multilib
|
PACKAGES="build-essential pkg-config libc6-dev m4 g++-multilib
|
||||||
autoconf libtool ncurses-dev unzip python zlib1g-dev wget bsdmainutils automake
|
autoconf libtool ncurses-dev unzip python zlib1g-dev wget bsdmainutils automake
|
||||||
libssl-dev libprotobuf-dev protobuf-compiler libqrencode-dev libdb++-dev software-properties-common
|
libssl-dev libprotobuf-dev protobuf-compiler libqrencode-dev libdb++-dev software-properties-common
|
||||||
libcurl4-openssl-dev curl" PPA="ppa:chris-lea/zeromq" KOMODO_EXEC_SET="komodod
|
libcurl4-openssl-dev curl"
|
||||||
komodo-cli"
|
PACKAGE_NAME=verus-cli-linux.tar.gz
|
||||||
|
PACKAGING_MATRIX="cp src/komodod src/komodo-cli kmd/linux/verus-cli && chmod -R +x kmd/linux/verus-cli/ && cd kmd/linux && tar -czf $PACKAGE_NAME verus-cli && ls"
|
||||||
- compiler: ": Windows"
|
- compiler: ": Windows"
|
||||||
env: HOST=x86_64-w64-mingw32 TARGET_PLATFORM=win64 RUST_TARGET=x86_64-pc-windows-gnu
|
env: RUST_TARGET=x86_64-pc-windows-gnu
|
||||||
BUILD_SCRIPT=build-win.sh PACKAGES="build-essential pkg-config libcurl3-gnutls-dev
|
BUILD_SCRIPT=build-win.sh
|
||||||
|
PACKAGES="build-essential pkg-config libcurl3-gnutls-dev
|
||||||
libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git
|
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
|
python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler
|
||||||
libdb++-dev ntp ntpdate mingw-w64 wine bc" KOMODO_EXEC_SET="komodod.exe komodo-cli.exe
|
libdb++-dev ntp ntpdate mingw-w64 wine bc"
|
||||||
komodo-tx.exe"
|
PACKAGE_NAME=verus-cli-windows.zip
|
||||||
|
PACKAGING_MATRIX="cp src/komodod.exe src/komodo-cli.exe src/komodo-tx.exe kmd/windows/verus-cli &&
|
||||||
|
cd kmd/windows && zip -r9 $PACKAGE_NAME verus-cli && ls"
|
||||||
exclude:
|
exclude:
|
||||||
- compiler: gcc
|
- compiler: gcc
|
||||||
install:
|
install:
|
||||||
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export
|
- if [ $TRAVIS_OS_NAME = linux ]; then sudo rm -f /etc/apt/sources.list.d/travis_ci_zeromq3-source.list &&
|
||||||
CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
|
travis_retry sudo apt-get -y update && travis_retry sudo apt-get -y install -qq $PACKAGES; fi
|
||||||
- source /home/travis/google-cloud-sdk/path.bash.inc
|
- if [ -n "$RUST_TARGET" ]; then curl -sSf https://build.travis-ci.org/files/rustup-init.sh
|
||||||
- sudo rm -f /etc/apt/sources.list.d/travis_ci_zeromq3-source.list
|
| sh -s -- --default-toolchain stable -y && export PATH=$PATH:$HOME/.cargo/bin:$PATH && rustup target add $RUST_TARGET; fi
|
||||||
- travis_retry sudo apt-get -y update && sudo apt-get -y install -qq $PACKAGES
|
|
||||||
- if [ $TARGET_PLATFORM = win64 ]; then curl -sSf https://build.travis-ci.org/files/rustup-init.sh
|
|
||||||
| sh -s -- --default-toolchain stable -y && export PATH=$PATH:$HOME/.cargo/bin:$PATH;
|
|
||||||
fi
|
|
||||||
- if [ $TARGET_PLATFORM = win64 ]; then rustup target add $RUST_TARGET; fi
|
|
||||||
before_script:
|
before_script:
|
||||||
- unset CC; unset CXX
|
- unset CC; unset CXX
|
||||||
- mkdir -p depends/SDKs depends/sdk-sources
|
|
||||||
script:
|
script:
|
||||||
- "./zcutil/fetch-params.sh"
|
- "./zcutil/fetch-params.sh"
|
||||||
- "./zcutil/$BUILD_SCRIPT -j2"
|
- "./zcutil/$BUILD_SCRIPT -j2"
|
||||||
after_script:
|
after_script:
|
||||||
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then gcloud auth activate-service-account
|
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then eval "${PACKAGING_MATRIX}" &&
|
||||||
--key-file AUTH_KEY.json; fi
|
gsutil cp $PACKAGE_NAME $STORAGE_DEST; fi
|
||||||
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cd src && mkdir $TARGET_PLATFORM &&
|
|
||||||
cp -r $KOMODO_EXEC_SET $TARGET_PLATFORM && tar -czvf $TARGET_PLATFORM.tar.gz $TARGET_PLATFORM;
|
|
||||||
fi
|
|
||||||
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then gsutil cp $TARGET_PLATFORM.tar.gz
|
|
||||||
gs://$BUCKET/$PROJECT/$TRAVIS_BRANCH/; fi
|
|
||||||
notifications:
|
notifications:
|
||||||
slack:
|
slack:
|
||||||
secure: FiVlFhSw5xnDu1Cx2yAo3J7miFCSRyuzR/2+8LKFjdWl5+fyIGvQ9x5vgUg6dWbv3UP9iIMqQuWfotsg8H+NE8pYRZQ0zDVxZ5h9+PA028qGb3OF4TMFNcltP5DGtAZ6AqrMNRZ4ltatPUm5H9ig1bhzjsx+3pqlqQuVXTXPjaUryB5s/fk2CjrsV6zTLfPHiI30jeMjmQrJJLik1vSWF70sB6HkQhvaT6jymkO4Vuh+cja418W1xIgkkoRsOXiZ/JK4hIypFo/sBkmIOprGqoFUahFqJlsBoSrp9iAzkwbDItIqqvNCHTEeN7lj6kK43ZK72E4etjjNc0CXWeleXBJBCj5Prq2lEkQ4NwuDTos3KLyyr2vI7f54xhb5+wjzY9dByHXGuG5UaNz0+uukuJinAdazGaNmmfesv1wg9p3jGa/TLsfHLMcUti875DzkUHnenivP5cXrc6/uuZyyQNq5+Gn/3DA8k0y7d1e23nm3nDjCNfATAn3yu1jieYY2yYI6CYGEXcD+UbP61uG6no+mm/lkQbQosyDfE0sADqGryqXswRste+R0sSVMBQtTipAZOUoYNbEmhN4+L78SSp3zpmgkrIxAw7le8oj6Evp2ofvE2Kvh+Z0MVoEJx6mtZI6hheIFSS38NeUZr/HBfRSpaElOYTN/ZNf8QwThCWo=
|
secure: FiVlFhSw5xnDu1Cx2yAo3J7miFCSRyuzR/2+8LKFjdWl5+fyIGvQ9x5vgUg6dWbv3UP9iIMqQuWfotsg8H+NE8pYRZQ0zDVxZ5h9+PA028qGb3OF4TMFNcltP5DGtAZ6AqrMNRZ4ltatPUm5H9ig1bhzjsx+3pqlqQuVXTXPjaUryB5s/fk2CjrsV6zTLfPHiI30jeMjmQrJJLik1vSWF70sB6HkQhvaT6jymkO4Vuh+cja418W1xIgkkoRsOXiZ/JK4hIypFo/sBkmIOprGqoFUahFqJlsBoSrp9iAzkwbDItIqqvNCHTEeN7lj6kK43ZK72E4etjjNc0CXWeleXBJBCj5Prq2lEkQ4NwuDTos3KLyyr2vI7f54xhb5+wjzY9dByHXGuG5UaNz0+uukuJinAdazGaNmmfesv1wg9p3jGa/TLsfHLMcUti875DzkUHnenivP5cXrc6/uuZyyQNq5+Gn/3DA8k0y7d1e23nm3nDjCNfATAn3yu1jieYY2yYI6CYGEXcD+UbP61uG6no+mm/lkQbQosyDfE0sADqGryqXswRste+R0sSVMBQtTipAZOUoYNbEmhN4+L78SSp3zpmgkrIxAw7le8oj6Evp2ofvE2Kvh+Z0MVoEJx6mtZI6hheIFSS38NeUZr/HBfRSpaElOYTN/ZNf8QwThCWo=
|
||||||
before_install:
|
before_install:
|
||||||
- openssl aes-256-cbc -K $encrypted_11153c0bb86c_key -iv $encrypted_11153c0bb86c_iv
|
- openssl aes-256-cbc -K $encrypted_11153c0bb86c_key -iv $encrypted_11153c0bb86c_iv
|
||||||
-in AUTH_KEY.json.enc -out AUTH_KEY.json -d
|
-in AUTH_KEY.json.enc -out AUTH_KEY.json -d
|
||||||
|
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export
|
||||||
|
CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
|
||||||
|
- source /home/travis/google-cloud-sdk/path.bash.inc
|
||||||
|
- gcloud auth activate-service-account --key-file AUTH_KEY.json
|
||||||
|
- rm AUTH_KEY.json && rm AUTH_KEY.json.enc
|
||||||
|
|
||||||
|
|||||||
15
kmd/linux/verus-cli/README.txt
Normal file
15
kmd/linux/verus-cli/README.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
VerusCoin Command Line Tools v0.3.3-beta
|
||||||
|
Contents:
|
||||||
|
komodod - the Komodo daemon
|
||||||
|
komodo-cli - Komodo command line utility
|
||||||
|
verus - wrapper for komodo-cli that applies the command to the VRSC coin
|
||||||
|
verusd - wrapper for komodod that sets the VerusCoin parameters to defaults properly
|
||||||
|
|
||||||
|
The first time on a new system you will need to run ./fetchparams.sh before using komodod or verusd.
|
||||||
|
On Ubuntu 18 systems you will need to run these two commands before running the command line tools:
|
||||||
|
sudo apt-get install libgconf-2-4
|
||||||
|
sudo apt-get install libcurl3
|
||||||
|
|
||||||
|
Run ./verusd to launch komodod, and use ./verus to run commands such as:
|
||||||
|
./verus stop
|
||||||
|
Which signals komodod (if it is running) to stop running.
|
||||||
165
kmd/linux/verus-cli/fetch-params.sh
Executable file
165
kmd/linux/verus-cli/fetch-params.sh
Executable file
@@ -0,0 +1,165 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
PARAMS_DIR="$HOME/.zcash-params"
|
||||||
|
|
||||||
|
SPROUT_PKEY_NAME='sprout-proving.key'
|
||||||
|
SPROUT_VKEY_NAME='sprout-verifying.key'
|
||||||
|
SPROUT_URL="https://z.cash/downloads"
|
||||||
|
SPROUT_IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo"
|
||||||
|
|
||||||
|
SHA256CMD="$(command -v sha256sum || echo shasum)"
|
||||||
|
SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')"
|
||||||
|
|
||||||
|
WGETCMD="$(command -v wget || echo '')"
|
||||||
|
IPFSCMD="$(command -v ipfs || echo '')"
|
||||||
|
|
||||||
|
# fetch methods can be disabled with ZC_DISABLE_SOMETHING=1
|
||||||
|
ZC_DISABLE_WGET="${ZC_DISABLE_WGET:-}"
|
||||||
|
ZC_DISABLE_IPFS="${ZC_DISABLE_IPFS:-}"
|
||||||
|
|
||||||
|
function fetch_wget {
|
||||||
|
if [ -z "$WGETCMD" ] || ! [ -z "$ZC_DISABLE_WGET" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local filename="$1"
|
||||||
|
local dlname="$2"
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Retrieving (wget): $SPROUT_URL/$filename
|
||||||
|
EOF
|
||||||
|
|
||||||
|
wget \
|
||||||
|
--progress=dot:giga \
|
||||||
|
--output-document="$dlname" \
|
||||||
|
--continue \
|
||||||
|
--retry-connrefused --waitretry=3 --timeout=30 \
|
||||||
|
"$SPROUT_URL/$filename"
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch_ipfs {
|
||||||
|
if [ -z "$IPFSCMD" ] || ! [ -z "$ZC_DISABLE_IPFS" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local filename="$1"
|
||||||
|
local dlname="$2"
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Retrieving (ipfs): $SPROUT_IPFS/$filename
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ipfs get --output "$dlname" "$SPROUT_IPFS/$filename"
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch_failure {
|
||||||
|
cat >&2 <<EOF
|
||||||
|
|
||||||
|
Failed to fetch the Zcash zkSNARK parameters!
|
||||||
|
Try installing one of the following programs and make sure you're online:
|
||||||
|
|
||||||
|
* ipfs
|
||||||
|
* wget
|
||||||
|
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch_params {
|
||||||
|
local filename="$1"
|
||||||
|
local output="$2"
|
||||||
|
local dlname="${output}.dl"
|
||||||
|
local expectedhash="$3"
|
||||||
|
|
||||||
|
if ! [ -f "$output" ]
|
||||||
|
then
|
||||||
|
for method in wget ipfs failure; do
|
||||||
|
if "fetch_$method" "$filename" "$dlname"; then
|
||||||
|
echo "Download successful!"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
"$SHA256CMD" $SHA256ARGS -c <<EOF
|
||||||
|
$expectedhash $dlname
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Check the exit code of the shasum command:
|
||||||
|
CHECKSUM_RESULT=$?
|
||||||
|
if [ $CHECKSUM_RESULT -eq 0 ]; then
|
||||||
|
mv -v "$dlname" "$output"
|
||||||
|
else
|
||||||
|
echo "Failed to verify parameter checksums!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use flock to prevent parallel execution.
|
||||||
|
function lock() {
|
||||||
|
local lockfile=/tmp/fetch_params.lock
|
||||||
|
# create lock file
|
||||||
|
eval "exec 200>/$lockfile"
|
||||||
|
# acquire the lock
|
||||||
|
flock -n 200 \
|
||||||
|
&& return 0 \
|
||||||
|
|| return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function exit_locked_error {
|
||||||
|
echo "Only one instance of fetch-params.sh can be run at a time." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
|
lock fetch-params.sh \
|
||||||
|
|| exit_locked_error
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
Zcash - fetch-params.sh
|
||||||
|
|
||||||
|
This script will fetch the Zcash zkSNARK parameters and verify their
|
||||||
|
integrity with sha256sum.
|
||||||
|
|
||||||
|
If they already exist locally, it will exit now and do nothing else.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Now create PARAMS_DIR and insert a README if necessary:
|
||||||
|
if ! [ -d "$PARAMS_DIR" ]
|
||||||
|
then
|
||||||
|
mkdir -p "$PARAMS_DIR"
|
||||||
|
README_PATH="$PARAMS_DIR/README"
|
||||||
|
cat >> "$README_PATH" <<EOF
|
||||||
|
This directory stores common Zcash zkSNARK parameters. Note that it is
|
||||||
|
distinct from the daemon's -datadir argument because the parameters are
|
||||||
|
large and may be shared across multiple distinct -datadir's such as when
|
||||||
|
setting up test networks.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# This may be the first time the user's run this script, so give
|
||||||
|
# them some info, especially about bandwidth usage:
|
||||||
|
cat <<EOF
|
||||||
|
The parameters are currently just under 911MB in size, so plan accordingly
|
||||||
|
for your bandwidth constraints. If the files are already present and
|
||||||
|
have the correct sha256sum, no networking is used.
|
||||||
|
|
||||||
|
Creating params directory. For details about this directory, see:
|
||||||
|
$README_PATH
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$PARAMS_DIR"
|
||||||
|
|
||||||
|
fetch_params "$SPROUT_PKEY_NAME" "$PARAMS_DIR/$SPROUT_PKEY_NAME" "8bc20a7f013b2b58970cddd2e7ea028975c88ae7ceb9259a5344a16bc2c0eef7"
|
||||||
|
fetch_params "$SPROUT_VKEY_NAME" "$PARAMS_DIR/$SPROUT_VKEY_NAME" "4bd498dae0aacfd8e98dc306338d017d9c08dd0918ead18172bd0aec2fc5df82"
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
rm -f /tmp/fetch_params.lock
|
||||||
|
exit 0
|
||||||
2
kmd/verus → kmd/linux/verus-cli/verus
Executable file → Normal file
2
kmd/verus → kmd/linux/verus-cli/verus
Executable file → Normal file
@@ -4,4 +4,4 @@
|
|||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
cd $DIR
|
cd $DIR
|
||||||
|
|
||||||
../komodo-cli -ac_name=VRSC "$@"
|
./komodo-cli -ac_name=VRSC "$@"
|
||||||
7
kmd/linux/verus-cli/verusd
Normal file
7
kmd/linux/verus-cli/verusd
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#set working directory to the location of this script
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
cd $DIR
|
||||||
|
|
||||||
|
./komodod -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -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 -addnode=185.25.48.236 -addnode=185.64.105.111 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -ac_veruspos=50 -gen -genproclimit=0 "$@"
|
||||||
16
kmd/mac/verus-cli/README.txt
Normal file
16
kmd/mac/verus-cli/README.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
VerusCoin Command Line Tools v0.3.3-beta
|
||||||
|
Contents:
|
||||||
|
komodod - the Komodo daemon
|
||||||
|
komodo-cli - Komodo command line utility
|
||||||
|
verus - wrapper for komodo-cli that applies the command to the VRSC coin
|
||||||
|
verusd - wrapper for komodod that sets the VerusCoin parameters to defaults properly.
|
||||||
|
|
||||||
|
The first time on a new system you will need to run ./fetchparams.sh before using komodod or verusd.
|
||||||
|
You will need to install xcode from the Apple App Store and run the following two commands before running the command line tools:
|
||||||
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
brew install gcc@5
|
||||||
|
|
||||||
|
If you already have xcode and brew installed you can skip those.
|
||||||
|
Run ./verusd to launch komodod, and use ./verus to run commands such as:
|
||||||
|
./verus stop
|
||||||
|
Which signals komodod (if it is running) to stop running.
|
||||||
165
kmd/mac/verus-cli/fetch-params.sh
Executable file
165
kmd/mac/verus-cli/fetch-params.sh
Executable file
@@ -0,0 +1,165 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
PARAMS_DIR="$HOME/.zcash-params"
|
||||||
|
|
||||||
|
SPROUT_PKEY_NAME='sprout-proving.key'
|
||||||
|
SPROUT_VKEY_NAME='sprout-verifying.key'
|
||||||
|
SPROUT_URL="https://z.cash/downloads"
|
||||||
|
SPROUT_IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo"
|
||||||
|
|
||||||
|
SHA256CMD="$(command -v sha256sum || echo shasum)"
|
||||||
|
SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')"
|
||||||
|
|
||||||
|
WGETCMD="$(command -v wget || echo '')"
|
||||||
|
IPFSCMD="$(command -v ipfs || echo '')"
|
||||||
|
|
||||||
|
# fetch methods can be disabled with ZC_DISABLE_SOMETHING=1
|
||||||
|
ZC_DISABLE_WGET="${ZC_DISABLE_WGET:-}"
|
||||||
|
ZC_DISABLE_IPFS="${ZC_DISABLE_IPFS:-}"
|
||||||
|
|
||||||
|
function fetch_wget {
|
||||||
|
if [ -z "$WGETCMD" ] || ! [ -z "$ZC_DISABLE_WGET" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local filename="$1"
|
||||||
|
local dlname="$2"
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Retrieving (wget): $SPROUT_URL/$filename
|
||||||
|
EOF
|
||||||
|
|
||||||
|
wget \
|
||||||
|
--progress=dot:giga \
|
||||||
|
--output-document="$dlname" \
|
||||||
|
--continue \
|
||||||
|
--retry-connrefused --waitretry=3 --timeout=30 \
|
||||||
|
"$SPROUT_URL/$filename"
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch_ipfs {
|
||||||
|
if [ -z "$IPFSCMD" ] || ! [ -z "$ZC_DISABLE_IPFS" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local filename="$1"
|
||||||
|
local dlname="$2"
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
|
||||||
|
Retrieving (ipfs): $SPROUT_IPFS/$filename
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ipfs get --output "$dlname" "$SPROUT_IPFS/$filename"
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch_failure {
|
||||||
|
cat >&2 <<EOF
|
||||||
|
|
||||||
|
Failed to fetch the Zcash zkSNARK parameters!
|
||||||
|
Try installing one of the following programs and make sure you're online:
|
||||||
|
|
||||||
|
* ipfs
|
||||||
|
* wget
|
||||||
|
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetch_params {
|
||||||
|
local filename="$1"
|
||||||
|
local output="$2"
|
||||||
|
local dlname="${output}.dl"
|
||||||
|
local expectedhash="$3"
|
||||||
|
|
||||||
|
if ! [ -f "$output" ]
|
||||||
|
then
|
||||||
|
for method in wget ipfs failure; do
|
||||||
|
if "fetch_$method" "$filename" "$dlname"; then
|
||||||
|
echo "Download successful!"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
"$SHA256CMD" $SHA256ARGS -c <<EOF
|
||||||
|
$expectedhash $dlname
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Check the exit code of the shasum command:
|
||||||
|
CHECKSUM_RESULT=$?
|
||||||
|
if [ $CHECKSUM_RESULT -eq 0 ]; then
|
||||||
|
mv -v "$dlname" "$output"
|
||||||
|
else
|
||||||
|
echo "Failed to verify parameter checksums!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use flock to prevent parallel execution.
|
||||||
|
function lock() {
|
||||||
|
local lockfile=/tmp/fetch_params.lock
|
||||||
|
# create lock file
|
||||||
|
eval "exec 200>/$lockfile"
|
||||||
|
# acquire the lock
|
||||||
|
flock -n 200 \
|
||||||
|
&& return 0 \
|
||||||
|
|| return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function exit_locked_error {
|
||||||
|
echo "Only one instance of fetch-params.sh can be run at a time." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
|
lock fetch-params.sh \
|
||||||
|
|| exit_locked_error
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
Zcash - fetch-params.sh
|
||||||
|
|
||||||
|
This script will fetch the Zcash zkSNARK parameters and verify their
|
||||||
|
integrity with sha256sum.
|
||||||
|
|
||||||
|
If they already exist locally, it will exit now and do nothing else.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Now create PARAMS_DIR and insert a README if necessary:
|
||||||
|
if ! [ -d "$PARAMS_DIR" ]
|
||||||
|
then
|
||||||
|
mkdir -p "$PARAMS_DIR"
|
||||||
|
README_PATH="$PARAMS_DIR/README"
|
||||||
|
cat >> "$README_PATH" <<EOF
|
||||||
|
This directory stores common Zcash zkSNARK parameters. Note that it is
|
||||||
|
distinct from the daemon's -datadir argument because the parameters are
|
||||||
|
large and may be shared across multiple distinct -datadir's such as when
|
||||||
|
setting up test networks.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# This may be the first time the user's run this script, so give
|
||||||
|
# them some info, especially about bandwidth usage:
|
||||||
|
cat <<EOF
|
||||||
|
The parameters are currently just under 911MB in size, so plan accordingly
|
||||||
|
for your bandwidth constraints. If the files are already present and
|
||||||
|
have the correct sha256sum, no networking is used.
|
||||||
|
|
||||||
|
Creating params directory. For details about this directory, see:
|
||||||
|
$README_PATH
|
||||||
|
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$PARAMS_DIR"
|
||||||
|
|
||||||
|
fetch_params "$SPROUT_PKEY_NAME" "$PARAMS_DIR/$SPROUT_PKEY_NAME" "8bc20a7f013b2b58970cddd2e7ea028975c88ae7ceb9259a5344a16bc2c0eef7"
|
||||||
|
fetch_params "$SPROUT_VKEY_NAME" "$PARAMS_DIR/$SPROUT_VKEY_NAME" "4bd498dae0aacfd8e98dc306338d017d9c08dd0918ead18172bd0aec2fc5df82"
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
|
rm -f /tmp/fetch_params.lock
|
||||||
|
exit 0
|
||||||
7
kmd/mac/verus-cli/verus
Executable file
7
kmd/mac/verus-cli/verus
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#set working directory to the location of this script
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
cd $DIR
|
||||||
|
|
||||||
|
./komodo-cli -ac_name=VRSC "$@"
|
||||||
6
kmd/mac/verus-cli/verusd
Executable file
6
kmd/mac/verus-cli/verusd
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#set working directory to the location of this script
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
cd $DIR
|
||||||
|
|
||||||
|
./komodod -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -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 -addnode=185.25.48.236 -addnode=185.64.105.111 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -ac_veruspos=50 -gen -genproclimit=0 "$@"
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
./komodod -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.72 -addnode=185.25.48.236 -addnode=185.64.105.111 "$@"
|
|
||||||
|
|
||||||
10
kmd/windows/verus-cli/README.txt
Normal file
10
kmd/windows/verus-cli/README.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
VerusCoin Command Line Tools v0.3.3-beta
|
||||||
|
Contents:
|
||||||
|
komodod.exe - the Komodo daemon
|
||||||
|
komodo-cli.exe - Komodo command line utility
|
||||||
|
verus.bat - wrapper for komodo-cli that applies the command to the VRSC coin
|
||||||
|
verusd.bat - wrapper for komodod that sets the VerusCoin parameters to defaults properly
|
||||||
|
|
||||||
|
Run verusd.bat to launch komodod, and use verus.bat to run commands such as:
|
||||||
|
verus.bat stop
|
||||||
|
Which signals komodod.exe (if it is running) to stop running.
|
||||||
14
kmd/windows/verus-cli/verus.bat
Normal file
14
kmd/windows/verus-cli/verus.bat
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
@call :GET_CURRENT_DIR
|
||||||
|
@cd %THIS_DIR%
|
||||||
|
komodo-cli.exe -ac_name=VRSC %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
@goto :EOF
|
||||||
|
|
||||||
|
@:GET_CURRENT_DIR
|
||||||
|
@pushd %~dp0
|
||||||
|
@set THIS_DIR=%CD%
|
||||||
|
@popd
|
||||||
|
@goto :EOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
10
kmd/windows/verus-cli/verusd.bat
Normal file
10
kmd/windows/verus-cli/verusd.bat
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
@call :GET_CURRENT_DIR
|
||||||
|
@cd %THIS_DIR%
|
||||||
|
komodod.exe -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -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 -addnode=185.25.48.236 -addnode=185.64.105.111 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -ac_veruspos=50 -gen -genproclimit=0 %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
@goto :EOF
|
||||||
|
|
||||||
|
:GET_CURRENT_DIR
|
||||||
|
@pushd %~dp0
|
||||||
|
@set THIS_DIR=%CD%
|
||||||
|
@popd
|
||||||
|
@goto :EOF
|
||||||
17
src/main.cpp
17
src/main.cpp
@@ -3148,9 +3148,11 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
|
|||||||
CTransaction &tx = block.vtx[i];
|
CTransaction &tx = block.vtx[i];
|
||||||
list<CTransaction> removed;
|
list<CTransaction> removed;
|
||||||
CValidationState stateDummy;
|
CValidationState stateDummy;
|
||||||
// don't keep staking transactions
|
// don't keep staking or invalid transactions
|
||||||
if (tx.IsCoinBase() || (block.IsVerusPOSBlock() && (i == (block.vtx.size() - 1))) || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL))
|
if (tx.IsCoinBase() || (block.IsVerusPOSBlock() && (i == (block.vtx.size() - 1))) || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL))
|
||||||
|
{
|
||||||
mempool.remove(tx, removed, true);
|
mempool.remove(tx, removed, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (anchorBeforeDisconnect != anchorAfterDisconnect) {
|
if (anchorBeforeDisconnect != anchorAfterDisconnect) {
|
||||||
// The anchor may not change between block disconnects,
|
// The anchor may not change between block disconnects,
|
||||||
@@ -3166,8 +3168,17 @@ bool static DisconnectTip(CValidationState &state, bool fBare = false) {
|
|||||||
assert(pcoinsTip->GetAnchorAt(pcoinsTip->GetBestAnchor(), newTree));
|
assert(pcoinsTip->GetAnchorAt(pcoinsTip->GetBestAnchor(), newTree));
|
||||||
// Let wallets know transactions went from 1-confirmed to
|
// Let wallets know transactions went from 1-confirmed to
|
||||||
// 0-confirmed or conflicted:
|
// 0-confirmed or conflicted:
|
||||||
BOOST_FOREACH(const CTransaction &tx, block.vtx) {
|
for (int i = 0; i < block.vtx.size(); i++)
|
||||||
SyncWithWallets(tx, NULL);
|
{
|
||||||
|
CTransaction &tx = block.vtx[i];
|
||||||
|
if (block.IsVerusPOSBlock() && (i == (block.vtx.size() - 1)))
|
||||||
|
{
|
||||||
|
EraseFromWallets(tx.GetHash());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SyncWithWallets(tx, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Update cached incremental witnesses
|
// Update cached incremental witnesses
|
||||||
//fprintf(stderr,"chaintip false\n");
|
//fprintf(stderr,"chaintip false\n");
|
||||||
|
|||||||
@@ -51,3 +51,7 @@ void UnregisterAllValidationInterfaces() {
|
|||||||
void SyncWithWallets(const CTransaction &tx, const CBlock *pblock) {
|
void SyncWithWallets(const CTransaction &tx, const CBlock *pblock) {
|
||||||
g_signals.SyncTransaction(tx, pblock);
|
g_signals.SyncTransaction(tx, pblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EraseFromWallets(const uint256 &hash) {
|
||||||
|
g_signals.EraseTransaction(hash);
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn);
|
|||||||
void UnregisterAllValidationInterfaces();
|
void UnregisterAllValidationInterfaces();
|
||||||
/** Push an updated transaction to all registered wallets */
|
/** Push an updated transaction to all registered wallets */
|
||||||
void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL);
|
void SyncWithWallets(const CTransaction& tx, const CBlock* pblock = NULL);
|
||||||
|
/** Erase a transaction from all registered wallets */
|
||||||
|
void EraseFromWallets(const uint256 &hash);
|
||||||
|
|
||||||
class CValidationInterface {
|
class CValidationInterface {
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ set -x
|
|||||||
cd "$(dirname "$(readlink -f "$0")")/.."
|
cd "$(dirname "$(readlink -f "$0")")/.."
|
||||||
|
|
||||||
cd depends/ && make HOST=$HOST V=1 NO_QT=1
|
cd depends/ && make HOST=$HOST V=1 NO_QT=1
|
||||||
cd ..
|
cd ../
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -fopenmp -pthread" ./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared
|
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -fopenmp -pthread" ./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared
|
||||||
sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
|
sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
|
||||||
|
|||||||
Reference in New Issue
Block a user