Verified Commit cf77b82b authored by Silvio Rhatto's avatar Silvio Rhatto
Browse files

Feat(mine): sketching mine-batch and mine-remote (WIP)

parent 4804f6c4
#!/usr/bin/env bash
#
# Mine Onion Service keys using mkp224o: batch mode.
#
# Copyright (C) 2022 Silvio Rhatto <rhatto@torproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Parameters
BASENAME="`basename $0`"
DIRNAME="`dirname $0`"
source $DIRNAME/params
# FIXME
# Batch locally or in remote servers?
# Check if there are any limits for each pool?
# Iterate over all pools and start the mining process
#!/usr/bin/env bash
#
# Mine Onion Service keys using mkp224o on remote servers.
#
# Copyright (C) 2022 Silvio Rhatto <rhatto@torproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Parameters
BASENAME="`basename $0`"
DIRNAME="`dirname $0`"
source $DIRNAME/params
# Check
if [ -z "$CONFIG" ]; then
echo "usage: $BASENAME <config-pool-name>"
exit 1
elif [ ! -e "$FILTERS" ]; then
echo "$BASENAME: no such file $FILTERS"
exit 1
fi
# Check remotes
if [ -z "$REMOTE_HOSTS" ]; then
echo "$BASENAME: need to configure REMOTE_HOSTS parameter"
exit 1
fi
# Iterate over all defined hosts
for host in $REMOTE_HOSTS; do
# FIXME
#if [ ! -z "$REMOTE_HOSTS_RSYNC" ]; then
# true
#fi
# Connect to the remote host and start a mining operation
if [ ! -z "$REMOTE_HOSTS_SSH_COMMAND" ]; then
$REMOTE_HOSTS_SSH_COMMAND $host "make -C $REMOTE_HOSTS_BASEDIR mine pool=$CONFIG PASSPHRASE=$PASSPHRASE"
fi
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment