Skip to content

Commit 3075924

Browse files
9dc3360 Merge bitcoin#22235: script: add script to generate example bitcoin.conf (laanwj) b8a20d9 Merge bitcoin#25043: Reject invalid rpcauth formats (fanquake) b282987 Merge bitcoin#24538: miner: bug fix? update for ancestor inclusion using modified fees, not base (MacroFake) a061cb9 Merge bitcoin#24906: miniscript: the 'd:' wrapper must not be 'u' (Andrew Chow) 38bc996 Merge bitcoin#23635: test: Bump shellcheck version to 0.8.0 (fanquake) f8c17c6 Merge bitcoin#24796: lint: misc updates & fixes (MarcoFalke) c5b3773 Merge bitcoin#24786: doc: Convert remaining comments to clang-tidy format (fanquake) 5867f71 Merge bitcoin#24147: Miniscript integration (laanwj) fcfb96e fix: remove mentioning of `virtual` from validation.h which are irrelevant (Konstantin Akimov) 844eaaf Merge bitcoin#24152: policy / validation: CPFP fee bumping within packages (fanquake) 796fea7 Merge bitcoin#23662: rpc: improve `getreceivedby{address,label}` performance (Andrew Chow) f557dc4 Merge bitcoin#25067: validationinterface: make MainSignalsInstance() a class, drop unused forward declarations (MacroFake) Pull request description: ## What was done? Regular backports from Bitcoin V24 ## How Has This Been Tested? Run unit & functional tests ## Breaking Changes There is a new way to prepare default `dash.conf`, the docs for release process are updated accordingly ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 9dc3360 Tree-SHA512: b5d3ce65559146de9e10ec41defd308780c3a196b1b56ff16e90f1c1912a647b6103f4e7c4a8af6e6f090ad72fa67d2c48bf03c77709c65e1ceb4d9a648f6755
2 parents 7c767a1 + 9dc3360 commit 3075924

39 files changed

+3081
-346
lines changed

ci/lint/04_install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ if [ -z "${SKIP_PYTHON_INSTALL}" ]; then
3333
python3 --version
3434
fi
3535

36-
${CI_RETRY_EXE} pip3 install codespell==2.0.0
37-
${CI_RETRY_EXE} pip3 install flake8==3.8.3
36+
${CI_RETRY_EXE} pip3 install codespell==2.1.0
37+
${CI_RETRY_EXE} pip3 install flake8==4.0.1
3838
${CI_RETRY_EXE} pip3 install lief==0.13.1
39-
${CI_RETRY_EXE} pip3 install mypy==0.910
39+
${CI_RETRY_EXE} pip3 install mypy==0.942
4040
${CI_RETRY_EXE} pip3 install pyzmq==22.3.0
4141
${CI_RETRY_EXE} pip3 install vulture==2.3
4242

contrib/containers/ci/ci-slim.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ RUN set -ex; \
6969
# Install Python packages
7070
RUN set -ex; \
7171
pip3 install --no-cache-dir \
72-
codespell==1.17.1 \
73-
flake8==3.8.3 \
72+
codespell==2.1.0 \
73+
flake8==4.0.1 \
7474
jinja2 \
7575
lief==0.13.2 \
7676
multiprocess \
77-
mypy==0.910 \
77+
mypy==0.942 \
7878
pyzmq==22.3.0 \
7979
vulture==2.3
8080

@@ -86,7 +86,7 @@ RUN set -ex; \
8686
cd dash_hash && pip3 install -r requirements.txt .; \
8787
cd .. && rm -rf dash_hash
8888

89-
ARG SHELLCHECK_VERSION=v0.7.1
89+
ARG SHELLCHECK_VERSION=v0.8.0
9090
RUN set -ex; \
9191
curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o /tmp/shellcheck.tar.xz; \
9292
mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz

contrib/debian/examples/dash.conf

Lines changed: 1 addition & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -1,185 +1 @@
1-
##
2-
## dash.conf configuration file. Lines beginning with # are comments.
3-
##
4-
5-
# Network-related settings:
6-
7-
# Note that if you use testnet or regtest, particularly with the options
8-
# addnode, connect, port, bind, rpcport, rpcbind or wallet, you will also
9-
# want to read "[Sections]" further down.
10-
11-
# Run on the test network instead of the real dash network.
12-
#testnet=0
13-
14-
# Run a regression test network
15-
#regtest=0
16-
17-
# Connect via a SOCKS5 proxy
18-
#proxy=127.0.0.1:9050
19-
20-
# Bind to given address and always listen on it. Use [host]:port notation for IPv6
21-
#bind=<addr>
22-
23-
# Bind to given address and add permission flags to peers connecting to it. Use [host]:port notation for IPv6
24-
#whitebind=perm@<addr>
25-
26-
##############################################################
27-
## Quick Primer on addnode vs connect ##
28-
## Let's say for instance you use addnode=4.2.2.4 ##
29-
## addnode will connect you to and tell you about the ##
30-
## nodes connected to 4.2.2.4. In addition it will tell ##
31-
## the other nodes connected to it that you exist so ##
32-
## they can connect to you. ##
33-
## connect will not do the above when you 'connect' to it. ##
34-
## It will *only* connect you to 4.2.2.4 and no one else.##
35-
## ##
36-
## So if you're behind a firewall, or have other problems ##
37-
## finding nodes, add some using 'addnode'. ##
38-
## ##
39-
## If you want to stay private, use 'connect' to only ##
40-
## connect to "trusted" nodes. ##
41-
## ##
42-
## If you run multiple nodes on a LAN, there's no need for ##
43-
## all of them to open lots of connections. Instead ##
44-
## 'connect' them all to one node that is port forwarded ##
45-
## and has lots of connections. ##
46-
## Thanks goes to [Noodle] on Freenode. ##
47-
##############################################################
48-
49-
# Use as many addnode= settings as you like to connect to specific peers
50-
#addnode=69.164.218.197
51-
#addnode=10.0.0.2:9999
52-
53-
# Alternatively use as many connect= settings as you like to connect ONLY to specific peers
54-
#connect=69.164.218.197
55-
#connect=10.0.0.1:9999
56-
57-
# Listening mode, enabled by default except when 'connect' is being used
58-
#listen=1
59-
60-
# Port on which to listen for connections (default: 9999, testnet: 19999, regtest: 19899)
61-
#port=
62-
63-
# Maximum number of inbound + outbound connections (default: 125). This option
64-
# applies only if inbound connections are enabled; otherwise, the number of connections
65-
# will not be more than 11: 8 full-relay connections, 2 block-relay-only ones, and
66-
# occasionally 1 short-lived feeler or extra outbound block-relay-only connection.
67-
# These limits do not apply to connections added manually with the -addnode
68-
# configuration option or the addnode RPC, which have a separate limit of 8 connections.
69-
#maxconnections=
70-
71-
# Maximum upload bandwidth target in MiB per day (e.g. 'maxuploadtarget=1024' is 1 GiB per day).
72-
# This limits the upload bandwidth for those with bandwidth limits. 0 = no limit (default: 0).
73-
# -maxuploadtarget does not apply to peers with 'download' permission.
74-
# For more information on reducing bandwidth utilization, see: doc/reduce-traffic.md.
75-
#maxuploadtarget=
76-
77-
#
78-
# JSON-RPC options (for controlling a running Dash/dashd process)
79-
#
80-
81-
# server=1 tells Dash-Qt and dashd to accept JSON-RPC commands
82-
#server=0
83-
84-
# Bind to given address to listen for JSON-RPC connections.
85-
# Refer to the manpage or dashd -help for further details.
86-
#rpcbind=<addr>
87-
88-
# If no rpcpassword is set, rpc cookie auth is sought. The default `-rpccookiefile` name
89-
# is .cookie and found in the `-datadir` being used for dashd. This option is typically used
90-
# when the server and client are run as the same user.
91-
#
92-
# If not, you must set rpcuser and rpcpassword to secure the JSON-RPC API.
93-
#
94-
# The config option `rpcauth` can be added to server startup argument. It is set at initialization time
95-
# using the output from the script in share/rpcauth/rpcauth.py after providing a username:
96-
#
97-
# ./share/rpcauth/rpcauth.py alice
98-
# String to be appended to dash.conf:
99-
# rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae
100-
# Your password:
101-
# DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
102-
#
103-
# On client-side, you add the normal user/password pair to send commands:
104-
#rpcuser=alice
105-
#rpcpassword=DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
106-
#
107-
# You can even add multiple entries of these to the server conf file, and client can use any of them:
108-
# rpcauth=bob:b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99
109-
110-
# How many seconds Dash Core will wait for a complete RPC HTTP request.
111-
# after the HTTP connection is established.
112-
#rpcclienttimeout=30
113-
114-
# By default, only RPC connections from localhost are allowed.
115-
# Specify as many rpcallowip= settings as you like to allow connections from other hosts,
116-
# either as a single IPv4/IPv6 or with a subnet specification.
117-
118-
# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,
119-
# because the rpcpassword is transmitted over the network unencrypted.
120-
121-
# server=1 tells Dash-Qt to accept JSON-RPC commands.
122-
# it is also read by dashd to determine if RPC should be enabled
123-
#rpcallowip=10.1.1.34/255.255.255.0
124-
#rpcallowip=1.2.3.4/24
125-
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96
126-
127-
# Listen for RPC connections on this TCP port:
128-
#rpcport=9998
129-
130-
# You can use Dash or dashd to send commands to Dash/dashd
131-
# running on another host using this option:
132-
#rpcconnect=127.0.0.1
133-
134-
# Wallet options
135-
136-
# Specify where to find wallet, lockfile and logs. If not present, those files will be
137-
# created as new.
138-
#wallet=</path/to/dir>
139-
140-
# Create transactions that have enough fees so they are likely to begin confirmation within n blocks (default: 6).
141-
# This setting is over-ridden by the -paytxfee option.
142-
#txconfirmtarget=n
143-
144-
# Pay a transaction fee every time you send dash.
145-
#paytxfee=0.000x
146-
147-
# Miscellaneous options
148-
149-
# Pre-generate this many public/private key pairs, so wallet backups will be valid for
150-
# both prior transactions and several dozen future transactions.
151-
#keypool=100
152-
153-
# Maintain coinstats index used by the gettxoutsetinfo RPC (default: 0).
154-
#coinstatsindex=1
155-
156-
# Enable pruning to reduce storage requirements by deleting old blocks.
157-
# This mode is incompatible with -txindex, -coinstatsindex and -rescan.
158-
# 0 = default (no pruning).
159-
# 1 = allows manual pruning via RPC.
160-
# >=945 = target to stay under in MiB.
161-
#prune=945
162-
163-
# User interface options
164-
165-
# Start Dash minimized
166-
#min=1
167-
168-
# Minimize to the system tray
169-
#minimizetotray=1
170-
171-
# [Sections]
172-
# Most options apply to mainnet, testnet and regtest.
173-
# If you want to confine an option to just one network, you should add it in the
174-
# relevant section below.
175-
# EXCEPTIONS: The options addnode, connect, port, bind, rpcport, rpcbind and wallet
176-
# only apply to mainnet unless they appear in the appropriate section below.
177-
178-
# Options only for mainnet
179-
[main]
180-
181-
# Options only for testnet
182-
[test]
183-
184-
# Options only for regtest
185-
[regtest]
1+
# This is a placeholder file. Please follow the instructions in `contrib/devtools/README.md` to generate a dash.conf file.

