Safe In A Box - run a private local version of the safe network

Safe In A Box is a project that runs a standalone private safe network on a virtual machine. It uses docker to contain the vaults, and the network can be configured in quite a few interesting ways.

This is a smaller part of a much bigger project and is probably most useful as a ‘chop and change’ type script for the technically inclined. I wanted to put it out there in case anyone finds it useful (I know I do).

As an example, here’s some results of uploading a 7MB file with different group and quorum sizes. Not especially useful itself but indicates some of the capabilities of the Safe In A Box tool:

Vaults   Group Size   Quorum Size   Time (s)
6        3            2             161
10       8            5             867

Read more about it in the readme.

26 Likes

That’s brilliant and will save me a lot of time. I had been putting together something similar but will use this if it works and maybe submit patches.

4 Likes

Alwaxs awesome to see your contributions!

1 Like

The project is bigger than mine and I can see chunks to borrow and adapt, particularly the routing once I get my head around it.

@bluebird & @mav

How hard would it be to setup a config file and startup a “private” SAFE network using the following.

I have just received yesterday my 12 additional C.H.I.P. SBCs and I can set one as a AP and the others network to it on their own private network.

The binaries already work on them and my test Pocket CHIP which I already had is still going after 3 days on the test system. And I see no reason why multiple vaults could not run on each CHIP. At this time my launcher etc would have to run on a linux/windows X86 machine networked to that private network

I am just wondering at this stage and may or may not try it depending on time.

1 Like

This is exactly what I’m using this for in the future. I have 10 pine64 boards on the way, and want an easy way to run a private safe network on them.

As you identify, the key is in the config.

Safe In A Box autogenerates the config on L691-L707, but manually adjusting the one supplied in the maidsafe testnet files will also work.


Should add that my main tool for managing the pines will be saltstack, and will not be using docker or the SIAB script. SIAB was mainly created to establish what is required to achieve a private safe network.

2 Likes

Do I just need to change these values?

  • “hard_coded_contacts”
  • “network_name”
  • “max_capacity” If I want
  • “chunk_store_root” to allow multiple vaults in the one CHIP

I have some PINEs that supposedly arrived but lost and trying to sort that out now.

Yes to hard_coded_contacts and network_name

Yes to max_capacity but you will need to recompile the vault binary (see the install_safe_vault function)

Not sure about chunk_store_root, but sounds right.

I’ve not yet familiarized myself with how the vault utilizes multiple cores, and thus whether there’s a need to run multiple vaults per device to get maximum benefit from the cpu.

This I didn’t expect. Hopefully this is fixed in the next couple of releases. Woudl be good for people to be able to just change the value if they want a larger/smaller vault.

Anyhow 1/2GB allows me 5-6 vaults per CHIP without needed a memory stick.

The CHIP is a single CPU core device.

The reason for running multiple vaults is because 12-15 nodes isn’t enough for a network I gather. Having 6 vaults would mean upto 90 nodes just from the CHIPs I have

It would also test if a CHIP could even handle 5 or 6 vaults

Imagine IoT devices doing real senor reading/control work yet have a vault or 2 running in the background. The IoT devices pay for themselves while doing their real work for no cost.

Yeah you’re right. I was thinking of DEFAULT_ACCOUNT_SIZE… you don’t need to recompile for max_capacity.


I recompile my vaults using custom routing parameters for group_size and quorum_size for this reason. The minimum group_size you can get away with is 3 and the minimum quorum_size is 2. With this, you can get away with a network of just 4 vaults (maybe 3?). Managing the complexity of adjusting these parameters is a big part of why I created SIAB.

3 Likes