Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Swarm integration (#2579)
Browse files Browse the repository at this point in the history
* Enable Swarm protocol

* Initial implementation of the Swarm class

* Open Swarm process on startup; download binary if unavailable

* Swarm upload on menu

* Allow upload of directories and DApps

* Add missing translations

* Corrected field name

* Improve Swarm startup, account generation and node download

* Remove outdated comments

* Code style fixes

* Use private key instead of keystore account

* Download Swarm correctly on Windows/Linux

* Move Swarm Upload to develop menu

* Some minor fixes and it works Windows

* Fix path crash issue

* Fix null error message

* moved to separate swarm menu

* Package updates

* Changes on wording

* Opening browser tab after swarm upload

* Assigning Cmd+Shift+U to swarm upload feature

* Removing unnecessary variables and cleaning up code

* Cleaning up code

* move swarm menu into accounts, rename it into file menu

* fix corrupt yarn.lock file

* fixes batch requests on isolated preloaders

* Update Swarm.js

* Swarm auto-updates to synch with clientBinaries.json

* Updating swarm binaries

* Swarm api changes
  • Loading branch information
VictorTaelin authored and evertonfraga committed Jul 13, 2017
1 parent 4c30e28 commit 65a9fb3
Show file tree
Hide file tree
Showing 26 changed files with 347 additions and 4,592 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ nodes/geth/
config.json
mist.log
npm-debug.log
yarn.lock
/yarn.lock
69 changes: 69 additions & 0 deletions clientBinaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,74 @@
}
}
}
},
"swarm": {
"archives": {
"windows-amd64": {
"archive": "swarm-windows-amd64-1.6.7.exe",
"binaryMD5": "c2d827dc4553d9b91a7d6c1d5a6140fd",
"archiveMD5": "059196d21548060a18a12e17cc0ee59a"
},
"linux-amd64": {
"archive": "swarm-linux-amd64-1.6.7",
"binaryMD5": "85002d79b8ebc2d2f2f10fb198636a81",
"archiveMD5": "3e8874299ab8c0e3043d70ebb6673879"
},
"linux-386": {
"archive": "swarm-linux-386-1.6.7",
"binaryMD5": "35bc2ab976f60f96a2cede117e0df19d",
"archiveMD5": "7868a86c9cbdf8ac7ac2e5682b4ce40f"
},
"darwin-amd64": {
"archive": "swarm-darwin-amd64-1.6.7",
"binaryMD5": "c499b186645229260dd6ab685dd58f07",
"archiveMD5": "0794d111e5018eac3b657bcb29851121"
},
"linux-arm5": {
"archive": "swarm-linux-arm5-1.6.7",
"binaryMD5": "516fcd85246c905529442cd9b689c12f",
"archiveMD5": "47312708d417cb196b07ba0af1d3abb4"
},
"linux-arm6": {
"archive": "swarm-linux-arm6-1.6.7",
"binaryMD5": "82ff7bdbe388b4a190f4101c5150d3b4",
"archiveMD5": "350276de7bb175a15c314cfc4cb7f8fd"
},
"linux-mips": {
"archive": "swarm-linux-mips-1.6.7",
"binaryMD5": "e1e95280441c0ca35633927792ef5317",
"archiveMD5": "8fb4b64e94cd73aa718db787b9d4c53e"
},
"linux-arm7": {
"archive": "swarm-linux-arm7-1.6.7",
"binaryMD5": "bfc0b4d1c86d8a975af052fc7854bdd3",
"archiveMD5": "4378641d8e1e1fbb947f941c8fca8613"
},
"linux-arm64": {
"archive": "swarm-linux-arm64-1.6.7",
"binaryMD5": "bbac21a6c6fa8208f67ca4123d3f948a",
"archiveMD5": "4e503160327c5fbcca0414f17c54e5ee"
},
"linux-mipsle": {
"archive": "swarm-linux-mipsle-1.6.7",
"binaryMD5": "a82f191b2f9d2c470d0273219c820657",
"archiveMD5": "3016bdb6d237ae654c0cdf36fe85dc7c"
},
"windows-386": {
"archive": "swarm-windows-386-1.6.7.exe",
"binaryMD5": "ce0b34640642e58068ae5a359faef102",
"archiveMD5": "640aede4da08a3a9d8a6ac0434ba7c0f"
},
"linux-mips64": {
"archive": "swarm-linux-mips64-1.6.7",
"binaryMD5": "9da967664f384817adb5083fd1ffe8f1",
"archiveMD5": "357a33be470f8f89ba2619957a08deff"
},
"linux-mips64le": {
"archive": "swarm-linux-mips64le-1.6.7",
"binaryMD5": "ec1abcf7b216e87645ec83954d8344cd",
"archiveMD5": "a81fd0158190d99813c738ffa4f87627"
}
}
}
}
6 changes: 5 additions & 1 deletion interface/client/lib/helpers/helperFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ Format Urls, e.g add a default protocol if on is missing.
**/
Helpers.formatUrl = function (url) {
// add http:// if no protocol is present
if (url && url.indexOf('://') === -1) {
if (url && url.length === 64 && !!url.match(/^[0-9a-f]+$/)) {
// if the url looks like a hash, add bzz
url = 'bzz://' + url;
} else if (url && url.indexOf('://') === -1) {
// if it doesn't have a protocol
url = 'http://' + url;
}

Expand Down
20 changes: 20 additions & 0 deletions interface/client/templates/popupWindows/splashScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,26 @@ Template['popupWindows_splashScreen'].onCreated(function () {
}
});

ipc.on('uiAction_swarmStatus', function (e, status, data) {
switch (status) {
case 'starting':
TemplateVar.set(template, 'text', 'Starting Swarm');
TempalteVar.set(template, 'showProgressBar', false);
break;

case 'downloadProgress':
TemplateVar.set(template, 'text', `Downloading Swarm binary: ${(data * 100).toFixed(0)}%`);
TempalteVar.set(template, 'showProgressBar', true);
TempalteVar.set(template, 'progress', data * 100);
break;

case 'started':
TemplateVar.set(template, 'text', 'Started Swarm');
TempalteVar.set(template, 'showProgressBar', false);
break;
}
});

ipc.on('uiAction_nodeSyncStatus', function (e, status, data) {
console.trace('Node sync status', status, data);

Expand Down
3 changes: 2 additions & 1 deletion interface/i18n/mist.de.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "Vollbildmodus",
"default": "Standard"
},
"accounts": {
"file": {
"label": "Konten",
"importPresale": "Konto importieren",
"newAccount": "Neues Konto",
Expand All @@ -35,6 +35,7 @@
"backupMist": "Anwendungsdaten"
},
"develop": {
"uploadToSwarm": "Upload zum Swarm",
"label": "Entwicklung",
"devTools": "Entwicklerwerkzeuge",
"devToolsMistUI": "Mist UI",
Expand Down
19 changes: 10 additions & 9 deletions interface/i18n/mist.en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@
"showAll": "Show all",
"quit": "Quit __app__"
},
"file": {
"label": "File",
"importPresale": "Import accounts",
"newAccount": "New account",
"backup": "Backup",
"backupKeyStore": "Accounts",
"backupMist": "Application data",
"swarmUpload": "Upload to Swarm..."
},
"edit": {
"label": "Edit",
"undo": "Undo",
Expand All @@ -24,7 +33,7 @@
"view": {
"label": "View",
"fullscreen": "Toggle full screen",
"languages": "Change language",
"languages": "Language",
"default": "Default",
"langCodes" : {
"de": "Deutsch",
Expand All @@ -44,14 +53,6 @@
"zh-TW": "國語"
}
},
"accounts": {
"label": "Accounts",
"importPresale": "Import accounts",
"newAccount": "New account",
"backup": "Backup",
"backupKeyStore": "Accounts",
"backupMist": "Application data"
},
"develop": {
"label": "Develop",
"devTools": "Toggle developer tools",
Expand Down
7 changes: 4 additions & 3 deletions interface/i18n/mist.es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
"fullscreen": "Pantalla Completa",
"default": "Default"
},
"accounts": {
"label": "Cuentas",
"file": {
"label": "Arquivo",
"importPresale": "Importar Cuentas",
"newAccount": "Nueva cuenta",
"backup": "Copia de seguridad",
"backupKeyStore": "Cuentas",
"backupMist": "Datos de la aplicación"
},
"develop": {
"uploadToSwarm": "Upload a Swarm",
"label": "Desarrollo",
"devTools": "Herramientas para desarrolladores",
"devToolsMistUI": "UI de Mist",
Expand Down Expand Up @@ -277,4 +278,4 @@
"bytes": "Bytes"
}
}
}
}
5 changes: 3 additions & 2 deletions interface/i18n/mist.fa.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "Toggle Fullscreen",
"default": "Default"
},
"accounts": {
"file": {
"label": "Accounts",
"importPresale": "Import Accounts",
"newAccount": "New account",
Expand All @@ -35,6 +35,7 @@
"backupMist": "Application Data"
},
"develop": {
"uploadToSwarm": "Upload to Swarm",
"label": "Develop",
"devTools": "Toggle Developer Tools",
"devToolsMistUI": "Mist UI",
Expand Down Expand Up @@ -277,4 +278,4 @@
"bytes": "Bytes"
}
}
}
}
7 changes: 4 additions & 3 deletions interface/i18n/mist.fr.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
"fullscreen": "Basculer en mode plein écran",
"default": "Default"
},
"accounts": {
"label": "Comptes",
"file": {
"label": "Fichier",
"importPresale": "Importer les comptes",
"newAccount": "Nouveau compte",
"backup": "Sauvegarder",
"backupKeyStore": "Comptes",
"backupMist": "Données de l'application"
},
"develop": {
"uploadToSwarm": "Télécharger à Swarm",
"label": "Développement",
"devTools": "Outils de développement",
"devToolsMistUI": "Mist UI",
Expand Down Expand Up @@ -277,4 +278,4 @@
"bytes": "Bytes"
}
}
}
}
5 changes: 3 additions & 2 deletions interface/i18n/mist.it.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "Schermo intero",
"default": "Default"
},
"accounts": {
"file": {
"label": "Accounts",
"importPresale": "Importa Accounts",
"newAccount": "Nuovo account",
Expand All @@ -35,6 +35,7 @@
"backupMist": "Dati applicativi"
},
"develop": {
"uploadToSwarm": "Carica a Swarm",
"label": "Sviluppo",
"devTools": "Strumenti di sviluppo",
"devToolsMistUI": "Mist UI",
Expand Down Expand Up @@ -277,4 +278,4 @@
"bytes": "Bytes"
}
}
}
}
5 changes: 3 additions & 2 deletions interface/i18n/mist.ja.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "フルスクリーンをトグルする",
"default": "Default"
},
"accounts": {
"file": {
"label": "アカウント",
"importPresale": "アカウントを読み込む",
"newAccount": "新規アカウント",
Expand All @@ -35,6 +35,7 @@
"backupMist": "アプリケーションデータ"
},
"develop": {
"uploadToSwarm": "Swarmにアップロード",
"label": "Develop",
"devTools": "開発者用ツールをトグルする",
"devToolsMistUI": "Mist UI",
Expand Down Expand Up @@ -277,4 +278,4 @@
"bytes": "Bytes"
}
}
}
}
3 changes: 2 additions & 1 deletion interface/i18n/mist.ko.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "전체화면으로",
"default": "기본"
},
"accounts": {
"file": {
"label": "계정",
"importPresale": "계정 추가하기",
"newAccount": "새 계정",
Expand All @@ -35,6 +35,7 @@
"backupMist": "어플리케이션 데이터"
},
"develop": {
"uploadToSwarm": "Swarm에 업로드",
"label": "개발",
"devTools": "개발도구 전환",
"devToolsMistUI": "미스트 UI",
Expand Down
3 changes: 2 additions & 1 deletion interface/i18n/mist.kr.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "전체화면으로",
"default": "기본"
},
"accounts": {
"file": {
"label": "계정",
"importPresale": "계정 추가하기",
"newAccount": "새 계정",
Expand All @@ -35,6 +35,7 @@
"backupMist": "어플리케이션 데이터"
},
"develop": {
"uploadToSwarm": "Swarm에 업로드",
"label": "개발",
"devTools": "개발도구 전환",
"devToolsMistUI": "미스트 UI",
Expand Down
5 changes: 3 additions & 2 deletions interface/i18n/mist.nb.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"fullscreen": "Veksle Mellom Fullskjerm",
"default": "Default"
},
"accounts": {
"file": {
"label": "Kontoer",
"importPresale": "Importer Kontoer",
"newAccount": "Ny konto",
Expand All @@ -35,6 +35,7 @@
"backupMist": "Applikasjonsdata"
},
"develop": {
"uploadToSwarm": "Opplasting til Swarm",
"label": "Utvikle",
"devTools": "Veksle Mellom Utviklerverktøy",
"devToolsMistUI": "Mist UI",
Expand Down Expand Up @@ -277,4 +278,4 @@
"bytes": "Bytes"
}
}
}
}
5 changes: 3 additions & 2 deletions interface/i18n/mist.nl.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"zh-TW": "國語"
}
},
"accounts": {
"file": {
"label": "Accounts",
"importPresale": "Importeer Accounts",
"newAccount": "Nieuw account",
Expand All @@ -53,6 +53,7 @@
"backupMist": "Applicatie Data"
},
"develop": {
"uploadToSwarm": "Uploaden naar Swarm",
"label": "Ontwikkelen",
"devTools": "Ontwikkelaars Opties Inschakelen",
"devToolsMistUI": "Mist UI",
Expand Down Expand Up @@ -295,4 +296,4 @@
"bytes": "Bytes"
}
}
}
}
Loading

0 comments on commit 65a9fb3

Please sign in to comment.