contrib/devtools/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,21 @@ example:
9090
BUILDDIR=$PWD/build contrib/devtools/gen-manpages.py
9191
```
9292

93+
gen-dash-conf.sh
94+
===================
95+
96+
Generates a dash.conf file in `contrib/debian/examples/` by parsing the output from `dashd --help`. This script is run during the
97+
release process to include a dash.conf with the release binaries and can also be run by users to generate a file locally.
98+
When generating a file as part of the release process, make sure to commit the changes after running the script.
99+
100+
With in-tree builds this tool can be run from any directory within the
101+
repository. To use this tool with out-of-tree builds set `BUILDDIR`. For
102+
example:
103+
104+
```bash
105+
BUILDDIR=$PWD/build contrib/devtools/gen-dash-conf.sh
106+
```
107+
93108
github-merge.py
94109
===============
95110

contrib/devtools/gen-dash-conf.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2021 The Bitcoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
6+
export LC_ALL=C
7+
TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}
8+
BUILDDIR=${BUILDDIR:-$TOPDIR}
9+
BINDIR=${BINDIR:-$BUILDDIR/src}
10+
DASHD=${DASHD:-$BINDIR/dashd}
11+
SHARE_EXAMPLES_DIR=${SHARE_EXAMPLES_DIR:-$TOPDIR/contrib/debian/examples/}
12+
EXAMPLE_CONF_FILE=${EXAMPLE_CONF_FILE:-$SHARE_EXAMPLES_DIR/dash.conf}
13+
14+
[ ! -x "$DASHD" ] && echo "$DASHD not found or not executable." && exit 1
15+
16+
DIRTY=""
17+
VERSION_OUTPUT=$($DASHD --version)
18+
if [[ $VERSION_OUTPUT == *"dirty"* ]]; then
19+
DIRTY="${DIRTY}${DASHD}\n"
20+
fi
21+
22+
if [ -n "$DIRTY" ]
23+
then
24+
echo -e "WARNING: $DASHD was built from a dirty tree.\n"
25+
echo -e "To safely generate a dash.conf file, please commit your changes to $DASHD, rebuild, then run this script again.\n"
26+
fi
27+
28+
echo 'Generating example dash.conf file in contrib/debian/examples/'
29+
30+
# create the directory, if it doesn't exist
31+
mkdir -p "${SHARE_EXAMPLES_DIR}"
32+
33+
# create the header text
34+
cat > "${EXAMPLE_CONF_FILE}" << 'EOF'
35+
##
36+
## dash.conf configuration file.
37+
## Generated by contrib/devtools/gen-dash-conf.sh.
38+
##
39+
## Lines beginning with # are comments.
40+
## All possible configuration options are provided. To use, copy this file
41+
## to your data directory (default or specified by -datadir), uncomment
42+
## options you would like to change, and save the file.
43+
##
44+
45+
46+
### Options
47+
EOF
48+
49+
# parse the output from dashd --help
50+
# adding newlines is a bit funky to ensure portability for BSD
51+
# see here for more details: https://stackoverflow.com/a/24575385
52+
${DASHD} --help \
53+
| sed '1,/Print this help message and exit/d' \
54+
| sed -E 's/^[[:space:]]{2}\-/#/' \
55+
| sed -E 's/^[[:space:]]{7}/# /' \
56+
| sed -E '/[=[:space:]]/!s/#.*$/&=1/' \
57+
| awk '/^#[a-z]/{x=$0;next}{if (NF==0) print x"\n",x="";else print}' \
58+
| sed 's,\(^[[:upper:]].*\)\:$,\
59+
### \1,' \
60+
| sed 's/[[:space:]]*$//' >> "${EXAMPLE_CONF_FILE}"
61+
62+
# create the footer text
63+
cat >> "${EXAMPLE_CONF_FILE}" << 'EOF'
64+
65+
# [Sections]
66+
# Most options will apply to all networks. To confine an option to a specific
67+
# network, add it under the relevant section below.
68+
#
69+
# Note: If not specified under a network section, the options addnode, connect,
70+
# port, bind, rpcport, rpcbind, and wallet will only apply to mainnet.
71+
72+
# Options for mainnet
73+
[main]
74+
75+
# Options for testnet
76+
[test]
77+
78+
# Options for regtest
79+
[regtest]
80+
EOF

contrib/guix/libexec/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ mkdir -p "$DISTSRC"
353353
;;
354354
esac
355355

356+
# copy over the example dash.conf file. if contrib/devtools/gen-dash-conf.sh
357+
# has not been run before buildling, this file will be a stub
358+
cp "${DISTSRC}/contrib/debian/examples/dash.conf" "${DISTNAME}/"
359+
356360
# Finally, deterministically produce {non-,}debug binary tarballs ready
357361
# for release
358362
case "$HOST" in

doc/build-openbsd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Run the following as root to install the base dependencies for building.
1111

1212
```bash
1313
pkg_add bash git gmake gmp libevent libtool boost
14-
# Select the newest version of the follow packages:
14+
# Select the newest version of the following packages:
1515
pkg_add autoconf automake python
1616

1717
git clone https://github.com/dashpay/dash.git

doc/dash-conf.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,12 @@ Windows | `%APPDATA%\DashCore\` | `C:\Users\username\AppData\Roaming\DashCore\da
6363
Linux | `$HOME/.dashcore/` | `/home/username/.dashcore/dash.conf`
6464
macOS | `$HOME/Library/Application Support/DashCore/` | `/Users/username/Library/Application Support/DashCore/dash.conf`
6565

66-
You can find an example dash.conf file in [share/examples/dash.conf](../share/examples/dash.conf).
66+
An example configuration file can be generated by [contrib/devtools/gen-dash-conf.sh](../contrib/devtools/gen-dash-conf.sh).
67+
Run this script after compiling to generate an up-to-date configuration file.
68+
The output is placed under `contrib/debian/examples/dash.conf`.
69+
To use the generated configuration file, copy the example file into your data directory and edit it there, like so:
70+
71+
```
72+
# example copy command for linux user
73+
cp contrib/debian/examples/dash.conf ~/.dashcore
74+
```

0 commit comments

Comments
 (0)