Last active
August 25, 2022 11:36
-
-
Save placek/ed1489a1ddcd4dea76a6f42d7bb60a67 to your computer and use it in GitHub Desktop.
cardano node 1.35.3 + cardano db sync 13.0.4 + koios
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AlonzoGenesisFile": "/opt/cardano/cnode/bin/configuration/cardano/mainnet-alonzo-genesis.json", | |
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874", | |
"ApplicationName": "cardano-sl", | |
"ApplicationVersion": 1, | |
"ByronGenesisFile": "/opt/cardano/cnode/bin/configuration/cardano/mainnet-byron-genesis.json", | |
"ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", | |
"LastKnownBlockVersion-Alt": 0, | |
"LastKnownBlockVersion-Major": 3, | |
"LastKnownBlockVersion-Minor": 0, | |
"MaxKnownMajorProtocolVersion": 2, | |
"Protocol": "Cardano", | |
"RequiresNetworkMagic": "RequiresNoMagic", | |
"ShelleyGenesisFile": "/opt/cardano/cnode/bin/configuration/cardano/mainnet-shelley-genesis.json", | |
"EnableLogging": true, | |
"EnableLogMetrics": false, | |
"TraceBlockFetchClient": true, | |
"TraceBlockFetchDecisions": true, | |
"TraceBlockFetchProtocol": false, | |
"TraceBlockFetchProtocolSerialised": true, | |
"TraceBlockFetchServer": false, | |
"TraceChainDb": true, | |
"TraceChainSyncBlockServer": true, | |
"TraceChainSyncClient": false, | |
"TraceChainSyncHeaderServer": false, | |
"TraceChainSyncProtocol": false, | |
"TraceConnectionManager": true, | |
"TraceDNSResolver": true, | |
"TraceDNSSubscription": false, | |
"TraceDiffusionInitialization": false, | |
"TraceErrorPolicy": true, | |
"TraceForge": true, | |
"TraceHandshake": false, | |
"TraceInboundGovernor": false, | |
"TraceIpSubscription": false, | |
"TraceLedgerPeers": false, | |
"TraceLocalChainSyncProtocol": false, | |
"TraceLocalErrorPolicy": true, | |
"TraceLocalHandshake": false, | |
"TraceLocalRootPeers": false, | |
"TraceLocalTxSubmissionProtocol": false, | |
"TraceLocalTxSubmissionServer": false, | |
"TraceMempool": false, | |
"TraceMux": false, | |
"TracePeerSelection": false, | |
"TracePeerSelectionActions": false, | |
"TracePublicRootPeers": false, | |
"TraceServer": false, | |
"TraceTxInbound": false, | |
"TraceTxOutbound": false, | |
"TraceTxSubmissionProtocol": false, | |
"TracingVerbosity": "NormalVerbosity", | |
"TurnOnLogMetrics": true, | |
"TurnOnLogging": true, | |
"MaxConcurrencyDeadline": 2, | |
"defaultBackends": [ | |
"KatipBK" | |
], | |
"defaultScribes": [ | |
[ | |
"FileSK", | |
"/opt/cardano/cnode/logs/node0.json" | |
] | |
], | |
"hasEKG": 12788, | |
"hasPrometheus": [ | |
"127.0.0.1", | |
12798 | |
], | |
"minSeverity": "Info", | |
"options": { | |
"mapBackends": { | |
"cardano.node.metrics": [ | |
"EKGViewBK" | |
], | |
"cardano.node.resources": [ | |
"EKGViewBK" | |
] | |
}, | |
"mapSubtrace": { | |
"cardano.node.metrics": { | |
"subtrace": "Neutral" | |
} | |
} | |
}, | |
"rotation": { | |
"rpKeepFilesNum": 10, | |
"rpLogLimitBytes": 50000000, | |
"rpMaxAgeHours": 24 | |
}, | |
"setupBackends": [ | |
"KatipBK", | |
"EKGViewBK" | |
], | |
"setupScribes": [ | |
{ | |
"scKind": "FileSK", | |
"scName": "/opt/cardano/cnode/logs/node0.json", | |
"scFormat": "ScJson", | |
"scRotation": null | |
} | |
], | |
"ShelleyGenesisHash": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# user utilities | |
sudo apt install tmux vim jq fzf | |
# missing pakage | |
sudo apt-get install llvm-12 numactl libnuma-dev autoconf automake libtool | |
cd ~/git | |
git clone https://github.com/bitcoin-core/secp256k1.git | |
cd ~/git/secp256k1 | |
git reset --hard ac83be33d0956faf6b7f61a60ab524ef7d6a473a | |
./autogen.sh | |
./configure --prefix=/usr --enable-module-schnorrsig --enable-experimental | |
make | |
make check | |
sudo make install | |
# prereqs for guild operator setup | |
mkdir "$HOME/tmp";cd "$HOME/tmp" | |
curl -sS -o prereqs.sh https://raw.githubusercontent.com/cardano-community/guild-operators/master/scripts/cnode-helper-scripts/prereqs.sh | |
chmod 755 prereqs.sh | |
./prereqs.sh | |
. "${HOME}/.bashrc" | |
# cardano node source | |
cd ~/git | |
git clone https://github.com/input-output-hk/cardano-node | |
cd ~/git/cardano-node | |
git fetch --tags --all | |
git pull | |
git checkout $(curl -s https://api.github.com/repos/input-output-hk/cardano-node/releases/latest | jq -r .tag_name) | |
# $CNODE_HOME/scripts/cabal-build-all.sh | |
# cardano node binaries | |
cd /opt/cardano | |
mkdir bin | |
cd bin | |
wget https://hydra.iohk.io/build/17428010/download/1/cardano-node-1.35.3-linux.tar.gz | |
tar zxfv cardano-node-1.35.3-linux.tar.gz | |
cd /usr/local/bin | |
sudo ln -s /opt/cardano/cnode/bin/bech32 | |
sudo ln -s /opt/cardano/cnode/bin/cardano-cli | |
sudo ln -s /opt/cardano/cnode/bin/cardano-node | |
sudo ln -s /opt/cardano/cnode/bin/cardano-node-chairman | |
sudo ln -s /opt/cardano/cnode/bin/cardano-ping | |
sudo ln -s /opt/cardano/cnode/bin/cardano-submit-api | |
sudo ln -s /opt/cardano/cnode/bin/cardano-testnet | |
sudo ln -s /opt/cardano/cnode/bin/cardano-topology | |
sudo ln -s /opt/cardano/cnode/bin/chain-sync-client-with-ledger-state | |
sudo ln -s /opt/cardano/cnode/bin/db-analyser | |
sudo ln -s /opt/cardano/cnode/bin/db-converter | |
sudo ln -s /opt/cardano/cnode/bin/ledger-state | |
sudo ln -s /opt/cardano/cnode/bin/locli | |
sudo ln -s /opt/cardano/cnode/bin/plutus-example | |
sudo ln -s /opt/cardano/cnode/bin/scan-blocks | |
sudo ln -s /opt/cardano/cnode/bin/scan-blocks-pipelined | |
sudo ln -s /opt/cardano/cnode/bin/stake-credential-history | |
sudo ln -s /opt/cardano/cnode/bin/trace-dispatcher-examples | |
# edit /opt/cardano/cnode/scripts/env | |
#CNODE_HOME="/opt/cardano/cnode" | |
#CNODEBIN="${CNODE_HOME}/bin/cardano-node" | |
#CCLI="${CNODE_HOME}/bin/cardano-cli" | |
#CNODE_PORT=6000 | |
#CONFIG="${CNODE_HOME}/bin/configuration/cardano/mainnet-config.json" | |
#SOCKET="${CNODE_HOME}/sockets/node.socket" | |
#TOPOLOGY="${CNODE_HOME}/bin/configuration/cardano/mainnet-topology.json" | |
# edit /opt/cardano/cnode/bin/configuration/cardano/mainnet-config.json | |
cd /opt/cardano/cnode/bin/configuration/cardano/ | |
mv mainnet-config.json mainnet-config.json.orig | |
wget https://gist.githubusercontent.com/placek/ed1489a1ddcd4dea76a6f42d7bb60a67/raw/47ac87966bfe756d9e249f47d546c70e510164b7/mainnet-config.json | |
# edit /opt/cardano/cnode/scripts/cnode.sh | |
#CPU_CORES=4 | |
# install cnode and submitapi services | |
cd ${CNODE_HOME}/scripts | |
./cnode.sh -d | |
./submitapi.sh -d | |
sudo systemctl enable cnode | |
sudo systemctl restart cnode | |
sudo systemctl enable cnode-submit-api | |
sudo systemctl restart cnode-submit-api | |
# load cardano node snapshot | |
cd | |
sudo apt update && sudo apt install liblz4-tool jq curl | |
curl https://downloads.csnapshots.io/mainnet/$(curl -s https://downloads.csnapshots.io/mainnet/mainnet-db-snapshot.json | jq -r .[].file_name ) --output mainnet-snapshot.tar.lz4 | |
lz4 -dvc --no-sparse mainnet-snapshot.tar.lz4 | tar x -C ${CNODE_HOME} | |
# install postgresql 14 | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
RELEASE=$(lsb_release -cs) | |
echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list | |
sudo apt-get update | |
sudo apt-get -y install postgresql-14 postgresql-server-dev-14 postgresql-contrib libghc-hdbc-postgresql-dev | |
cat <<EOF | sudo tee -a /etc/postgresql/14/main/postgresql.conf | |
ssl = on | |
max_connections = 200 | |
shared_buffers = 32GB | |
effective_cache_size = 96GB | |
maintenance_work_mem = 2GB | |
checkpoint_completion_target = 0.9 | |
wal_buffers = 16MB | |
default_statistics_target = 100 | |
random_page_cost = 4 | |
effective_io_concurrency = 2 | |
work_mem = 41943kB | |
min_wal_size = 2GB | |
max_wal_size = 8GB | |
max_worker_processes = 16 | |
max_parallel_workers_per_gather = 4 | |
max_parallel_workers = 16 | |
max_parallel_maintenance_workers = 4 | |
wal_level = minimal | |
max_wal_senders = 0 | |
synchronous_commit = off | |
listen_addresses = '*' | |
EOF | |
cat <<EOF | sudo tee -a /etc/postgresql/14/main/pg_hba.conf | |
hostssl all all 65.108.64.111/32 md5 | |
hostssl all all 185.48.176.109/32 md5 | |
EOF | |
sudo systemctl restart postgresql | |
sudo systemctl enable postgresql | |
DBPASS= #insert db password | |
sudo su postgres | |
cat <<EOF | psql | |
CREATE ROLE byron SUPERUSER LOGIN; | |
ALTER USER byron PASSWORD '$DBPASS'; | |
EOF | |
export PGPASSFILE=$CNODE_HOME/priv/.pgpass | |
echo "/var/run/postgresql:5432:cexplorer:*:*" > $PGPASSFILE | |
chmod 0600 $PGPASSFILE | |
# psql postgres | |
# cardano db sync binaries | |
cd ${CNODE_HOME}/bin | |
wget https://hydra.iohk.io/build/17698701/download/1/cardano-db-sync-13.0.4-linux.tar.gz | |
tar zxfv cardano-db-sync-13.0.4-linux.tar.gz | |
cd /usr/local/bin | |
sudo ln -s /opt/cardano/cnode/bin/cardano-smash-server | |
sudo ln -s /opt/cardano/cnode/bin/cardano-db-sync | |
sudo ln -s /opt/cardano/cnode/bin/gen-schema-docs | |
sudo ln -s /opt/cardano/cnode/bin/cardano-db-tool | |
# edit /opt/cardano/cnode/scripts/dbsync.sh | |
#DBSYNCBIN="${CNODE_HOME}/bin/cardano-db-sync" | |
# cardano db sync source | |
cd ~/git | |
git clone https://github.com/input-output-hk/cardano-db-sync | |
cd cardano-db-sync | |
git fetch --tags --all | |
git pull | |
git checkout $(curl -s https://api.github.com/repos/input-output-hk/cardano-db-sync/releases/latest | jq -r .tag_name) | |
# setup schema | |
scripts/postgresql-setup.sh --createdb | |
ln -s ~/git/cardano-db-sync/schema $CNODE_HOME/guild-db/schema | |
# load snapshot | |
# https://update-cardano-mainnet.iohk.io/cardano-db-sync/index.html#13/ | |
wget https://update-cardano-mainnet.iohk.io/cardano-db-sync/13/db-sync-snapshot-schema-13-block-7643447-x86_64.tgz | |
rm -rf ${CNODE_HOME}/guild-db/ledger-state ; mkdir -p ${CNODE_HOME}/guild-db/ledger-state | |
scripts/postgresql-setup.sh --restore-snapshot db-sync-snapshot-schema-13-block-7643447-x86_64.tgz ${CNODE_HOME}/guild-db/ledger-state | |
# install service | |
cd $CNODE_HOME/scripts | |
./dbsync.sh -d | |
sudo systemctl enable cnode-dbsync | |
sudo systemctl restart cnode-dbsync | |
# install koios | |
cd $CNODE_HOME/scripts | |
./setup-grest.sh -f -q | |
sudo systemctl enable cnode-postgrest | |
sudo systemctl restart cnode-postgrest | |
sudo systemctl enable cnode-haproxy | |
sudo systemctl restart cnode-haproxy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment