Skip to content

Instantly share code, notes, and snippets.

@stackdump
Created February 7, 2019 19:49
Show Gist options
  • Select an option

  • Save stackdump/2f716a5d88adbf8e6abef07578c339df to your computer and use it in GitHub Desktop.

Select an option

Save stackdump/2f716a5d88adbf8e6abef07578c339df to your computer and use it in GitHub Desktop.
;~/.factom/m2/simConfig/factomd001.conf
;
;[app]
;IdentityChainID = 8888881570f89283f3a516b6e5ed240f43f5ad7cb05132378c4a006abe7c2b93
;LocalServerPrivKey = 3838383838383135373066383932383366336135313662366535656432343066
;LocalServerPublicKey = 803b318b23ec15de43db470200c1afb5d1b6156184e247ed035a8f0b6879155b
;ChangeAcksHeight = 0
;~/.factom/m2/simConfig/factomd002.conf
;
;[app]
;IdentityChainID = 8888888da6ed14ec63e623cab6917c66b954b361d530770b3f5f5188f87f1738
;LocalServerPrivKey = 3838383838383864613665643134656336336536323363616236393137633636
;LocalServerPublicKey = 11cae6d21e92d9ac0ee83e00f89a3aabde7e3c6f90824339281cfeb93c1377cd
;ChangeAcksHeight = 0
;~/.factom/m2/simConfig/factomd003.conf
;
;[app]
;IdentityChainID = 888888aeaac80d825ac9675cf3a6591916883bd9947e16ab752d39164d80a608
;LocalServerPrivKey = 3838383838386165616163383064383235616339363735636633613635393139
;LocalServerPublicKey = 15688e940b854d71411dd8dead29843932fc79c9c99cfb69ca6888b29cd13237
;ChangeAcksHeight = 0
;~/.factom/m2/simConfig/factomd004.conf
;
;[app]
;IdentityChainID = 888888f0b7e308974afc34b2c7f703f25ed2699cb05f818e84e8745644896c55
;LocalServerPrivKey = 3838383838386630623765333038393734616663333462326337663730336632
;LocalServerPublicKey = 67bb9fba9c9bab4cc532d9684001ae8bdb70ece551414ff25521d3647370f1c6
;ChangeAcksHeight = 0
;~/.factom/m2/simConfig/factomd005.conf
;
;IdentityChainID = 888888d2bc4ed232378c59a85e6c462bcc5495146f3a931a3a1ca42e3397f475
;LocalServerPrivKey = 3838383838386432626334656432333233373863353961383565366334363262
;LocalServerPublicKey = d4013c2379a725741534b8f636ada753274722aefa44b91963a104eb9c766b48
;ChangeAcksHeight = 0
;~/.factom/m2/simConfig/factomd006.conf
;
;[app]
;IdentityChainID = 88888867ee42e8b221343da237e08c0b35f50585854c5c05380837da5d55a098
;LocalServerPrivKey = 3838383838383637656534326538623232313334336461323337653038633062
;LocalServerPublicKey = 4fb6de25a67608a66c221191f216e0613b21665dc056024f1b4a3cb0b818880a
;ChangeAcksHeight = 0
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
function start_node() {
./factomd \
--count=7 \
--networkport="34341" \
--port="8091" \
--controlpanelport="9081" \
--logPort="6061" \
--peers="127.0.0.1:34340" \
--network=LOCAL \
--blktime=10 \
--factomhome=$DIR \
--startdelay=1 > out1.txt
}
function first_run() {
# copy config files
mkidr -p $DIR/.factom/m2/simConfig
cp ../simConfig/*.conf $DIR/.factom/m2/simConfig
start_node
}
# Example Commands creates 3 leaders and 3 auditors then removes original leader
##
# s
# --Print Summary On--
# g7
# 1 purchases, buying 1010 and balance is 0
# 100 Authorities added to the stack and funds are in wallet
# 2 purchases, buying 1010 and balance is 0
# === 7 Identities added to blockchain, 93 remain in stack, 0 skipped (Added by someone else) ===
# 1
# Switching to Node 1
# l
# Attempting to make FNode01 a Leader
#
# Switching to Node 2
# l
# Attempting to make FNode02 a Leader
#
# Switching to Node 3
# l
# Attempting to make FNode03 a Leader
#
# Switching to Node 4
# o
# Attempting to make FNode04 a Audit Server
#
# Switching to Node 5
# o
# Attempting to make FNode05 a Audit Server
#
# Switching to Node 6
# o
# Attempting to make FNode06 a Audit Server
#
# Switching to Node 0
# z
# Attempting to remove FNode0 as a server
#
# Switching to Node 1
##
function swap() {
cat "../simConfig/factomd00${1}.conf" | sed 's/ChangeAcksHeight = 0/ChangeAcksHeight = 12/' > "${DIR}/.factom/m2/simConfig/factomd00${2}.conf"
cat "../simConfig/factomd00${2}.conf" | sed 's/ChangeAcksHeight = 0/ChangeAcksHeight = 12/' > "${DIR}/.factom/m2/simConfig/factomd00${1}.conf"
}
function second_run() {
swap 6 1
start_node
}
function main() {
# uncomment to start clean
#rm -rf .factom
if [[ -d .factom ]] ; then
echo "rerun"
second_run
else
echo "create authoriy set using simulator"
echo "EX: g7 <enter> 1 <enter> L <enter> L <enter> L <enter> o enter> o <enter> o <wait> z"
first_run
fi
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment