created shell script that builds and installs all of the relays

This commit is contained in:
2025-08-16 13:05:39 +01:00
parent fa3b717cf4
commit 9c731f729f
3 changed files with 86 additions and 5 deletions

5
cmd/benchmark/.goenv Normal file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
export GOBIN=$HOME/.local/bin
export GOPATH=$HOME
export GOROOT=$HOME/go
export PATH=$GOBIN:$GOROOT/bin:$PATH

81
cmd/benchmark/install.sh Executable file
View File

@@ -0,0 +1,81 @@
#!/usr/bin/env bash
echo multi-relay installer - this is written for ubuntu 24.04, may work with debian and other debian based distros. REQUIRES SUDO.
echo "this script must be run as '. `pwd`/install.sh', if not, stop and invoke again with the . in front."
read -p "Press Enter to continue, ctrl-C to stop."
PREVPATH=`pwd`
printf "\n>>> updating apt \r"
sudo apt update > /dev/null 2>&1
printf ">>> installing prerequisite deb packages \r"
sudo apt install -y \
git \
build-essential \
cmake \
pkg-config \
libssl-dev \
liblmdb-dev \
libsqlite3-dev \
flatbuffers-compiler \
flatbuffers-compiler-dev \
libflatbuffers2 \
libsecp256k1-1 \
libsecp256k1-dev \
lmdb-doc \
autoconf \
automake \
libtool \
libflatbuffers-dev \
libzstd-dev zlib1g-dev \
> /dev/null 2>&1
printf ">>> installing go environment script \r"
cp .goenv $HOME/
chmod +x $HOME/.goenv
cd $HOME || exit1
printf ">>> downloading Go \r"
wget -nc https://go.dev/dl/go1.25.0.linux-amd64.tar.gz > /dev/null 2>&1
printf ">>> removing previous Go installation \r"
sudo rm -rf $HOME/go
printf ">>> unpacking Go install archive \r"
tar xf go1.25.0.linux-amd64.tar.gz
printf ">>> setting environment for Go \r"
printf ">>> installing strfry \n"
echo
cd $PREVPATH || exit
git clone https://github.com/hoytech/strfry.git && \
cd strfry && \
git submodule update --init && \
make setup-golpe && \
make -j$(nproc) && \
mv strfry $HOME/.local/bin/ && \
cd .. && \
rm -rf strfry
echo
printf ">>> installing khatru basic-badger\n"
echo
. $HOME/.goenv
git clone https://github.com/fiatjaf/khatru.git && \
cd khatru/examples/basic-badger && \
go build && \
mv basic-badger $HOME/.local/bin/khatru && \
cd ../../.. && \
rm -rf khatru
echo
printf ">>> installing relayer\n"
echo
git clone https://github.com/mleku/relayer.git && \
cd relayer && \
cd examples/basic && \
go build && \
mv basic $HOME/.local/bin/relayer && \
cd ../.. && \
rm -rf relayer
echo
printf ">>> installing ORLY\n"
echo
cd ../../..
go build && \
mv orly.dev $HOME/.local/bin/orly && \
cd $PREVPATH || exit
printf "run '. %s/.goenv' to configure environment for running Go, optionally add this to your .bashrc (already active now)\n" "$HOME"

View File

@@ -1,6 +1 @@
#!/usr/bin/env bash #!/usr/bin/env bash
docker compose up -d --remove-orphans
docker compose run benchmark -relay ws://orly:7447 -events 10000 -queries 100
docker compose run benchmark -relay ws://khatru:7447 -events 10000 -queries 100
docker compose run benchmark -relay ws://strfry:7777 -events 10000 -queries 100
docker compose run benchmark -relay ws://relayer:7447 -events 10000 -queries 100