MaidSafe Dev Update - February 9, 2017

Woo! Now all we need is a network to log in to run it on :slight_smile:

6 Likes

Iā€™m not quite sure, I have to look into it. I thought compiling with use-mock-routing defaults to Alpha 1 although it wouldnā€™t recognize my login, I had to create new account.

@JPL Are you able to create new account?

1 Like

Yes I created a new account and got to this screen. Tried the Demo App but no joy there.

5 Likes

Thanks so much for taking the time to compile this in an easy to install format for us non-tech maid followers!! Appreciate all of the hard work.

I was successfully able to download and started. I created a new account since I wasnā€™t able to log in with my previous credentials. For some reason when I tried the websites I had tried previously, I was not able to open it (e.g. safe://hello ). I may be doing something wrong, but appreciate all of the hard work!

3 Likes

This is good feedback for me. I need to search further into what my bundle is actually connecting to and how exactly itā€™s listening for calls. Iā€™ll update asap.

4 Likes

WHOOOOOOOOAH - i didnā€™t know how awesome those FFI bindings are Oo

i thought it would be more difficult to talk to Safenet via python but you can just use the cffi package and talk directly to the rust code :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished:
:astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished: :astonished:

and current programs written in python can switch as easily to safe that way without the need of writing a special connection module ā€¦ just using the built in C-API Oo

that is so supercool :sunglasses: :heart_eyes:

12 Likes

Current progress on running safe_browser with integrated beaker-plugin-safe-authenticator:

safe_browser is running and in my safe_app_nodejs directory, Iā€™m attempting to run the examples.
Iā€™m running node ./examples/make_auth_request.js
(Iā€™m running on Windows)
This simply opens file explorer.

Diving into the make_auth_request.js,

createSAFEApp(appInfo).then(app =>
	app.auth.genAuthUri(containers).then(res => {
		console.log('trying to open request no ' + res.req_id + ' as ' + res.uri);
		return lib.openUri(res.uri);
	})
);

I follow lib.openUri(res.uri) to an open function in src/windows.rs in the system_uri repo.

This function, as expected, is calling a command to open my file explorer.

Command::new("explorer").arg(uri)

The uri argument is something like safe-auth:AAAAkK380jddk...==

Is file explorer taking that uri and trying to figure out what to do with it?

Iā€™m looking into how to register a protocol, but Iā€™m not quite sure if Iā€™m looking in the right place because it seems to be more about telling Internet Explorer how to handle alternative protocols when I want to know how to register a protocol with file explorer:

Iā€™m digging into this, trying to understand: Installing and Registering Protocol Handlers

Also this: Registering an Application to a URI Scheme

Am I on the right trail?

3 Likes

@hunterlester, looks like you are on the right track. I ll take this as an issue and test this on windows. Can you please confirm the system configuration you use?

3 Likes

The authenticator works with the mock routing feature. It is not possible to connect to any testnet. The safe_client_libs dev branch has the mock routing implementation for new data types. Vaults will have to integrate the new data types and at that point we can connect to the network.

9 Likes

Thank you, Krishna.

System info:
Windows 10 Home
Version: 1607
Build: 14393.693

Running everything in powershell, not WSL.

1 Like

hmhmmm - okay - i have to admit it is not 100% as easy as hoped :smiley: (iā€™m too stupid to create suitable structs for rust - so i hard-coded the application details into the register function of the rust-safe-client :innocent: :smiling_imp:)

but for starters that isnā€™t too bad ā€¦ =) at least i am using a function written in a different programming language (with one import and one ā€œsingleā€ command after that) :smiley:
iā€™m very keen to see those ffi bindings in action!

9 Likes

Is there a way to test against the Authenticator as a standalone with out the beaker Browser? For an app that is not web based.

2 Likes

Yes.

There is a RUST API. There is example under safe-client.

or if you take a look at the safe-git. That is written in C++.

3 Likes

@anon81773980 Okay so no Rust coding is needed? And to be clear this is using Authenticator as a stand alone and not the launcher? Iā€™ll look into this

2 Likes

From what Iā€™m understanding, you can build authenticator through different programming languages other than rust. Maidsafe talked about FFI. Rust is in a unique place where any dynamic language can build with Rust. See here.

Again, there is a ā€œemail CLI clientā€ which uses rust API authenticator as stand alone. it request the network, approves it, then you can send mail. (I might be wrong here, but based on what I read, it looks right)

https://github.com/maidsafe/safe_client_libs/blob/master/examples/email.rs#L36

1 Like

@anon81773980 Yeah but is self auth using Authenticator? There is no Authenticator crate in maidsafes repo, only the beaker plugin. Which is why I ask if there is something stand alone from the Safe Browser as what is being developed will not be a web app

1 Like

I was in same boat as you. I was completely confused on how it works. I done some studying, and found out there is a Authenticate crate. Safe_Core Actually, they change the name to safe_client_libs

There ā€œwasā€ a stand alone but it was kinda messy so it is moved to browser to reduce overlapping annoyance. Having switch to different window for every time one approves an app. See here.

See that (safecore)? Thatā€™s is calling from Rust safe_client_libs

Safe_launcher is GUI format.
safe_client_libs is CLI format.

Hereā€™s another. It is drawing from this particular crate, safe_core

https://github.com/maidsafe/beaker-plugin-safe-authenticator/blob/master/src/ffi/ffi_loader.js#L32

As you see, safe_client_libs is a powerhouse to call the network. So yes, there is Authenticator crate. You can draw it with any language as long you build a script that points to the safe_client_libs

There are three official Authenticator.

safe_client_libs
Safe-launcher
beaker-plugin-safe-authenticator (bpsa for ancroym)

There are two unofficial Authenticator

Safe-js
safe-git

If you want to build a stand alone client using Python, or Vulken to draw GUI for something like a multiplayer game. You need to build it yourself, and call it to safe_client_libs The key here is in ffi folder.

Hope that clarify your confusion.

8 Likes

@anon81773980 Thank you very much! This is good info :vulcan:

4 Likes

Thereā€™s also an example simulate_browser.rs that compiled easily enough
but at least for this blind monkey, falls down at ln307
let unregistered_client = Arc::new(Mutex::new(unwrap!(Client::create_unregistered_client())));

I donā€™t know, if you might have more sense and better luck with itā€¦ if it can work, it could be recrafted easily to something more useful than just an example?

https://github.com/maidsafe/safe_client_libs/blob/master/examples/simulate_browser.rs

Incidentally, the Cargo.toml to get that compiled I used:

[dependencies]
rustc-serialize = "0.3.18"
base64 = "0.2.1"
"url" = "0.5.9"
request = "0.0.8"
getopts = "*"
maidsafe_utilities = "~0.10.0"
safe_core = { git = "https://github.com/maidsafe/safe_client_libs" }
routing = { git = "https://github.com/maidsafe/routing" }
rust_sodium = "~0.1.2"
unwrap = "~1.1.0"
regex = "~0.1.77"
1 Like

K I forgot to look in different branch other than master. I just found there is a more concrete system beneath. Waiting to be revealed.

https://github.com/maidsafe/safe_client_libs/tree/dev/safe_authenticator

Edited: Heh. I forgot to check safedev forums.

6 Likes