Communication via Safe Network

At the moment, the network cannot be used for communicating within the network.

If you want to share a file for example, you have to publish or send the link to the file via some other means, like this forum, email, or internet in general. Same thing if you want to send money to someone.

I would like to have a way to share and communicate within Safe Network, without the aid of other routes for communication.

Can we make that happen? How? Below are some thoughts from @happybeing as a response to my questions.

Related topics:

Messaging layer for SAFE and beyond?

6 Likes

It may be impossible.
There should be some “entry point”, which allows to explore more network links.

If two persons shared their register addresses via external channels, then they can download fresh register versions from time to time and exchange information this way.

2 Likes

So I got the local testnet up and running along with the example register app, but as far as I can tell, it is not working as intended. The description states that:

You can run the registers example client app from multiple consoles simultaneously, to write to the same Register on the network, identified by its nickname and using different user names from each instance launched

but they seem to have their own copies instead, each writing to their own register - maybe I’m doing something wrong or it isn’t working yet? :person_shrugging:

3 Likes

cargo run … provides a rather different UI than accessing the registers from the binary

safe@CloserNetClient:~$ safe register get -n NewPublicRegister 
Logging to directory: "/home/safe/.local/share/safe/client/logs/log_2023-12-17_02-19-04"
Built with git version: 7aa944e / main / 7aa944e
Instantiating a SAFE client...
Trying to fetch the bootstrap peers from https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts
Connecting to the network with 98 peers:
đź”— Connected to the Network                                                                                                                                       Trying to retrieve Register 'NewPublicRegister' at b9513a(770ffa(01110111)..)
Successfully retrieved Register 'NewPublicRegister' at b9513a(770ffa(01110111)..)
Register entries:
d495e6..: second!
safe@CloserNetClient:~$ safe register edit -n NewPublicRegister "thats three now!"
Logging to directory: "/home/safe/.local/share/safe/client/logs/log_2023-12-17_02-20-47"
Built with git version: 7aa944e / main / 7aa944e
Instantiating a SAFE client...
Trying to fetch the bootstrap peers from https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts
Connecting to the network with 98 peers:
đź”— Connected to the Network                                                                                                                                       Trying to retrieve Register from b9513a(770ffa(01110111)..)
Successfully retrieved Register 'NewPublicRegister' at b9513a(770ffa(01110111)..)
Editing Register 'NewPublicRegister' at b9513a(770ffa(01110111)..) with: thats three now!
safe@CloserNetClient:~$ safe register get -n NewPublicRegister 
Logging to directory: "/home/safe/.local/share/safe/client/logs/log_2023-12-17_02-21-12"
Built with git version: 7aa944e / main / 7aa944e
Instantiating a SAFE client...
Trying to fetch the bootstrap peers from https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts
Connecting to the network with 98 peers:
đź”— Connected to the Network                                                                                                                                       Trying to retrieve Register 'NewPublicRegister' at b9513a(770ffa(01110111)..)
Successfully retrieved Register 'NewPublicRegister' at b9513a(770ffa(01110111)..)
Register entries:
7d5e27..: thats three now!
safe@CloserNetClient:~$ safe register get b9513a(770ffa(01110111)..)
-bash: syntax error near unexpected token `('

I am failing at specifying a register by address
when I try to access NewPublicRegister by name from another instance it predictably fails cos the public keys dont match

safe@CloserNet01:~$ safe register get -n NewPublicRegister
Logging to directory: "/home/safe/.local/share/safe/client/logs/log_2023-12-17_02-50-38"
Built with git version: 7aa944e / main / 7aa944e
Instantiating a SAFE client...
Trying to fetch the bootstrap peers from https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts
Connecting to the network with 98 peers:
đź”— Connected to the Network                                                                                                                                       Trying to retrieve Register 'NewPublicRegister' at b9513a(e8ef67(11101000)..)
Did not retrieve Register 'NewPublicRegister' at b9513a(e8ef67(11101000)..) from all nodes in the close group! Protocol error Register not found: b9513a(e8ef67(11101000)..).
Error: 
   0: Protocol error Register not found: b9513a(e8ef67(11101000)..).
   1: Register not found: b9513a(e8ef67(11101000)..)

Location:
   /rustc/a28077b28a02b92985b3a3faecf92813155f1ea1/library/core/src/convert/mod.rs:716

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Im looking at gossipsub but so far I cannot see published messages from another instance.

2 Likes

Full address was printed when you created register.
Since now we have logs for every command execution, you can find corresponding file and address for your register should be there.

safe register get b2ca21f75c6ecf090012f0fed5c2b67a6a254c4c7cac2906120b34b146433a258cedd286b7570ef14aaffd417a3759030a60079b9291c8dc0f0009c96337c9c17261d65cc258e07541d34a2b855e027c

5 Likes

cargo run above was running a different binary, an example app that is supposed to showcase how two users can share a register (this one)

I think the issue is that the second user for some reason doesn’t find the existing Register and instead creates another one with the same name. Both users output this println!

Retrieving Register 'myregister' from SAFE, as user 'alice'
Register 'myregister' not found, creating it at 50f4c9(ebf6eb(11101011)..)
Retrieving Register 'myregister' from SAFE, as user 'bob'
Register 'myregister' not found, creating it at 50f4c9(31bd17(00110001)..)

2 Likes

Yes this was my problem, they are not looking for the same thing

50f4c9(ebf6eb(11101011)…) != 50f4c9(31bd17(00110001)…)

Hence my Q above about how to represent the original register as straight hex.
see @Vort above Communication via Safe Network - #5 by Vort

A quick grep for “register” through all my client logs does not show any hex strings as such - just many instances of b9513a(770ffa(01110111)..)

Which so far I have failed to put in a command line - possibly after more coffee…

Have you poked at gossipsub yet?

2 Likes

Just created a new register but I don’t see anything immediately shareable like a hex string as @Vort had…

safe@CloserNetClient:~/safehome/client/logs$ safe register create -n "The Comms Faffing Blog"
Logging to directory: "/home/safe/.local/share/safe/client/logs/log_2023-12-17_16-17-55"
Built with git version: 7aa944e / main / 7aa944e
Instantiating a SAFE client...
Trying to fetch the bootstrap peers from https://sn-testnet.s3.eu-west-2.amazonaws.com/network-contacts
Connecting to the network with 98 peers:
đź”— Connected to the Network                                                                                                                                       Successfully made payment of 0.000001140 for a Register (At a cost per record of NanoTokens(1140).)
Successfully stored wallet with cached payment proofs, and new balance 199.928375714.
Successfully created register 'The Comms Faffing Blog' at 9b2bd5(5d2405(01011101)..) for NanoTokens(969) (royalties fees: NanoTokens(171))!

Gotcha, we’re on the same page. I’m very new to all this code, have not poked at gossipsub yet, don’t know much about it to be honest. I did notice that the example app creates a client with disabled gossibhub - not sure what that means though:

2 Likes

Maybe gossiphub is just scaffolding for now and we can expect more functionality later?

I could create a topic and (allegedly) publish on that but any client wanting to subscribe just hung there. It needs some work on the UI but its fun trying to work around these limitations.

WARNING WARNING - Boring nostalgia ahead

About 2015-16 when all was VERY new and in C++, I participated in the first (communtiy) exchange of messages over the SAFE with a couple of folk whose names I forget - one from Chicago , one from S Carolina, perhaps. We were able to insert text nto the payload of packets we managed to share.
It was like a very crude version of IRC. Wish I had taken care of the screenshots…

Still I am very motivated to get some kind of chat feature working.

1 Like

I have this in my logs for the last register create/edit commands

./log_2023-12-17_02-20-47/safe.log:1187:[2023-12-17T02:20:48.521973Z DEBUG sn_client::register] Publishing Register cmd: RegisterAddress(b9513a) { meta: b9513a(10111001).., owner: PublicKey(0235..3e8c) }
./log_2023-12-17_02-20-47/safe.log:2118:[2023-12-17T02:20:50.546047Z DEBUG sn_client::register] Successfully pushed 1 Register cmds at b9513a(770ffa(01110111)..)!
./log_2023-12-17_02-22-54/safe.log:1:[2023-12-17T02:22:54.330848Z INFO safe] "safe register get b9513a(770ffa(01110111)..)"
./log_2023-12-17_02-22-54/safe.log:461:[2023-12-17T02:22:54.986934Z DEBUG safe::subcommands::register] Parsing address as hex
./log_2023-12-17_16-23-41/safe.log:1:[2023-12-17T16:23:41.830864Z INFO safe] "safe register edit -n The Comms Faffing Blog A Tale of Strange Folk trying to talk in a strange set of protocols"
./log_2023-12-17_16-23-41/safe.log:465:[2023-12-17T16:23:42.547574Z DEBUG safe::subcommands::register] Parsing address as name
./log_2023-12-17_16-23-41/safe.log:467:[2023-12-17T16:23:42.547779Z DEBUG sn_client::register] Retrieving Register from: 9b2bd5(5d2405(01011101)..)
./log_2023-12-17_16-23-41/safe.log:1262:[2023-12-17T16:23:43.232261Z DEBUG sn_client::register] Pushing 1 cached Register cmds at 9b2bd5(5d2405(01011101)..)!
./log_2023-12-17_16-23-41/safe.log:1264:[2023-12-17T16:23:43.233224Z DEBUG sn_client::register] Querying existing Register for cmd: RegisterAddress(9b2bd5) { meta: 9b2bd5(10011011).., owner: PublicKey(0235..3e8c) }
./log_2023-12-17_16-23-41/safe.log:1423:[2023-12-17T16:23:43.419517Z DEBUG sn_client::register] Publishing Register cmd: RegisterAddress(9b2bd5) { meta: 9b2bd5(10011011).., owner: PublicKey(0235..3e8c) }

Scroll sideyways to reveal a lack of hex strings - @Vort can you help?

Different version maybe?
I was using safe-0.86.57-x86_64-pc-windows-msvc.zip and this is what I see in logs:

1 Like

Hmm I have this from safeup on Ubuntu

safe@CloserNetClient:~/safehome/client/logs$ safe -V
sn_cli 0.86.67
1 Like

Looks like log output was cleaned up and the whole id (64byte) truncated for easier reading. In this case that is wrong and it should be printed out clearly for you to read.

Bug bug !!

2 Likes

Yep we need to cut’n paste until we get a GUI and this is all hidden safely away.

/me stops peering at logs
cos
Peer PeerId("12D3KooWDXYrPpUsbGAFTuP8pNHH8AtR2agRJjf6UwwQ9jbE7Gqq") has a Some(255) distance to us
was getting boring.

I’ll try again in a day or two when that gets sorted.

OK - lets see how far we can push gossipsub now…

1 Like

@trycatch
Can you share the exact command line you used to in Communication via Safe Network - #3 by trycatch please?

1 Like

issue Register logging does not show the whole 64byte id · Issue #1087 · maidsafe/safe_network · GitHub submitted.

An old email server got turned off. Unfortunately my Github account was linked to it so I cannot get 2FA mails there so this is a new GitHub account. Hopefully only temporary…

I am running local testnet with local-discovery feature like this:

killall safenode || true && RUST_LOG=safenode,safe cargo run --bin testnet --features local-discovery -- --build-node --build-faucet --interval 100 --clean

Setting up the wallet:

cargo run --release --bin safe --features local-discovery wallet get-faucet http://localhost:8000

Followed buy running two copies of the example app, each in their own terminal:

cargo run --release --example registers --features local-discovery -- --user alice --reg-nickname myregister

and

cargo run --release --example registers --features local-discovery -- --user bob --reg-nickname myregister

5 Likes

Created a PR to fix this (to enable printing out and logging of the entire RegisterAddress)

Also noticed that the example registers app was creating a register writable only by the owner, so included a small fix to create a publicly writable one so that both alice and bob can write to it. But there is another issue hiding somewhere and the example still doesn’t work.

7 Likes

Good job!

I made a first use of your PR here:

2 Likes