aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-11-17 23:31:46 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2021-11-17 23:31:46 -0500
commit0210ba9f80ff477fcb20dcc3d92c88e333588809 (patch)
treea96e9c2ddd04b7c91d18373773b629ac2ce42c5c
parent0357eec569ea2b22be3909f2985a67f597e16c92 (diff)
downloaddotfiles-0210ba9f80ff477fcb20dcc3d92c88e333588809.tar.gz
dotfiles-0210ba9f80ff477fcb20dcc3d92c88e333588809.tar.xz
restore the tezos scripts
-rw-r--r--tezos/install.sh68
-rw-r--r--tezos/start.sh26
2 files changed, 94 insertions, 0 deletions
diff --git a/tezos/install.sh b/tezos/install.sh
new file mode 100644
index 0000000..0d55472
--- /dev/null
+++ b/tezos/install.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+set -e
+
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+ocaml_compiler="4.09.1"
+ocaml_switch_name="for_tezos"
+
+printf "\033[1;31m"
+echo "**********************************************************************"
+echo "* Short install script for tezos from source code, loosely based on: *"
+echo "* https://tezos.gitlab.io/introduction/howtoget.html *"
+echo "* *"
+echo "* This script was created on 09-12-2020 and may need some checking *"
+echo "* over for updates in the future *"
+echo "* *"
+echo "* ocaml_compiler: $ocaml_compiler *"
+echo "**********************************************************************"
+echo
+printf "\033[0m"
+
+set -x
+
+# Check and see if cargo is in the path, if not let's add it
+if ! echo "$PATH"| grep -q cargo ; then
+ export PATH="$HOME/.cargo/bin:$PATH"
+fi
+
+# Check and see if rustc is available, if not we're going to go ahead
+# and try to install it from their main source
+if ! stat "$(which rustc | sed 1q)" >/dev/null 2>&1 ; then
+ echo "Need rustc... installing"
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+fi
+
+rustup set profile minimal
+rustup toolchain install 1.39.0
+rustup default 1.39.0
+. $HOME/.cargo/env
+
+# Check and see if we have the ppa already, if not let's go ahead and add it
+if ! apt policy 2>/dev/null | grep -q avsm/ppa ; then
+ sudo add-apt-repository ppa:avsm/ppa
+ sudo apt update
+fi
+sudo apt install opam
+
+# Only run if the switch for our tezos install does not currently exist
+if ! opam switch list 2>/dev/null | grep -q "$ocaml_switch_name" ; then
+ opam switch create "$ocaml_switch_name" "$ocaml_compiler"
+fi
+opam switch "$ocaml_switch_name"
+eval $(opam env)
+
+opam install depext
+opam depext tezos
+
+opam install tezos
diff --git a/tezos/start.sh b/tezos/start.sh
new file mode 100644
index 0000000..6c515cc
--- /dev/null
+++ b/tezos/start.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -e
+session="tezos-node"
+
+unset TMUX
+
+if tmux ls -F '#{session_name}' | grep -q "^$session" ; then
+ exec tmux att -t "$session"
+fi
+
+exec tmux new-session -s "$session" \;\
+ send-keys "tezos-node run --rpc-addr localhost:8732 --history-mode experimental-rolling" \;\
+ send-keys Enter \;\
+ \
+ new-window -n "endorser" \;\
+ send-keys -t "$session:endorser" "sleep 5 ; tezos-endorser-007-PsDELPH1 run" \;\
+ send-keys -t "$session:endorser" Enter \;\
+ \
+ new-window -n "baker" \;\
+ send-keys -t "$session:baker" \
+ "sleep 5 ; tezos-baker-007-PsDELPH1 run with local node \"$HOME/.tezos-node\" " \;\
+ send-keys -t "$session:baker" Enter \;\
+ \
+ new-window -n "accuser" \;\
+ send-keys -t "$session:accuser" "sleep 5 ; tezos-accuser-007-PsDELPH1 run" \;\
+ send-keys -t "$session:accuser" Enter \;\