設定ファイルのダウンロード
Cardano Nodeを実行するには、複数の構成ファイルが必要です。
ステークプールのCardano Nodeインスタンスをホストしている各コンピューターに構成ファイルをダウンロードする必要があります。
Cardano Node構成ファイルのダウンロード
- ディレクトリを移動します。
cd $NODE_HOME
config.jsonとcheckpoints.jsonとpeer-snapshot.jsonとguardrails-script.plutusのダウンロード
- リレー
- BP
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/config.json -O ${NODE_CONFIG}-config.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/checkpoints.json -O ${NODE_CONFIG}-checkpoints.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/peer-snapshot.json -O ${NODE_CONFIG}-peer-snapshot.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/guardrails-script.plutus -O ${NODE_CONFIG}-guardrails-script.plutus
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/config-bp.json -O ${NODE_CONFIG}-config.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/checkpoints.json -O ${NODE_CONFIG}-checkpoints.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/peer-snapshot.json -O ${NODE_CONFIG}-peer-snapshot.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/guardrails-script.plutus -O ${NODE_CONFIG}-guardrails-script.plutus
genesis.jsonのダウンロード
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/topology.json -O ${NODE_CONFIG}-topology.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/byron-genesis.json -O ${NODE_CONFIG}-byron-genesis.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/shelley-genesis.json -O ${NODE_CONFIG}-shelley-genesis.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/alonzo-genesis.json -O ${NODE_CONFIG}-alonzo-genesis.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments/${NODE_CONFIG}/conway-genesis.json -O ${NODE_CONFIG}-conway-genesis.json
config.jsonの修正
TraceMempoolは構築時に確認する際Trueとしますが、以降Txの流入が確認でき次第、Falseにします。
Preview、Preprod用
- ディレクトリを移動します。
cd $NODE_HOME
config.jsonとcheckpoints.jsonとpeer-snapshot.jsonとguardrails-script.plutusのダウンロード
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments-pre/${NODE_CONFIG}/config.json -O ${NODE_CONFIG}-config.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments-pre/${NODE_CONFIG}/checkpoints.json -O ${NODE_CONFIG}-checkpoints.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments-pre/${NODE_CONFIG}/peer-snapshot.json -O ${NODE_CONFIG}-peer-snapshot.json
wget --no-use-server-timestamps -q https://book.play.dev.cardano.org/environments-pre/${NODE_CONFIG}/guardrails-script.plutus -O ${NODE_CONFIG}-guardrails-script.plutus
cd "$NODE_HOME"
sed -i \
-e 's!"AlonzoGenesisFile": "[^"]\+"!"AlonzoGenesisFile": "'"${NODE_CONFIG}"'-alonzo-genesis.json"!' \
-e 's!"ByronGenesisFile": "[^"]\+"!"ByronGenesisFile": "'"${NODE_CONFIG}"'-byron-genesis.json"!' \
-e 's!"ShelleyGenesisFile": "[^"]\+"!"ShelleyGenesisFile": "'"${NODE_CONFIG}"'-shelley-genesis.json"!' \
-e 's!"DijkstraGenesisFile": "[^"]\+"!"DijkstraGenesisFile": "'"${NODE_CONFIG}"'-dijkstra-genesis.json"!' \
-e 's!"ConwayGenesisFile": "[^"]\+"!"ConwayGenesisFile": "'"${NODE_CONFIG}"'-conway-genesis.json"!' \
-e 's!"CheckpointsFile": "[^"]\+"!"CheckpointsFile": "'"${NODE_CONFIG}"'-checkpoints.json"!' \
-e 's!"UseTraceDispatcher": false!"UseTraceDispatcher": true!' \
"${NODE_CONFIG}-config.json"
jq \
--arg lsmDatabasePath "${NODE_HOME}/db/lsm" \
'
.UseTraceDispatcher = true
| .TraceOptionMetricsPrefix = "cardano.node.metrics."
| .minSeverity = "Critical"
| (.TraceOptions //= {})
| (.TraceOptions[""] //= {})
| .TraceOptions[""].backends = ["PrometheusSimple 0.0.0.0 12798","Stdout MachineFormat"]
| .TraceOptions[""].detail = "DNormal"
| .TraceOptions[""].severity = "Notice"
| .LedgerDB = {
"Backend": "V2LSM",
"SnapshotInterval": 86400,
"NumOfDiskSnapshots": 2,
"QueryBatchSize": 100000,
"LSMDatabasePath": $lsmDatabasePath
}
' "${NODE_CONFIG}-config.json" > tmp.json \
&& mv tmp.json "${NODE_CONFIG}-config.json"
置換箇所の確認
jq '{
AlonzoGenesisFile,
ByronGenesisFile,
ConsensusMode,
ShelleyGenesisFile,
DijkstraGenesisFile,
ConwayGenesisFile,
CheckpointsFile,
LedgerDB,
UseTraceDispatcher,
TraceOptionMetricsPrefix,
TraceOptions_root: .TraceOptions[""],
minSeverity
}' "${NODE_CONFIG}-config.json"
構築時:TraceMempoolをTrueへ
sed -i "${NODE_CONFIG}-config.json" \
-e 's!"AlonzoGenesisFile": "[^"]\+"!"AlonzoGenesisFile": "'${NODE_CONFIG}'-alonzo-genesis.json"!' \
-e 's!"ByronGenesisFile": "[^"]\+"!"ByronGenesisFile": "'${NODE_CONFIG}'-byron-genesis.json"!' \
-e 's!"ShelleyGenesisFile": "[^"]\+"!"ShelleyGenesisFile": "'${NODE_CONFIG}'-shelley-genesis.json"!' \
-e 's!"ConwayGenesisFile": "[^"]\+"!"ConwayGenesisFile": "'${NODE_CONFIG}'-conway-genesis.json"!' \
-e 's!"CheckpointsFile": "[^"]\+"!"CheckpointsFile": "'${NODE_CONFIG}'-checkpoints.json"!' \
-e '/"LedgerDB"/,/}/{ s!"SnapshotInterval": 4320!"SnapshotInterval": 86400! }' \
-e 's!"TraceBlockFetchDecisions": false!"TraceBlockFetchDecisions": true!' \
-e 's!"TraceMempool": false!"TraceMempool": true!' \
-e '/"rotation"/,/}/{ s!"rpKeepFilesNum": 10!"rpKeepFilesNum": 30! }' \
-e '/"rotation"/,/}/{ s!"rpMaxAgeHours": 24!"rpMaxAgeHours": 48! }' \
-e "s/127.0.0.1/0.0.0.0/g"
jq --arg path "./logs/node.json" '
.defaultScribes |=
if any(.[]; .[0] == "FileSK" and .[1] == $path)
then .
else . + [["FileSK", $path]]
end
|
.setupScribes |=
if any(.[]; .scKind == "FileSK" and .scName == $path)
then .
else . + [{
"scFormat": "ScJson",
"scKind": "FileSK",
"scName": $path
}]
end
' "${NODE_CONFIG}-config.json" > tmp.json && mv tmp.json "${NODE_CONFIG}-config.json"
sed -i "${NODE_CONFIG}-config.json" \
-e 's!"AlonzoGenesisFile": "[^"]\+"!"AlonzoGenesisFile": "'${NODE_CONFIG}'-alonzo-genesis.json"!' \
-e 's!"ByronGenesisFile": "[^"]\+"!"ByronGenesisFile": "'${NODE_CONFIG}'-byron-genesis.json"!' \
-e 's!"ShelleyGenesisFile": "[^"]\+"!"ShelleyGenesisFile": "'${NODE_CONFIG}'-shelley-genesis.json"!' \
-e 's!"ConwayGenesisFile": "[^"]\+"!"ConwayGenesisFile": "'${NODE_CONFIG}'-conway-genesis.json"!' \
-e 's!"CheckpointsFile": "[^"]\+"!"CheckpointsFile": "'${NODE_CONFIG}'-checkpoints.json"!' \
-e '/"LedgerDB"/,/}/{ s!"SnapshotInterval": 4320!"SnapshotInterval": 86400! }' \
-e 's!"TraceBlockFetchDecisions": false!"TraceBlockFetchDecisions": true!' \
-e '/"rotation"/,/}/{ s!"rpKeepFilesNum": 10!"rpKeepFilesNum": 30! }' \
-e '/"rotation"/,/}/{ s!"rpMaxAgeHours": 24!"rpMaxAgeHours": 48! }' \
-e "s/127.0.0.1/0.0.0.0/g"
jq --arg path "./logs/node.json" '
.defaultScribes |=
if any(.[]; .[0] == "FileSK" and .[1] == $path)
then .
else . + [["FileSK", $path]]
end
|
.setupScribes |=
if any(.[]; .scKind == "FileSK" and .scName == $path)
then .
else . + [{
"scFormat": "ScJson",
"scKind": "FileSK",
"scName": $path
}]
end
' "${NODE_CONFIG}-config.json" > tmp.json && mv tmp.json "${NODE_CONFIG}-config.json"
置換箇所の確認
jq '.LedgerDB, .rotation, .defaultScribes, .setupScribes' "${NODE_CONFIG}-config.json"
SanchoNet
https://github.com/Hornan7/SanchoNet-Tutorials/tree/main/genesis
- ディレクトリを移動します。
cd $NODE_HOME
config.jsonとpeer-snapshot.jsonのダウンロード
- リレー
- BP
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/config.json -O ${NODE_CONFIG}-config.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/peer-snapshot.json -O ${NODE_CONFIG}-peer-snapshot.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/config-bp.json -O ${NODE_CONFIG}-config.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/peer-snapshot.json -O ${NODE_CONFIG}-peer-snapshot.json
genesis.jsonとguardrails-script.plutusのダウンロード
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/topology.json -O ${NODE_CONFIG}-topology.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/guardrails-script.plutus -O ${NODE_CONFIG}-guardrails-script.plutus
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/byron-genesis.json -O ${NODE_CONFIG}-byron-genesis.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/shelley-genesis.json -O ${NODE_CONFIG}-shelley-genesis.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/alonzo-genesis.json -O ${NODE_CONFIG}-alonzo-genesis.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/conway-genesis.json -O ${NODE_CONFIG}-conway-genesis.json
wget --no-use-server-timestamps -q https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/dijkstra-genesis.json -O ${NODE_CONFIG}-dijkstra-genesis.json
config.jsonの修正
TraceMempoolは構築時に確認する際Trueとしますが、以降Txの流入が確認でき次第、Falseにします。
構築時:TraceMempoolをTrueへ
sed -i "${NODE_CONFIG}-config.json" \
-e 's!"AlonzoGenesisFile": "[^"]\+"!"AlonzoGenesisFile": "'${NODE_CONFIG}'-alonzo-genesis.json"!' \
-e 's!"ByronGenesisFile": "[^"]\+"!"ByronGenesisFile": "'${NODE_CONFIG}'-byron-genesis.json"!' \
-e 's!"ConsensusMode": "GenesisMode"!"ConsensusMode": "PraosMode"!' \
-e 's!"ShelleyGenesisFile": "[^"]\+"!"ShelleyGenesisFile": "'${NODE_CONFIG}'-shelley-genesis.json"!' \
-e 's!"DijkstraGenesisFile": "[^"]\+"!"DijkstraGenesisFile": "'${NODE_CONFIG}'-dijkstra-genesis.json"!' \
-e 's!"ConwayGenesisFile": "[^"]\+"!"ConwayGenesisFile": "'${NODE_CONFIG}'-conway-genesis.json"!' \
-e 's!"CheckpointsFile": "[^"]\+"!"CheckpointsFile": "'${NODE_CONFIG}'-checkpoints.json"!' \
-e '/"LedgerDB"/,/}/{ s!"SnapshotInterval": 4320!"SnapshotInterval": 86400! }'
jq --arg path "./logs/node.json" '
.defaultScribes |=
if any(.[]; .[0] == "FileSK" and .[1] == $path)
then .
else . + [["FileSK", $path]]
end
|
.setupScribes |=
if any(.[]; .scKind == "FileSK" and .scName == $path)
then .
else . + [{
"scFormat": "ScJson",
"scKind": "FileSK",
"scName": $path
}]
end
' "${NODE_CONFIG}-config.json" > tmp.json && mv tmp.json "${NODE_CONFIG}-config.json"
sed -i "${NODE_CONFIG}-config.json" \
-e 's!"AlonzoGenesisFile": "[^"]\+"!"AlonzoGenesisFile": "'${NODE_CONFIG}'-alonzo-genesis.json"!' \
-e 's!"ByronGenesisFile": "[^"]\+"!"ByronGenesisFile": "'${NODE_CONFIG}'-byron-genesis.json"!' \
-e 's!"ConsensusMode": "GenesisMode"!"ConsensusMode": "PraosMode"!' \
-e 's!"ShelleyGenesisFile": "[^"]\+"!"ShelleyGenesisFile": "'${NODE_CONFIG}'-shelley-genesis.json"!' \
-e 's!"DijkstraGenesisFile": "[^"]\+"!"DijkstraGenesisFile": "'${NODE_CONFIG}'-dijkstra-genesis.json"!' \
-e 's!"ConwayGenesisFile": "[^"]\+"!"ConwayGenesisFile": "'${NODE_CONFIG}'-conway-genesis.json"!' \
-e 's!"CheckpointsFile": "[^"]\+"!"CheckpointsFile": "'${NODE_CONFIG}'-checkpoints.json"!' \
-e '/"LedgerDB"/,/}/{ s!"SnapshotInterval": 4320!"SnapshotInterval": 86400! }'
jq --arg path "./logs/node.json" '
.defaultScribes |=
if any(.[]; .[0] == "FileSK" and .[1] == $path)
then .
else . + [["FileSK", $path]]
end
|
.setupScribes |=
if any(.[]; .scKind == "FileSK" and .scName == $path)
then .
else . + [{
"scFormat": "ScJson",
"scKind": "FileSK",
"scName": $path
}]
end
' "${NODE_CONFIG}-config.json" > tmp.json && mv tmp.json "${NODE_CONFIG}-config.json"