File tree Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Expand file tree Collapse file tree 2 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,16 @@ if ! test -e /data/db/protocolMagicId; then
4444fi
4545
4646# Enable TraceMempool and PeerSharing
47- sed -i \
48- -e ' s/"PeerSharing": false/"PeerSharing": true/' \
49- -e ' s/"TraceMempool": false/"TraceMempool": true/' \
50- /opt/cardano/config/${NETWORK} -config.json
47+ set +e
48+ # Check if our configuration is writable (may be different from permissions)
49+ touch /opt/cardano/config/${NETWORK} /config.json 2>&1 > /dev/null
50+ if test $? -eq 0; then
51+ sed -i \
52+ -e ' s/"PeerSharing": false/"PeerSharing": true/' \
53+ -e ' s/"TraceMempool": false/"TraceMempool": true/' \
54+ /opt/cardano/config/${NETWORK} /config.json
55+ fi
56+ set -e
5157
5258echo " Starting: /usr/local/bin/cardano-node run"
5359echo " --config /opt/cardano/config/${NETWORK} -config.json"
Original file line number Diff line number Diff line change @@ -76,10 +76,16 @@ if [[ ${CARDANO_BLOCK_PRODUCER} == true ]]; then
7676 echo CARDANO_SHELLEY_VRF_KEY=${CARDANO_SHELLEY_VRF_KEY}
7777 echo CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE=${CARDANO_SHELLEY_OPERATIONAL_CERTIFICATE}
7878else
79- sed -i \
80- -e ' s/"PeerSharing": false/"PeerSharing": true/' \
81- -e ' s/"TraceMempool": false/"TraceMempool": true/' \
82- ${CARDANO_CONFIG}
79+ set +e
80+ # Check if our configuration is writable (may be different from permissions)
81+ touch ${CARDANO_CONFIG} 2>&1 > /dev/null
82+ if test $? -eq 0; then
83+ sed -i \
84+ -e ' s/"PeerSharing": false/"PeerSharing": true/' \
85+ -e ' s/"TraceMempool": false/"TraceMempool": true/' \
86+ ${CARDANO_CONFIG}
87+ fi
88+ set -e
8389fi
8490
8591echo AGGREGATOR_ENDPOINT=${AGGREGATOR_ENDPOINT}
You can’t perform that action at this time.
0 commit comments