Node disk configuration

Hello,

after succesfully compiling the api and node on the raspberri pi4, I’m the happy owner of a raspberry pi safe node. ( offline now, waiting for v4 )

The pi4 here has limited disk space : 32 Go as a sd card. My /home is on the sdcard.

My understanding is that the node files are stored in ~/.safe , so the node ends up with what is left on the sd card. ( cargo eats a lot of space for compilation, btw )

So, my question is : how would I specify a directory on an exernal drive ? I have a 500 gb usb3 disk that can stay mounted, but I don’t find a config file to specify where the node files go.
Or maybe simply tricking with a symlink ?

Thank you !

If you run sn_node directly, you can specify --root-dir parameter.
Do not know if it possible to do so with safe command.

We yet don’t have flags exposed in CLI so this can be achieved easily, moving all storage to a different place, using the components individually it’s possible I think but tedious at the moment I’d say.

I think your best option for now is to just mount your 500 gb usb3 disk on ~/.safe location ?

That sounds easy and effective

Hi @nice

I had a similar issue with my ubuntu VM. A symlink worked fine if you’d rather do that than hard mount the filesystem onto ~/.safe. In my case, I wanted the additional space to be available to other users, so it worked better to create a directory on the external disk and link to it than hard mount.

hi @futuretrack ! thank you for the input.
I like it , indeed, as it would permit to leave other parts of the dd available for other stuff.
I suppose that will be the solution for me.

my start scripts looks like this:

  • 10MiB max capacity
  • the bootstrap node list might (will?) need an update to work with the next test net
  • only log level info (debug is the default if started from the safe executable, right?)
  • logs to stdout instead of a file (you could dump it into a file by adding >> node_logs to the command or calling the start script with it)
#!/usr/bin/env bash

RUST_LOG=info ./sn_node --root-dir /data-fast/sn_node --max-capacity 10485760 -h '["138.68.130.204:50087","138.68.135.139:49440","138.68.146.170:32859","138.68.167.124:43149","138.68.180.216:49021","138.68.182.161:34595","139.59.162.138:52910","139.59.177.49:42192","139.59.184.250:50196","165.227.224.102:34793","165.227.224.69:34758","165.227.225.237:60110","165.227.226.230:33552","165.227.229.100:49408","165.227.229.103:59359","165.227.229.104:33663","165.227.229.129:57822","165.227.229.131:53334","165.227.229.142:60960","165.227.229.148:47735","165.227.229.150:33874","165.227.229.33:12000","165.227.229.55:32936","165.227.229.57:45221","165.227.229.59:47925","165.227.229.70:48326","165.227.229.71:54735","165.227.229.96:46868","165.227.232.158:50965","178.62.10.198:51741","178.62.122.173:58245","178.62.32.210:39347","178.62.74.247:51223","188.166.172.140:37214","188.166.174.88:54107","188.166.175.92:33968","46.101.17.63:46664","46.101.61.67:59088","46.101.72.129:37483"]'

Small tip: instead of passing this long list of socket addresses you could use:

-h $(tr -d ' \t\n' < ~/.safe/node/node_connection_info.config)

where .safe/node/node_connection_info.config is the file downloaded from https://sn-node.s3.eu-west-2.amazonaws.com/config/node_connection_info.config and normally used by clients.

EDIT: Corrected tr command:

  • can be launched from anywhere, not just the home directory
  • filter out spaces and tabs in addition to \n

I just found out this possibility:

--max-capacity $(numfmt --from auto 10Mi)

It is longer but clearer and less error prone. This is even more obvious with bigger sizes:

$ numfmt --from auto 2G
2000000000

Who can check visually that the number of digits is right? In any case not me!

In Rust we can use 2_000_000_000 syntax to make it readable, but we cannot use it as a program argument.

I just noticed that the Gnome terminal can help. Highlighting a number and right-clicking shows you a calculation.