Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple mainnet node script #1847

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ stack.yaml.lock
/db
/db-[0-9]
/logs
/mainnet
/profile
/launch_*
/state-*
Expand Down
33 changes: 33 additions & 0 deletions scripts/lite/mainnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

# This script connects a node to mainnet

ROOT="$(realpath "$(dirname "$0")/../..")"
configuration="${ROOT}/configuration/cardano"

data_dir=mainnet
mkdir -p "${data_dir}"
db_dir="${data_dir}/db/node"
mkdir -p "${db_dir}"
socket_dir="${data_dir}/socket"
mkdir -p "${socket_dir}"

# Launch a node
cabal run exe:cardano-node -- run \
--config "${configuration}/mainnet-config.json" \
--topology "${configuration}/mainnet-topology.json" \
--database-path "${db_dir}" \
--socket-path "${socket_dir}/node-1-socket" \
--host-addr "127.0.0.1" \
--port "3001"



function cleanup()
{
for child in $(jobs -p); do
echo kill "$child" && kill "$child"
done
}

trap cleanup EXIT
6 changes: 1 addition & 5 deletions scripts/lite/shelley-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ for i in 1 2 3; do
--cold-signing-key-file "${data_dir}/node-$i/hotkey.skey" \
--operational-certificate-issue-counter-file "${data_dir}/node-$i/counterFile.counter" \
--out-file "${data_dir}/node-$i/opcert"
done

rmdir "${data_dir}/genesis/delegate-keys"

for i in 1 2 3; do
# Launch a node
cabal run exe:cardano-node -- run \
--database-path "${db_dir}" \
Expand All @@ -113,7 +109,7 @@ for i in 1 2 3; do
| sed "s|^|${esc}[$((31+$i))m[node-$i]${esc}[0m |g" &
done


rmdir "${data_dir}/genesis/delegate-keys"

function cleanup()
{
Expand Down