Sorry it took me a while to respond I was a bit busy with school, I think there might be a bug with the SAFE Browser. I think it’s related to this issue [MAID-2321] - JIRA.
listy has been updated with the new filters so there are now less duplicate websites
I updated the UI of Demoy, Chaty, Vidy and Listy to be compatible with a few extra devices so there will be a few websites ready when the safe browser supports more devices, here are few screenshots from my phone.
I am using Chrome remote devices to test the UI. There is no interaction between the SAFE API and android yet.
I’ve noticed that sometimes the content of these sites doesn’t load, so for example the page will load with the title and the upload and refresh buttons but not the individual messages. I’m guessing this is to do with a bug in the authenticator which I know the devs are looking at.
Yea, not too much I can do about it but accessing the website from local host seems to improve it a bit but I am still unable to upload anything (messages, web cards, videos) from the safe browser with my websites
Small update: I plan on updating the code of Vidy, Listy and Chaty to be more readable. Once that is done and Vidy and Demoy are fully working. I plan to release an official thread for Listy as well as Demoy and Chaty (so this topic doesn’t get clogged up or confusing for newbies). If you want a slighty improved version (UI mainly) of listy and chaty you can head to safe://listy.jam and safe://chaty.jam. I plan to continue the polls for projects after all that is done but I don’t have as much time to develop as I did in summer.
Also I made some updates to the SAFE API Rundown so it is easier to read.
I’m trying it now
Chaty and Listy have been uploaded to alpha 2 and the code is much more readable for developers now, take a look at the code here. I am having a small issue uploading NFS files which will delay vidy from being updated but I have a few new ideas for the SAFE API Rundown and will work on that in the meantime.
Here’s an example of what the code looked like before:
function sendMessage() {
window.safeMutableData.newMutation(auth)
.then((mutationHandle) => {
var date = new Date();
var time = date.getTime();
window.safeMutableDataMutation.insert(mutationHandle, time.toString(), textarea.value)
.then(_ =>
window.safeMutableData.applyEntriesMutation(mdHandle, mutationHandle))
.then(_ => {
Materialize.toast('Message has been sent to the network', 3000, 'rounded');
window.safeMutableDataMutation.free(mutationHandle);
getMutableDataHandle("getMessages");
});
textarea.value = "";
});
}
and after
async function sendMessage() {
try {
let time = new Date().getTime().toString();
let chatyHash = await window.safeCrypto.sha3Hash(auth, "chaty");
let chatyHandle = await window.safeMutableData.newPublic(auth, chatyHash, 54321);
let mutationHandle = await window.safeMutableData.newMutation(auth);
await window.safeMutableDataMutation.insert(mutationHandle, time, textarea.value);
await window.safeMutableData.applyEntriesMutation(chatyHandle, mutationHandle);
Materialize.toast('Message has been sent to the network', 3000, 'rounded');
window.safeMutableDataMutation.free(mutationHandle);
window.safeMutableData.free(chatyHandle);
getMessages();
textarea.value = '';
} catch (err) {
console.log(err);
}
}
Hey @Joseph_Meagher do you have any cool working examples that PUT and then GET immutable Data using the DOM API?
@Nigel you can see this working in my remoteStorage apps - all are a bit buggy as apps so I’ve not publicised them yet, but the DOM stuff is working and does create and read Immutable Data , and keeps track of those as entries in the default container Mutable Data.
safe://qw2 is a simple personal wiki. UI is a bit non intuitive, but simple really:
Edit A Note
- click tag symbol (top left corner of note)
- input in markdown
- click save or your edits are discarded
Create A New Note
- input a link of the form [qw](New Note Name)
- save
- click on the link ‘New Note Name’
None of this saves directly to SAFE. Instead it saves to an IndexDB in browser storage, which means it works with our without an Internet connection (ie offline-first functionality).
But once connected to SAFE there is a sync operation every ten seconds - you’ll see lots of activity in the debug console as my code is full of debug logging atm! To connect, click the blue SAFE icon top right.
The app saves and loads files with put/get operations in the Safenetwork object. get on a folder gets a directory listing. These all use the default container and safeNfs to create and read files on SAFE.
I’m going to be offline mostly today, but can help later or tomorrow if you need it.
BTW if you don’t see the SAFE connect icon, or it isn’t doing sync, try reloading the page (that’s one of the bugs ). Overwise this one works pretty well, just a bit lacking in UI.
It isn’t the simplest example to examine but it is easy for you to open the code in the browser debugger and see the SAFE DOM API calls and what they do. Hope it helps.
This hasn’t been tested properly yet but it should give you an idea of the type of functions to write.
async function createImmutable() {
try {
let writerHandle = await window.safeImmutableData.create(auth);
await window.safeImmutableData.write(writerHandle, 'Immutable Data content here (data can also be a buffer).');
let cipherOptHandle = await window.safeCipherOpt.newPlainText(auth);
addressOfImmutableData = await window.safeImmutableData.closeWriter(writerHandle, cipherOptHandle);
await window.safeCipherOpt.free(cipherOptHandle);
} catch (err) {
console.log(err);
}
}
async function getImmutable() {
try {
let readerHandle = await window.safeImmutableData.fetch(auth, addressOfImmutableData);
let data = await window.safeImmutableData.read(readerHandle);
let size = await window.safeImmutableData.size(readerHandle);
console.log(data);
console.log(size);
await window.safeImmutableData.free(readerHandle);
} catch (err) {
console.log(err);
}
}
Thanks for this Joseph you’re effort is a valuable resource.
Update: Chaty and Listy have been updated with a few new features I will be releasing a topic for both of them soon along with a new website I made called Feedy.
The browser still crashes when trying to upload files (see here) so Vidy’s release is being delayed that being said it has already been updated in with the new UI and await/async functions and should be live soon enough after the bug is fixed
I am currently looking for suggestions for the next polls. I currently have
- File Manager with ability to edit and publish websites in browser as well as view files like videos, music, pictures and text-based files.
- Vidy updated to be a bit youtube-like comments, descriptions, thumbnails and search (if it is not too complicated maybe users and subscriptions).
- Chaty updated with markdown support, file sharing and some vidy intergration.
- Email with support for markdown, file sharing and some vidy intergration.
also the way polls are carried out is going to be changed I’ll have more information closer to the time, but that’s all for now.
I think it could make sense to put my own completed projects Chaty, Vidy, Listy and Feedy under a license, as of now they are not under any license which means I hold copyright over them .
I think it is important for there to be some discussion for which license to pick and this will help clarify things for developers who wish to use my code in their projects what they must do and wha t rights they have when they use my projects.
There are many licenses which I was looking at, butI think I’ll be choosing GNU Affero General Public License v3.0 but I am looking for alternative licenses especially if they can be used to better monetise my work from commercial projects and would like to get input from any devs who used or are using my work.
The affero general public license is no point to use since the code is not running on a server. Anyway there’s really only two choices at the moment, the GPL or getting a license agreement with Maidsafe.
All the libraries for using the SAFE network are licensed under the GPL, so when you use them you generally have to use that license also.
If you want to use a different open source license Maidsafe would have to change their license or you have to wait for a third party client to be developed under another license than the GPL.
The GNU Affero General Public License v3.0 says that network use is distrubtion, I think that the SAFE Network would qualify as Network distrubtion which would mean that anyone who can access the website (server or not) has to be given access to the source code as well. That is the main difference between it and GPL V3 anyways.
As far as I know as long as I don’t modify the SAFE App API plugin for SAFE Browser and use it as a library I can choose the the license. But even then the Maidsafe library is not included or used in my project’s source code so I think that means it would qualify as a seperate project even if realisticly the SAFE Browser is needed for my projects to work fully.
Hm yeah, true, I guess for Javascript, since you don’t statically link to the library, you code is a separate project and you can choose the license.
For a native app written in node.js that should also be true, but a native app written in Rust I think would have to statically include the code and thus have to be GPL licensed
Any app using a GPL V3 or AGPL V3 library can choose their own license as long as that library is seperate (no copying its source into your own code) and unmodified.
If you do modify the library you have to make the modified library available(but not any other part of your overall application) if you distribute your own application and the library has GPLv3 or AGPLv3. The same holds if you make available the service provided by your application via a network e.g. as a web application and library has AGPL.
Taken from licensing - AGPL - what you can do and what you can't - Software Engineering Stack Exchange
When it comes to the agpl though, I don’t think it would be any different from GPL. The code will be executed locally, so that means even if it is licensed under GPL, there would need to be access to the source code.
The whole point of agpl is that a lot of web apps etc run lots of GPL licensed code on their server, but since the code itself is not distributed, only the result of running it, the code can be modified without having to follow the GPL. With SAFE you will necessarily distribute the code or binary rather than the results of running the code, at least until distributed computing is implemented. So there is no way to hide GPL licensed code behind a server. The only case would be if someone is using SAFE in the backend of a traditional web app, I suppose that could happen, but that would be something like data libraries that would be used then and not client side SAFE apps.
It is possible with javascript obfuscators and even minifiers to some degreee can accomplish the same thing.
This means that it is possible to hide your source code or copy someone else’s work and claim it as your own.