SAFE Developer Hub (https://hub.safedev.org)


#1

Porting this from the Safenetforum :slightly_smiling_face:.

To support developers MaidSafe has introduced a new site, called the SAFE Developer Hub, available at https://hub.safedev.org. It is the location for information about applications being developed, and provides advice and guidance on the technical framework for the SAFE Network and its APIs. The SAFE Developer Hub enables developers to share ideas and expertise to improve the effectiveness of application development.

The Portal focuses on three key areas:

1.Consolidating information: The site provides information on key aspects of the SAFE Network such as the Authenticator, Vaults and the network flavours of local, mock and testnets.

2.Clearing pathways for developers: The site will soon start out with a bootstrapping guide focusing on four key areas: understanding the SAFE Network; Developing on the platform; Testing applications; and deploying applications.

3.Preferred programming language/platform: Developers can easily access their preferred platform and programming language via icons on the site and link to each of the GitHub repositories for each of the components. There are links to the RFCs (Request for Comments) and information about licensing and the various defensive patents MaidSafe has in place.


#2

Getting stuck with Safe Desktop App Tutorial for nodejs on Debian 9, Node v8.11.1, npm v5.6.0, Safe-browser 0.10.2 mock routing. First off I had to install build-essential and yarn but it now fails for me at $ npm install @maidsafe/safe-node-app --save

ERROR: [Errno 2] No such file or directory: 'run'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @maidsafe/safe-node-app@0.8.1 postinstall: `yarn run install-prod && node install-dev-libs.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @maidsafe/safe-node-app@0.8.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-04-28T11_50_52_927Z-debug.log

Relevant part of the log (I think):

334 verbose pkgid @maidsafe/safe-node-app@0.8.1
335 verbose cwd /home/user/safe_examples/safe_app_electron_quick_start
336 verbose Linux 4.9.0-4-amd64
337 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "@maidsafe/safe-node-app" "--save"
338 verbose node v8.11.1
339 verbose npm  v5.6.0
340 error code ELIFECYCLE
341 error errno 1
342 error @maidsafe/safe-node-app@0.8.1 postinstall: `yarn run install-prod && node install-dev-libs.js`
342 error Exit status 1
343 error Failed at the @maidsafe/safe-node-app@0.8.1 postinstall script.
343 error This is probably not a problem with npm. There is likely additional logging output above.
344 verbose exit [ 1, true ]

Any ideas?


#3

I recall having a similar issue a few months ago. The “ELIFECYCLE” code indicates that it is related to an incompatibility in the versions of Node and npm you are running. IIRC I needed to install specific versions to get everything to jive. I am currently away from my workstation, when I get back I’ll take a look at my setup to see how I got things to work. Maybe someone else will be able to get you the info you need faster… Or perhaps it is a different issue altogether.


#4

I can get the Safe Web App Tutorial to build but I get these errors running it.

. The second error occurs after authorisation.


#5

I am also getting errors. @bochaco suggested trying to run it on the live network for now and is going to troubleshoot with me in depth on Monday.
I got a LOT further when I made sure my npm and node were the latest versions, but still having no luck in actually seeing the the two initial trips hardcoded in the tutorial - or manipulating them in any way.
Been busy with other stuff today, hope to have another crack at it later tonight.


#6

@JPL, the first error can be ignored for now, as per the second one it seems you are facing the same issue as @southside, I cannot reproduce that myself so I suggested him to try it with alpha-2. The app should work in any network, and you seem to be having issues with connecting with the mock network (note that the app won’t be able to work unless it connects successfully to the network). I’ll be available this afternoon (going for lunch now) for doing a HO with both/any of you, please PM and we can troubleshoot it together.

Are you having the same type of problem with the Electron quick start app?


#7

Thanks @bochaco - I’m at work at the moment and on another computer. I’ll try with the live network and Peruse when I have a moment. Cheers

Not sure what that is


#8

Hey @JPL, we just finished a HO session with @southside, and the problem he was having was that he was setting the NODE_ENV=dev var from a console but then running the mock browser from another console, and that’s why he was getting this connection problem. You need to make sure that you run the browser from the exact same console as where you set the env var, you can run it like this as well NODE_ENV=dev ./safe-browser. Please try this and/or let’s go in a HO and we can do it together.

We are trying to have this sorted out in Peruse so you don’t really need to set any env var when running the mock browser as it is very error prone for users as we can see it here, we want to have a switch in the Peruse UI to go back and forth from mock to prod network.


#9

Aha. Yes I was doing that too.


#10

Right, ok, then make sure you run it with the command I shared above from a console within the mock browser folder, it should be ok.

I still have to take a look at the node/npm minimum required versions so other people don’t run into those other issues you and him faced.


#11

I meant the other tutorial, the one for creating a desktop app as opposed to a web app. But first try what we just discussed about the env var, as the same applies to both tutorials.


#12

Oh I see. I didn’t try again after I couldn’t get it to build


#13

oh ok, I’m sorry, that must be the same problem with versions, I think @southside got it right with npm v6.0.


#14

Yes - working now. Thanks @bochaco


#15

@JPL, I installed a fresh Debian 9.4.0, and I didn’t need to install build-essentials or yarn at all for the desktop app tutorial, although I did needed the libgconf-2-4 library, so I just sent a PR (https://github.com/maidsafe/dev_website/pull/21) for the DevHub to mention that any/both of these dependencies might be needed in Debian 9, I hope that helps future users with Debian 9.

Thanks for the help here. Any other things you encounter please let us know so we can keep enhancing the tutorials so users can have a smoother experience with them, this is challenging as we see the different platforms show different problems even with this small projects.


#16

@bochaco the electron app is working for me now in that it builds and starts OK, although I haven’t got it functioning properly yet, no doubt due to some poor copy and paste skills on my part :slight_smile:

The measures I took were updating npm to v6.0.0

npm install -g npm@6.0

And updating yarn which I had previously installed through apt (I think that was where I went wrong). Yarn is now v1.6.0.

sudo npm install --global yarn

I’ll try Fedora next when I have time.


#17

The electron app builds OK in Fedora 27 with after installing yarn as above (no need to update node) but I found I had to run npm install again after updating the safenetwork.js with the authentication functions to get it to authenticate rather than just npm start as it says in the instructions.

Also I have run into an error after adding the async function getItems() code to safenetwork.js as shown here:


Edit - the above problems have cleared up by upgrading to npm 6.0.0 and node 9.11.1


#18

I posted a comment in the other forum discussion about the use of yarn, basically we didn’t put it in the tutorial to avoid an additional dependency, although I’ll try to add a note about it.

The only moment you need to do an npm install is when you do the steps in the Import the SAFE API section of the tutorial, so probably when you did it the first time it failed and you had to do it again. If you are using yarn then whenever you executed it it should have installed the dependencies correctly as long as you made sure you have the NODE_ENV set in the same session/console (in case you didn’t notice it we added some additional comments about this based on your feedback).

The error you shared about not being able to connect seems to me related to maybe not setting the NODE_ENV var, you wouldn’t get to that point when running the app if it was a problem with the npm/node versions.


#19

OK - I’ll try again in a short while. At one stage the build process seemed to be asking for yarn which is why I installed it (on Debian). I did the same on Fedora just to be sure.


#20

Some unusual behaviours (bugs?!) I’ve noticed

https://hub.safedev.org/discover

Tested on Chromium and Firefox (linux)


  • Select text
  • Scroll the page
  • Note the selected text is no longer selected when it should be

  • Search for some text
  • Scroll the page
  • Note that the highlighted search result is no longer highlighted when it should be

  • Scroll to Data Types
  • Click Mutable Data heading
  • Nothing changes when I would expect to see information about mutable data.
  • Click the arrow and see that the information changes (this toggle should be expanded to include the heading)
  • Scroll the page
  • See that the displayed text has returned to ‘Immutable Data > About’
  • Any change to the information displayed is reverted by scrolling when it should stay as it was.

More generally, the information should not be hidden behind toggles and slideshows, it should be shown in sequential order and linkable via url hashes (eg the Web Tutorial > Create a Public Mutable Data > Discover page link should link directly to the mutable data section of the discover page, not to the top of the page with a ponderously long scroll to find the relevant info).


In general the pages look great and are a solid starting point for helping developers. Congratulations on getting it out in the wild :slight_smile: