Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Onion Services
Onionmine
Commits
2b7ae7f8
Verified
Commit
2b7ae7f8
authored
May 16, 2022
by
Silvio Rhatto
Browse files
Feat: replace Makefile by the onionmine wrapper (Closes #18)
parent
e4c313ba
Changes
9
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
2b7ae7f8
pools
onionmine.conf
bin/mkp224o
Makefile.local
README.md
View file @
2b7ae7f8
...
...
@@ -74,11 +74,6 @@ when setting up Onion Services, and Onionmine aims to ease this process.
*
Can be integrated with an external password manager
to store the random seed.
## Dependencies
*
[
Debian GNU/Linux
](
https://www.debian.org
)
.
*
[
GNU Make
](
https://tracker.debian.org/pkg/make-dfsg
)
package.
## Usage
### Getting
...
...
@@ -100,26 +95,28 @@ configuration](onionmine.conf.sample) with lots of examples:
The following command installs the needed dependencies on an Debian-compatible
system and compiles
`mkp224o`
(requires
`sudo`
privileges):
mak
e provision
./onionmin
e provision
You might run it on a dedicated enviroment, such as an Raspberry Pi mini-server
or a dedicated virtual machine.
Currently testes only on
[
Debian GNU/Linux
](
https://www.debian.org
)
.
### Mining
Create a configuration, use yor favourite
`$EDITOR`
to create filters
and start mining!
mak
e config
pool=
my-pool
# create a config called "my-pool"
./onionmin
e config my-pool # create a config called "my-pool"
$EDITOR pools/my-pool/filters.lst # populate your filters
make mine pool=
my-pool # start mining
./onionmine mine
my-pool # start mining
This command takes care of compiling
`mkp224o`
and start mining with the
desired configuration.
Run the above
`
mak
e config`
command for each Onion Service you're mining
keys.
Configuration and mined keys are stored under the
`pool/my-pool`
folder,
with
mined keys at the
`pool/my-pool/candidates`
.
Run the above
`
onionmin
e config`
command for each Onion Service you're mining
keys.
Configuration and mined keys are stored under the
`pool/my-pool`
folder,
with
mined keys at the
`pool/my-pool/candidates`
.
Check
[
this configuration
](
pools/example.org
)
for an example mining pool.
...
...
@@ -135,7 +132,7 @@ If by any change a `mkp224o` recompilation is neeed without triggering
additional key generation, use this command (e.g. after you change it's build
flags at the
`onionmine.conf`
file):
mak
e compile
./onionmin
e compile
### Stopping and resuming
...
...
@@ -186,7 +183,9 @@ related keys.
Once you selected a candidate address that suits your needs, you might want to
test if the keys are validated by the Tor process, just to make sure.
Onionmine provides a test script for that, located at
`bin/test-keys`
.
Onionmine provides a test script for that:
./onionmine test-keys
Check
[
this
issue
](
https://gitlab.torproject.org/tpo/onion-services/onionmine/-/issues/2
)
...
...
@@ -200,7 +199,7 @@ compiled.
It can be invoked by running
./
bin/
onion-csr
./
onionmine
onion-csr
## Tasks
...
...
bin/config
View file @
2b7ae7f8
...
...
@@ -25,7 +25,7 @@ source $DIRNAME/params
# Check
if
[
-z
"
$CONFIG
"
]
;
then
echo
"usage:
$BASENAME
<config-pool-name>"
echo
"usage:
onionmine
$BASENAME
<config-pool-name>"
exit
1
fi
...
...
bin/mine
View file @
2b7ae7f8
...
...
@@ -25,7 +25,7 @@ source $DIRNAME/params
# Check
if
[
-z
"
$CONFIG
"
]
;
then
echo
"usage:
$BASENAME
<config-pool-name>"
echo
"usage:
onionmine
$BASENAME
<config-pool-name>"
exit
1
elif
[
!
-e
"
$FILTERS
"
]
;
then
echo
"
$BASENAME
: no such file
$FILTERS
"
...
...
@@ -47,7 +47,7 @@ fi
# Compile
echo
"
$BASENAME
: compiling mkp224o to make sure it's built with the current flags..."
make
-C
$BASEDIR
compile
$DIRNAME
/
compile
# Start log
echo
">started at:
$DATE
"
>
$LOG
...
...
bin/mine-batch
View file @
2b7ae7f8
...
...
@@ -39,5 +39,5 @@ for pool in `ls $POOLS`; do
# Start mining
echo
">batch: processing pool:
$pool
"
make
-C
$BASEDIR
mine
pool
=
$pool
$DIRNAME
/mine
$pool
done
bin/provision
View file @
2b7ae7f8
...
...
@@ -28,7 +28,7 @@ echo "$BASENAME: installing $DEPENDENCIES..."
sudo
apt
install
-y
$DEPENDENCIES
# Compile
#
make -C $BASEDIR
compile
#
$DIRNAME/
compile
# Build HARICA's onion-csr
sudo
gem
install
ffi
...
...
bin/sync-to-remotes
View file @
2b7ae7f8
#!/usr/bin/env bash
#
#
Mine
Onion
Service keys using mkp224o on
remote servers.
#
Sync
Onion
mine to
remote servers.
#
# Copyright (C) 2022 Silvio Rhatto <rhatto@torproject.org>
#
...
...
bin/test-keys
View file @
2b7ae7f8
...
...
@@ -51,7 +51,7 @@ function teardown() {
}
function
usage
()
{
echo
"usage:
$BASENAME
<pool> <candidate> [wait]"
echo
"usage:
onionmine
$BASENAME
<pool> <candidate> [wait]"
echo
""
echo
"Test an Onion Service keypair candidate mined in a pool"
echo
""
...
...
Makefil
e
→
onionmin
e
100644 → 100755
View file @
2b7ae7f8
# Onionmine Makefile
#!/usr/bin/env bash
#
# Onionmine wrapper.
#
# Copyright (C) 2022 Silvio Rhatto <rhatto@torproject.org>
#
...
...
@@ -16,28 +18,32 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Include the sample config
#-include onionmine.conf.sample
# Include the config file so Makefile includes custom configs and
# overrides
-include
onionmine.conf
# Provision the environment
provision
:
@
bin/provision
# Compile mkp224o
compile
:
@
bin/compile
# Parameters
BASENAME
=
"
`
basename
$0
`
"
DIRNAME
=
"
`
dirname
$0
`
"
source
$DIRNAME
/bin/params
# Create a pool configuration
config
:
@
bin/config
${pool}
# Additional parameters
COMMAND
=
"
$1
"
# Start mining
mine
:
@
bin/mine
${pool}
# Usage
function
usage
()
{
echo
"usage:
$BASENAME
<command> [options]"
echo
""
echo
"available commands"
echo
""
ls
-1
$DIRNAME
/bin |
sed
-e
's/^/\t/'
echo
""
}
# Include local targets
-include
Makefile.local
# Dispatch
if
[
-z
"
$COMMAND
"
]
;
then
usage
exit
1
elif
[
-e
"
$DIRNAME
/bin/
$COMMAND
"
]
;
then
shift
$DIRNAME
/bin/
$COMMAND
"
$@
"
else
usage
exit
1
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment