Commit Graph
119 Commits
Author SHA1 Message Date
DanSandClaude Opus 5 3aac75e94f cli: report the port actually dialled, not a stale global
dragonx-cli resolves -rpcport correctly -- CallRPC does
  int port = GetArg("-rpcport", BaseParams().RPCPort());
and dials that port. But both connection-failure messages printed
ASSETCHAINS_RPCPORT instead, a separate global defined at the top of
bitcoin-cli.cpp, initialised to the mainnet default 21769, and never assigned
anywhere in the CLI.

So every failure claimed port 21769 regardless of what was asked for:

  $ dragonx-cli -rpcport=21799 getblockcount
  error: couldn't connect to server at port 21769

That reads as "your -rpcport was ignored", which is a much more alarming and
much more misleading diagnosis than "nothing is listening yet". It cost an hour
of debugging on a node that was simply still loading a 15 GB txindex, and led to
the wrong conclusion that the CLI could be talking to the production daemon when
it was not.

Both sites now print the local `port`. Verified against the previous binary:

  new:  -rpcport=21799 -> "couldn't connect to server at port 21799"
        -rpcport=59999 -> "couldn't connect to server at port 59999"
  old:  both            -> "couldn't connect to server at port 21769"

and the CLI still reaches a live daemon on a non-default port.

ASSETCHAINS_RPCPORT is left defined; it is referenced by other translation units.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo
2026-08-31 17:35:52 -05:00
DanSandClaude Opus 4.8 9c6ccbb726 Fix dragonx-cli -rpcport help default: 18030 (hush) -> 21769 (DragonX)
The -rpcport help string in bitcoin-cli.cpp hardcoded hush's 18030; the actual default (BaseParams().RPCPort()) is DragonX's 21769, so this was misleading help text only (the CLI already connects to 21769). Set to 21769 and regenerated doc/man/dragonx-cli.1 from the rebuilt binary. NOTE: a separate hush 18030 leftover remains in src/rpc/net.cpp:357 (getpeerinfo help example address) - daemon RPC help, out of scope here. Staged on 176; not pushed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 06:35:46 +02:00
DanS 85c8d7f7dd Rebrand hush3 to DragonX and share RandomX dataset across mining threads
Minimal rebrand (see compliant-rebrand branch for full rebrand):
- Rename binaries: hushd/hush-cli/hush-tx → dragonxd/dragonx-cli/dragonx-tx
- Default to DRAGONX chain params without -ac_* flags (randomx, blocktime=36, private=1)
- Update configure.ac: AC_INIT([DragonX],[1.0.0])
- Update client version string and user-agent to /DragonX:1.0.0/
- Add chainparams.cpp with DRAGONX network parameters
- Update build.sh, miner.cpp, pow.cpp for DragonX
- Add bootstrap-dragonx.sh utility script
- Update .gitignore for release directory

Share single RandomX dataset across all mining threads:
- Add RandomXDatasetManager with readers-writer lock, reducing RAM from
  ~2GB per thread to ~2GB total plus ~2MB per thread for the VM scratchpad
- Add LogProcessMemory() diagnostic helper for Linux and Windows
2026-03-04 18:42:42 -06:00
Duke 7e63e2f013 We call them HACs now 2025-06-27 05:32:12 -04:00
onryo 58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
Duke e033a2e6eb Update copyrights to 2023 2023-02-09 18:06:03 -05:00
zanzibar 512da314a5 BIP155 (addrv2)
Tor v3 + i2p
2023-01-06 15:23:22 +00:00
Jonathan "Duke" Leto 5d2307a709 Update copyrights to 2022 2022-09-19 15:45:30 -07:00
jahway603 214a7418d7 Document that '~' cannot be used in -datadir 2022-03-18 12:54:48 -04:00
Duke Leto 89a4226965 Report rpc port in error when unable to connect 2021-08-05 15:55:34 -04:00
Duke Leto 2331ed0c56 Default HSC is now HUSH3 and some doc fixes 2021-07-10 12:23:55 -04:00
Duke Leto 84dffacdea More details about invalid RPC replies 2021-03-29 17:51:56 -04:00
Duke Leto b58c15b9fb update copyrights 2020-12-10 07:45:36 -05:00
Duke Leto c737c0dfaf We call them Hush Smart Chains around here 2020-11-15 11:54:06 -05:00
Duke Leto be16f80abc Hush Full Node is now GPLv3
Any projects which want to use Hush code from now on will need to be licensed as
GPLv3 or we will send the lawyers: https://www.softwarefreedom.org/

