Skip to content

Commit

Permalink
remove instances of unnecessary setting of ports and rely on defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenpuffett committed Feb 25, 2024
1 parent 2596160 commit 8849831
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Download the latest [Bitcoin Core](https://github.com/bitcoin/bitcoin/releases)
a `bitcoin.conf` file (by default located in `~.bitcoin/`) with the following options:

```
rpcport=8332
rpcuser=rpc
rpcpassword=rpc
server=1
Expand All @@ -64,8 +63,6 @@ cd addrindexrs
export ADDRINDEXRS_JSONRPC_IMPORT=1
export ADDRINDEXRS_TXID_LIMIT=15000
export ADDRINDEXRS_COOKIE=rpc:rpc
export ADDRINDEXRS_INDEXER_RPC_ADDR=0.0.0.0:8432
export ADDRINDEXRS_DAEMON_RPC_ADDR=localhost:8332
cargo build --release
ulimit -n 8192
cargo run --release -- -vvv
Expand Down
4 changes: 3 additions & 1 deletion counterpartylib/lib/backend/addrindexrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def rpc_call(payload):
url = config.BACKEND_URL
response = None
TRIES = 12

for i in range(TRIES):
try:
response = requests.post(url, data=json.dumps(payload), headers={'content-type': 'application/json'},
Expand Down Expand Up @@ -282,6 +281,8 @@ def __init__(self, host, port):
self.message_result = None
self.is_killed = False

print(host, port)

def stop(self):
logger.warn('Killing address indexer connection thread.')
self.send({"kill": True})
Expand Down Expand Up @@ -539,6 +540,7 @@ def getindexblocksbehind():

def init():
global Indexer_Thread
print(config.INDEXD_PORT)
Indexer_Thread = AddrIndexRsThread(config.INDEXD_CONNECT, config.INDEXD_PORT)
Indexer_Thread.daemon = True
Indexer_Thread.start()
Expand Down
3 changes: 2 additions & 1 deletion counterpartylib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def handle_exception(exc_type, exc_value, exc_traceback):
if backend_user:
config.BACKEND_USER = backend_user
else:
config.BACKEND_USER = 'bitcoinrpc'
config.BACKEND_USER = 'rpc'

# Backend Core RPC password (Bitcoin Core)
if backend_password:
Expand Down Expand Up @@ -449,6 +449,7 @@ def handle_exception(exc_type, exc_value, exc_traceback):
config.ESTIMATE_FEE_PER_KB = estimate_fee_per_kb

logger.info('Running v{} of counterparty-lib.'.format(config.VERSION_STRING))
print(config.BACKEND_PORT, config.INDEXD_PORT, config.BACKEND_USER)


def initialise_db():
Expand Down
1 change: 0 additions & 1 deletion docker/counterparty-core/server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ backend-name = indexd
backend-user = rpc
backend-password = rpc
indexd-connect = addrindexrs
indexd-port = 8432
rpc-user = rpc
rpc-password = rpc
log-file = 1
Expand Down
18 changes: 7 additions & 11 deletions simplenode/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ services:
# - "-chain=test" # testnet
- "-rpcallowip=0.0.0.0/0"
- "-rpcbind=0.0.0.0"
- "-rpcport=8332" # mainnet
# - "-rpcport=18332" # testnet
- "-rpcuser=rpc"
- "-rpcpassword=rpc"
- "-listen=1"
Expand All @@ -38,12 +36,14 @@ services:
command:
- "--network=bitcoin" # mainnet
# - "--network=testnet" # testnet
- "--indexer-rpc-addr=0.0.0.0:8432" # mainnet
# - "--indexer-rpc-addr=0.0.0.0:18432" # testnet
- "--txid-limit=15000"
- "--daemon-rpc-addr=bitcoind:8332" # mainnet
# - "--daemon-rpc-addr=bitcoind:18332" # testnet
- "--indexer-rpc-host=0.0.0.0"
- "--indexer-rpc-port=8432" # mainnet
# - "--indexer-rpc-port=18432" # testnet
- "--daemon-rpc-host=0.0.0.0"
- "--daemon-rpc-port=8332" # mainnet
# - "--daemon-rpc-port=18332" # testnet
- "--cookie=rpc:rpc"
- "--txid-limit=15000"
- "--daemon-dir=/bitcoin/.bitcoin"
- "-vvv"
- "--db-dir=/data/addrindexrs/db"
Expand All @@ -64,13 +64,9 @@ services:
command:
# "--testnet" # testnet
- "--backend-connect=bitcoind"
- "--backend-port=8332" # mainnet
# - "--backend-port=18332" # testnet
- "--backend-user=rpc"
- "--backend-password=rpc"
- "--indexd-connect=addrindexrs"
- "--indexd-port=8432" # mainnet
# - "--indexd-port=18432" # testnet
- "--rpc-user=rpc"
- "--rpc-password=rpc"
- "--rpc-host=0.0.0.0"
Expand Down

0 comments on commit 8849831

Please sign in to comment.