From 9368c2d4932bfa51dd22b47c7c6d9aef1a4cce86 Mon Sep 17 00:00:00 2001 From: fkolakovic Date: Wed, 1 May 2024 10:46:33 +0200 Subject: [PATCH] Change RPC port number --- contrib/linearize/README.md | 2 +- contrib/linearize/linearize-hashes.py | 2 +- contrib/zmq/zmq_sub.py | 16 ++++++++-------- doc/JSON-RPC-interface.md | 10 +++++----- doc/REST-interface.md | 8 ++++---- src/chainparamsbase.cpp | 6 +++--- src/rpc/util.cpp | 4 ++-- src/test/rpc_tests.cpp | 6 +++--- src/vincoin-cli.cpp | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md index 70617437ea6ce..4a4cbc330d27f 100644 --- a/contrib/linearize/README.md +++ b/contrib/linearize/README.md @@ -11,7 +11,7 @@ Required configuration file settings for linearize-hashes: Optional config file setting for linearize-hashes: * RPC: `host` (Default: `127.0.0.1`) -* RPC: `port` (Default: `8332`) +* RPC: `port` (Default: `6332`) * Blockchain: `min_height`, `max_height` * `rev_hash_bytes`: If true, the written block hash list will be byte-reversed. (In other words, the hash returned by getblockhash will have its diff --git a/contrib/linearize/linearize-hashes.py b/contrib/linearize/linearize-hashes.py index 1f114afb4ae16..8e5825aff6df7 100755 --- a/contrib/linearize/linearize-hashes.py +++ b/contrib/linearize/linearize-hashes.py @@ -114,7 +114,7 @@ def get_rpc_cookie(): if 'host' not in settings: settings['host'] = '127.0.0.1' if 'port' not in settings: - settings['port'] = 8332 + settings['port'] = 6332 if 'min_height' not in settings: settings['min_height'] = 0 if 'max_height' not in settings: diff --git a/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py index c3027cf44be10..034246103d8d6 100755 --- a/contrib/zmq/zmq_sub.py +++ b/contrib/zmq/zmq_sub.py @@ -6,13 +6,13 @@ """ ZMQ example using python3's asyncio - Vincoin should be started with the command line arguments: - vincoind -testnet -daemon \ - -zmqpubrawtx=tcp://127.0.0.1:28332 \ - -zmqpubrawblock=tcp://127.0.0.1:28332 \ - -zmqpubhashtx=tcp://127.0.0.1:28332 \ - -zmqpubhashblock=tcp://127.0.0.1:28332 \ - -zmqpubsequence=tcp://127.0.0.1:28332 + Vitcoin should be started with the command line arguments: + vitcoind -testnet -daemon \ + -zmqpubrawtx=tcp://127.0.0.1:26332 \ + -zmqpubrawblock=tcp://127.0.0.1:26332 \ + -zmqpubhashtx=tcp://127.0.0.1:26332 \ + -zmqpubhashblock=tcp://127.0.0.1:26332 \ + -zmqpubsequence=tcp://127.0.0.1:26332 We use the asyncio library here. `self.handle()` installs itself as a future at the end of the function. Since it never returns with the event @@ -34,7 +34,7 @@ print("This example only works with Python 3.5 and greater") sys.exit(1) -port = 28332 +port = 26332 class ZMQHandler(): def __init__(self): diff --git a/doc/JSON-RPC-interface.md b/doc/JSON-RPC-interface.md index c6a7ec26d1691..d81256936de33 100644 --- a/doc/JSON-RPC-interface.md +++ b/doc/JSON-RPC-interface.md @@ -32,11 +32,11 @@ requests when multiple wallets are in use. ### Examples ```sh -# Get block count from the / endpoint when rpcuser=alice and rpcport=38332 -$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' localhost:38332/ +# Get block count from the / endpoint when rpcuser=alice and rpcport=36332 +$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' localhost:36332/ -# Get balance from the /wallet/walletname endpoint when rpcuser=alice, rpcport=38332 and rpcwallet=desc-wallet -$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getbalance", "params": []}' -H 'content-type: text/plain;' localhost:38332/wallet/desc-wallet +# Get balance from the /wallet/walletname endpoint when rpcuser=alice, rpcport=36332 and rpcwallet=desc-wallet +$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getbalance", "params": []}' -H 'content-type: text/plain;' localhost:36332/wallet/desc-wallet ``` @@ -126,7 +126,7 @@ RPC interface will be abused. need to expose the RPC port to the host system. The default way to do this in Docker also exposes the port to the public Internet. Instead, expose it only on the host system's localhost, for example: - `-p 127.0.0.1:8332:8332` + `-p 127.0.0.1:6332:6332` - **Secure authentication:** By default, when no `rpcpassword` is specified, Vincoin Core generates unique login credentials each time it restarts and puts them into a file diff --git a/doc/REST-interface.md b/doc/REST-interface.md index 3d084a2606fab..cd862e8921b4a 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -3,8 +3,8 @@ Unauthenticated REST Interface The REST API can be enabled with the `-rest` option. -The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet, -port 38332 for signet, and port 18443 for regtest. +The interface runs on the same port as the JSON-RPC interface, by default port 6332 for mainnet, port 16332 for testnet, +port 36332 for signet, and port 18443 for regtest. REST Interface consistency guarantees ------------------------------------- @@ -106,7 +106,7 @@ input and output serialization (relevant for `bin` and `hex` output formats). Example: ``` -$ curl localhost:18332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp +$ curl localhost:16332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp { "chainHeight" : 325347, "chaintipHash" : "00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb", @@ -146,4 +146,4 @@ Refer to the `getrawmempool` RPC help for details. Defaults to setting Risks ------------- -Running a web browser on the same node with a REST enabled vincoind can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `