Preparing Testnet 5

I found a very tiny difference in CLI command with safe node:
*safe node bin-version [--endpoint, --node_path, --output, --xorurl]
safe node install [--endpoint, --node-path, --output, --xorurl]
safe node join [--endpoint, --hcc, --node-path, --output, --xorurl] <network-name>
safe node killall [--endpoint, --node-path, --output, --xorurl]
safe node run-baby-fleming {--testing, -y} [--endpoint, --interval, --ip, --node-path, --nodes, --output, --xorurl]
safe node update [--endpoint, --node-path, --output, --xorurl]

The CLI uses --node_path vs --node-path when using the safe node bin-version.

Also what is the purpose of giving --keyurl in safe keys balance, safe wallet create and safe wallet insert if you always have to provide the --sk and actually can leave the --keyurl away in its totality?

The SafeKey’s safe://xor-url to verify it matches/corresponds to the secret key provided. The corresponding secret key will be prompted if not provided with ‘–sk’

3 Likes

Some more progress on safenetwork-community/ dedup-tester

Please fork this and show me how it should really be done :slight_smile:

Warning - this is incredibly slow testing with a local baby-Fleming network

Ah the old - vs _ inconsistency problem again.

I thought we saw the last of that a couple of years back

A last rare one! I will make it an NFT :star_struck:

8 Likes

Nice catch, thanks, it needs to be fixed.

It’s just for that validation of the SafeKey URL matching the SK you provide, so it may not be that useful, only if for some reason you want to have the extra check to confirm the SafeKey URL corresponds to the SK, it’s just that. It may make more sense once we have support for hardware wallets, as discussed in another thread, you specify which key to check the balance for but the SK is obtained from the hardware wallet.

6 Likes

here it is :

#!/bin/sh

GARB=/tmp/garbage
NUMBER=3 # number of files to upload to Safenet
SIZE=1 # size in Mo
PAUSE=1 # pause between each upload in sec
TIMEOUT=$(( $SIZE * 30 )) # 30 sec max / Mo

[ -d $GARB  ] || mkdir $GARB

if [ "$1" = "in" ]
then
	cd $GARB
	COUNTER=1
	rm -f list list.md5
	until [ $COUNTER -gt $NUMBER ]
	do
		dd if=/dev/urandom of=./file bs=${SIZE}M count=1 > /dev/null 2>&1
		CONT=$(safe files put ./file | tail -c61)
		echo "File #${COUNTER} uploaded"
		mv file $CONT
		echo $CONT >> list
		md5sum $CONT >> list.md5
		rm -f $CONT
		sleep $PAUSE
		((COUNTER++))
	done
	exit 0
fi

if [ "$1" = "out" ]
then
	cd $GARB
	COUNTER=0
	for file in $(cat list)
	do
		timeout ${TIMEOUT}s safe cat safe://$file > $file
		md5sum -c list.md5 --ignore-missing
		[ $? -eq 0 ] && ((COUNTER++))
		rm -f $file	
	done
	echo "Success : $(( $COUNTER * 100 / $NUMBER )) %"
	exit 0
fi

echo "$0 [OPTION]"
echo " in : upload to Safenet"
echo " out : download / test from Safenet"
exit 1
5 Likes

Bits of this will get grabbed for safenetwork-community/ dedup-tester

Thanks @Aragorn for doing my bash-scripting homework for me :slight_smile:
Both scripts will be similar, mine however will use “standard candles” so we can get some clues about de-duplication which forms part of the discussion over here

1 Like

I was just looking back at why I noted openssl and not /dev/urandom
it seems perhaps it’s quicker

#1GB =
openssl rand -out sample.txt -base64 $(( 2**30 * 3/4 ))
1 Like

In case it helps, as a reminder, if other data needs to be extracted from the CLI output, we also have the --output <format> arg in CLI (as well as the --json alias), e.g.:

$ safe files put ./README.md --output jsoncompact`
["safe://hyryyryhdiq5t88ek8i8yktghfx1whgegyuwy3jod56g73twqijmgg1n9nynra?v=0",{"./README.md":["+","safe://hy8oyeyx7sn6fffdnpxprtj5knrwzg5kxzn8ws8gx76mi1q74ite3jnwj6o"]}]
2 Likes

I’m getting this …

willie@leonov:~/projects/maidsafe/garbage_dumper$ ./garbage.sh in
File #1 uploaded
./garbage.sh: 26: COUNTER++: not found
File #1 uploaded
./garbage.sh: 26: COUNTER++: not found
File #1 uploaded
./garbage.sh: 26: COUNTER++: not found

I wasnt familiar with that syntax, but “it does work here” :slight_smile:
you can replace by :

let COUNTER++

1 Like

More stupid questions. :crazy_face:

When I have a node running in the new testnet via the CLI, does than mean that I will be able to go to a files URL with the safe browser and view the file?

Yes - once the browser is fixed.

You can always visit the XOR address but it’s not human friendly; so, better to register some domain name against it and visit that.

replace the xor and be sure to retain the suffix of ?v=0
safe nrs create bittog --link safe://hyryyry96dzmggj9icgwr7cptjtqesieemcnogw5p6u9fqqtc95aaxyz1eenra?v=0

then visit to safe://bittog would be possible… in CLI or in browser.

3 Likes

You don’t need to run a node to do this (or to store files etc.) The only reason we can’t do that now it’s that the browser needs updating.

4 Likes

The only stupid question is the one you didn’t ask.

5 Likes