Skip to content

Instantly share code, notes, and snippets.

@d4hines
Created January 12, 2023 18:38
Show Gist options
  • Save d4hines/b4b24add03d986939cbcdbf0484416f1 to your computer and use it in GitHub Desktop.
Save d4hines/b4b24add03d986939cbcdbf0484416f1 to your computer and use it in GitHub Desktop.
Starting a Sandboxed Tezos Chain
# ./.tmuxinator.yml
name: tezos-sandbox
root: .
# Runs on project start, always
on_project_start:
- mkdir -p ./sandbox/1
- mkdir -p ./sandbox/2
windows:
- tezos:
layout: even-horizontal
# Synchronize all panes of this window, can be enabled before or after the pane commands run.
# 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
# synchronize: after
panes:
- DATA_DIR=./sandbox/1 ./src/bin_node/octez-sandboxed-node.sh 1 --connections 1
- DATA_DIR=./sandbox/2 ./src/bin_node/octez-sandboxed-node.sh 2
- sleep 3 && ./inject.sh && sleep 3 && eval `./src/bin_client/octez-init-sandboxed-client.sh 1` && octez-baker-alpha run with local node ./sandbox/1 --liquidity-baking-toggle-vote pass
#!/usr/bin/env bash
set -e
id=${1:-1}
host="${2:-localhost}"
client_dirs=()
local_client="${local_client:-./_build/default/src/bin_client/main_client.exe}"
parameters_file="./_build/default/src/proto_alpha/lib_parameters/sandbox-parameters.json"
init_sandboxed_client() {
rpc=$((18730 + id))
mkdir -p ./sandbox/client
client_dir=./sandbox/client
client_dirs+=("$client_dir")
if [ -n "$USE_TLS" ]; then
client="$local_client -base-dir $client_dir -endpoint https://$host:$rpc"
else
client="$local_client -base-dir $client_dir -endpoint http://$host:$rpc"
fi
BOOTSTRAP1_IDENTITY="tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx"
BOOTSTRAP1_PUBLIC="edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav"
BOOTSTRAP1_SECRET="unencrypted:edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh"
BOOTSTRAP2_IDENTITY="tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN"
BOOTSTRAP2_PUBLIC="edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9"
BOOTSTRAP2_SECRET="unencrypted:edsk39qAm1fiMjgmPkw1EgQYkMzkJezLNewd7PLNHTkr6w9XA2zdfo"
BOOTSTRAP3_IDENTITY="tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU"
BOOTSTRAP3_PUBLIC="edpkuTXkJDGcFd5nh6VvMz8phXxU3Bi7h6hqgywNFi1vZTfQNnS1RV"
BOOTSTRAP3_SECRET="unencrypted:edsk4ArLQgBTLWG5FJmnGnT689VKoqhXwmDPBuGx3z4cvwU9MmrPZZ"
BOOTSTRAP4_IDENTITY="tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv"
BOOTSTRAP4_PUBLIC="edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU"
BOOTSTRAP4_SECRET="unencrypted:edsk2uqQB9AY4FvioK2YMdfmyMrer5R8mGFyuaLLFfSRo8EoyNdht3"
BOOTSTRAP5_IDENTITY="tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv"
BOOTSTRAP5_PUBLIC="edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n"
BOOTSTRAP5_SECRET="unencrypted:edsk4QLrcijEffxV31gGdN2HU7UpyJjA8drFoNcmnB28n89YjPNRFm"
ACTIVATOR_SECRET="unencrypted:edsk31vznjHSSpGExDMHYASz45VZqXN4DPxvsa4hAyY8dHM28cZzp6"
${client} import secret key bootstrap1 ${BOOTSTRAP1_SECRET} --force
${client} import secret key bootstrap2 ${BOOTSTRAP2_SECRET} --force
${client} import secret key bootstrap3 ${BOOTSTRAP3_SECRET} --force
${client} import secret key bootstrap4 ${BOOTSTRAP4_SECRET} --force
${client} import secret key bootstrap5 ${BOOTSTRAP5_SECRET} --force
${client} import secret key activator ${ACTIVATOR_SECRET} --force
}
activate_alpha() {
echo $client
# Calling `date` with 'AAA+1' is a small tweak to speed-up
# the block baking process. Having a one-hour back timestamp
# avoids having to wait for at least [time_between_block] to
# produce new blocks.
$client \
-block genesis \
activate protocol ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK \
with fitness 1 \
and key activator \
and parameters "${parameters_file}"
}
### Check if a directory does not exist ###
if [ ! -d "./sandbox/client" ]; then
init_sandboxed_client
fi
activate_alpha || true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment