Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Running this script will create any number of tahoe nodes with an introducer on a single computer where tahoe is set up. Run it quickly like this: wget -q -O - | bash
# Run by doing:
# wget -q -O - | bash
####### Change stuff here:
# somewhere with a little bit of space, with tahoe's defaults you need at least 1GB to upload anything:
# your path to tahoe, or if tahoe is in your path, just tahoe=tahoe should work, but I'm working on stuff, so I have the git checkout in my home directory:
N=11 # number of nodes, mine goes up to 11
####### You don't need to change anything below, but check for rm -rf statements. Never trust me, because I don't trust me.
[[ -d $directoryWithSpace ]] || mkdir $directoryWithSpace || exit
cd $directoryWithSpace
[[ -d test-introducer ]] || $tahoe create-introducer test-introducer
$tahoe restart test-introducer || exit
sleep 3
#vim $directoryWithSpace/test-introducer/introducer.furl
export introducerFURL=$(cat $directoryWithSpace/test-introducer/introducer.furl)
echo $introducerFURL
[[ -z $introducerFURL ]] && exit
for testNode in $(seq 0 $((N-1)));
$tahoe create-node testNode${testNode}
sed -i -e 's#^introducer.furl.*#introducer.furl = '$introducerFURL'\nnode-url ='${testNode}'#g' \
-e 's#web.port = tcp:3456:interface= = tcp:'$((3450 + testNode))':interface=' \
$tahoe start testNode${testNode}
if [[ $testNode -eq "0" ]]; then
sleep 3
$tahoe webopen --node-url=$(cat $directoryWithSpace/testNode0/node.url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.