Baby Dev Questions


#81

@hunterlester ^^ ?

Blah!


#82

Hi Joseph,

Please excuse the delayed reply.

Thank you for raising this issue.

It appears that we don’t have that convenient functionality, unless the following functions are able to operate on whole directories and not just single files:

http://docs.maidsafe.net/beaker-plugin-safe-app/#windowsafenfsinsert
http://docs.maidsafe.net/beaker-plugin-safe-app/#windowsafenfsfetch

I’m going to experiment with the code, ask our team, and come back with either a concrete code example or an explanation.

I’m starting my search for answers here: https://github.com/maidsafe/safe_examples/blob/dev/web_hosting_manager/app/lib/tasks.js#L45

It appears that we should be able to get the container to which the file or directory belong, and then fetch the directory using the path as the key.

That’s where I’m starting, I’ll get back to you with more.


#83

Hey @hunterlester any news? :slight_smile:

EDIT: Or @bochaco? See above


#84

Hi Joseph,

I’ve been running NFS tests to clarify how everything works.

This is a quick note to let you know that I will post a detailed technical response tomorrow. The delay is my own fault and I’m thinking about a system to stay on top of these support questions that I take responsibility for, especially when days are particularly busy.

In summary, all files for a particular service are stored as entries in a MutableData structure. If a file belongs to a directory, it’s specified in the entry’s key.

Example mutable data entries:
Format: <key>:<value>

"index.html": <hashed file meta data>
"favicon.ico": <hashed file meta data>
"js/scripts.js": <hashed file meta data>
"js/deps.js": <hashed file meta data>
"js/dependencies/jquery.min.js": <hashed file meta data>
"css/styles.css": <hashed file meta data>
"css/bootstrap.min.css": <hashed file meta data>
"css/fonts/font.ttf": <hashed file meta data>

I was converting keys to string values and then using regular expressions to just retrieve those values whose keys begin with the desired directory.

Does this make sense?

More tomorrow…


#85

Follow-up from yesterday.

Looking at your original post, you are asking if there exist convenient functions for creating a service, creating a public ID, and for getting a directory, like the old DNS and NFS api functions.

They don’t exist in the new api’s although the web hosting manager application is meant to provide that higher level convenience.

I was going to write out a long post about how I technically perform all of these operations, which I can still do if you like, however, I happen to be making a video that walks through all of these operations and explains SAFE DNS conventions.

I hope to get the video approved and released this Thursday with the dev update.


#86

Both sound excellent, but I think the blog post is primary: more easily used and referred to, while the video helps those who find it hard to follow on its own or to get started quickly.

Ideally though I think we’ll need a helper library if these functions are not part of the API. Can you check if there are any plans for that, because if not it makes sense for the community to jump in.

Thanks Hunter, this is very helpful


#87