Notably, Komodo (KMD) is licensed as GPLv2 and is no longer compatible to receive
code changes, without causing legal issues. MIT projects, such as Zcash, also cannot pull
in changes from the Hush Full Node without permission from The Hush Developers,
which may in some circumstances grant an MIT license on a case-by-case basis.
2020-10-21 07:28:10 -04:00
Duke Leto 9e6cdec2f6 Update hush-cli cli help 2020-09-19 20:38:43 -04:00
jl777 0ea9ae3c05 Update copyright to 2019 2018-12-31 21:41:05 -11:00
blackjok3r d89fe8b560 fix bitcoin-cli.cpp includes 2018-11-30 01:52:39 +08:00
miketout 9feb4b9e08 Major updates integration from all upstreams 2018-09-18 14:33:53 -07:00
Daniel Cousens 4519a766b6 move rpc* to rpc/ 2018-07-18 11:07:16 -06:00
jl777 05c2ba6371 split out asset chain p2p port from roc port 2018-04-22 17:10:35 +03:00
Jack Grigg abf5dd31af Add static asserts to ensure CONTINUE_EXECUTION doesn't collide 2018-04-12 18:11:46 -06:00
Karl-Johan Alm 3b26f5c361 Removed using namespace std from bitcoin-cli/-tx and added std:: in appropriate places. 2018-04-12 18:10:04 -06:00
UdjinM6 fadbbe1e04 Fix exit codes:
- `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error)
- error reading config file should exit with `1`

Slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)
2018-04-12 18:10:04 -06:00
Puru e8f5b0278e bitcoin-cli.cpp: Use symbolic constant for exit code 2018-04-12 18:10:04 -06:00
Wladimir J. van der Laan 21e33231af rpc: Input-from-stdin mode for bitcoin-cli
Implements #7442 by adding an option `-stdin` which reads
additional arguments from stdin, one per line.

For example

```bash
echo -e "mysecretcode\n120" | src/bitcoin-cli -stdin walletpassphrase
echo -e "walletpassphrase\nmysecretcode\n120" | src/bitcoin-cli -stdin
```
2018-04-12 18:08:17 -06:00
jl777 6e1d2e7dc9 Test 2018-03-24 15:59:48 +02:00
jl777 c88fa588de Test 2018-03-22 15:13:15 +02:00
jl777 95c463966a Dont create .conf from cli 2018-02-27 22:25:37 +02:00
Scott Sadler d430a5e8ca upgrade cJSON and move customizations to komodo_cJSON 2017-10-23 09:55:37 -07:00
ca333 59d405e867 333 2017-10-09 15:56:28 +02:00
ca333 9d36579649 uni3 2017-10-09 11:45:49 +02:00
jl777 f50685fe28 Support mnzd and mnz-cli 2017-10-06 16:22:25 +03:00
jl777 450f60749f Fix rpcport 2017-09-25 11:44:10 +02:00
jl777 6e9f40ca49 Test 2017-03-30 05:42:52 +03:00
jl777 945f015d80 Initial merge 2017-03-30 04:35:16 +03:00
zkbot f7fcad709b Auto merge of #2203 - arcalinea:2142_security_log_message, r=daira
Add message directing users to security guide

Addresses #2142, which was blocking on updates to zcash/support/security.html. That page has now been added, so this message directing users to the site can be included.

It displays in the zcash-cli --help and --version message text, and on the zcashd metrics screen.
2017-03-26 01:36:24 +00:00
Daira Hopwood f0d1accb7d Line-wrap privacy notice. Use <> around URL and end sentence with '.'.
Include privacy notice in help text for zcashd -help.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-03-26 02:08:29 +01:00
Jack Grigg 206e2b9737 Wrap error string 2017-03-25 17:39:56 +13:00
Jay Graber ab1d2d575c Add security message to license text, rm url from translation string 2017-03-24 13:48:27 -07:00
Jay Graber 54c0a28123 Add security warning to zcashd metrics display 2017-03-23 20:43:23 -07:00
Jay Graber efa9c265c4 Add security warning to zcash-cli --help and --version message output 2017-03-23 18:13:09 -07:00
Ian Kelling 629a875229 Docs: add details to -rpcclienttimeout doc 2017-03-24 09:03:59 +13:00
Karl-Johan Alm 68377e18a8 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 7c2ab05969 bitcoin-cli: Make error message less confusing
Sorry for the churn on this, but the current message (introduced in #9073)
isn't acceptable:

    $ src/bitcoin-cli getinfo
    rpc: couldn't connect to server
    (make sure server is running and you are connecting to the correct RPC port: -1 unknown)

Putting the error code after the words "RPC port" made me wonder whether
there was a port configuration issue.

This changes it to:

    $ src/bitcoin-cli getinfo
    error: couldn't connect to server: unknown (code -1)
    (make sure server is running and you are connecting to the correct RPC port)
2017-03-24 09:03:59 +13:00
instagibbs 603205e381 Add common failure cases for rpc server connection failure 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 6415573a59 bitcoin-cli: More detailed error reporting
Register a evhttp error handler to get a more detailed error message
if the HTTP request fails.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 89bccddcd8 rpc: Split option -rpctimeout into -rpcservertimeout and -rpcclienttimeout
The two timeouts for the server and client, are essentially different:

- In the case of the server it should be a lower value to avoid clients
clogging up connection slots

- In the case of the client it should be a high value to accomedate slow
  responses from the server, for example for slow queries or when the
  lock is contended

Split the options into `-rpcservertimeout` and `-rpcclienttimeout` with
respective defaults of 30 and 900.
2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan 167b6231c9 Move windows socket init to utility function 2017-03-24 09:03:59 +13:00
Wladimir J. van der Laan afd64f76ea evhttpd implementation
- *Replace usage of boost::asio with [libevent2](http://libevent.org/)*.
boost::asio is not part of C++11, so unlike other boost there is no
forwards-compatibility reason to stick with it. Together with #4738 (convert
json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with
regard to compile-time slowness.

- *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling
is handled by libevent, a work queue (with configurable depth and parallelism)
is used to handle application requests.

- *Wrap HTTP request in C++ class*; this makes the application code mostly
HTTP-server-neutral

- *Refactor RPC to move all http-specific code to a separate file*.
Theoreticaly this can allow building without HTTP server but with another RPC
backend, e.g. Qt's debug console (currently not implemented) or future RPC
mechanisms people may want to use.

- *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL
paths they want to handle.

By using a proven, high-performance asynchronous networking library (also used
by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided.

What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests
pass. The aim for now is everything but SSL support.

Configuration options:

- `-rpcthreads`: repurposed as "number of  work handler threads". Still
defaults to 4.

- `-rpcworkqueue`: maximum depth of work queue. When this is reached, new
requests will return a 500 Internal Error.

- `-rpctimeout`: inactivity time, in seconds, after which to disconnect a
client.

- `-debug=http`: low-level http activity logging
2017-03-24 09:03:59 +13:00