Streamlining ethoFS Node Process - Click Upload Bug Fix

This commit is contained in:
Dev-JamesR
2019-10-13 20:26:17 -07:00
parent eb0c49588a
commit 88e95c75c6
7 changed files with 34559 additions and 133227 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,83 @@
'use strict'
const IPFS = require('ipfs');
const Protector = require('libp2p-pnet');
process.env.LIBP2P_FORCE_PNET = 1
window.node = null;
window.info = null;
const swarmKey = "/key/swarm/psk/1.0.0/\n/base16/\n38307a74b2176d0054ffa2864e31ee22d0fc6c3266dd856f6d41bddf14e2ad63";
var swarmKeyBuffer = Buffer.from(swarmKey);
/* ===========================================================================
Start the IPFS node
=========================================================================== */
function start() {
console.log("Starting ethoFS Node...");
if (!node) {
console.log("Setting Up ethoFS Node Options...");
const options = {
libp2p: {
modules: {
connProtector: new Protector(swarmKeyBuffer)
},
config: {
dht: {
enabled: false
}
}
},
config: {
Bootstrap: [
'/dns4/wss0.ethofs.com/tcp/443/wss/ipfs/QmTJ81wQ6cQV9bh5nTthfLbjnrZPMeeCPfvRFiygSzWV1W',
'/dns4/wss1.ethofs.com/tcp/443/wss/ipfs/QmTcwcKqKcnt84wCecShm1zdz1KagfVtqopg1xKLiwVJst',
'/dns4/wss.ethofs.com/tcp/443/wss/ipfs/QmPW8zExrEeno85Us3H1bk68rBo7N7WEhdpU9pC9wjQxgu',
'/dns4/wss2.ethofs.com/tcp/443/wss/ipfs/QmUEy4ScCYCgP6GRfVgrLDqXfLXnUUh4eKaS1fDgaCoGQJ',
'/dns4/wss3.ethofs.com/tcp/443/wss/ipfs/QmPT4bDvbAjwPTjf2yeugRT1pruHoH2DMLhpjR2NoczWgw',
'/dns4/wss4.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ',
'/dns4/wss5.ethofs.com/tcp/443/wss/ipfs/QmRwQ49Zknc2dQbywrhT8ArMDS9JdmnEyGGy4mZ1wDkgaX',
'/dns4/wss6.ethofs.com/tcp/443/wss/ipfs/Qmf4oLLYAhkXv95ucVvUihnWPR66Knqzt9ee3CU6UoJKVu',
'/dns4/wss0.ethofs.com/tcp/443/wss/ipfs/QmTJ81wQ6cQV9bh5nTthfLbjnrZPMeeCPfvRFiygSzWV1W',
'/dns4/wss7.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ',
'/dns4/wss8.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ'
],
Addresses: {
Swarm: [
'/dns4/wss0.ethofs.com/tcp/443/wss/ipfs/QmTJ81wQ6cQV9bh5nTthfLbjnrZPMeeCPfvRFiygSzWV1W',
'/dns4/wss1.ethofs.com/tcp/443/wss/ipfs/QmTcwcKqKcnt84wCecShm1zdz1KagfVtqopg1xKLiwVJst',
'/dns4/wss.ethofs.com/tcp/443/wss/ipfs/QmPW8zExrEeno85Us3H1bk68rBo7N7WEhdpU9pC9wjQxgu',
'/dns4/wss2.ethofs.com/tcp/443/wss/ipfs/QmUEy4ScCYCgP6GRfVgrLDqXfLXnUUh4eKaS1fDgaCoGQJ',
'/dns4/wss3.ethofs.com/tcp/443/wss/ipfs/QmPT4bDvbAjwPTjf2yeugRT1pruHoH2DMLhpjR2NoczWgw',
'/dns4/wss4.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ',
'/dns4/wss5.ethofs.com/tcp/443/wss/ipfs/QmRwQ49Zknc2dQbywrhT8ArMDS9JdmnEyGGy4mZ1wDkgaX',
'/dns4/wss6.ethofs.com/tcp/443/wss/ipfs/Qmf4oLLYAhkXv95ucVvUihnWPR66Knqzt9ee3CU6UoJKVu',
'/dns4/wss0.ethofs.com/tcp/443/wss/ipfs/QmTJ81wQ6cQV9bh5nTthfLbjnrZPMeeCPfvRFiygSzWV1W',
'/dns4/wss7.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ',
'/dns4/wss8.ethofs.com/tcp/443/wss/ipfs/QmeG81bELkgLBZFYZc53ioxtvRS8iNVzPqxUBKSuah2rcQ'
]
}
}
}
console.log("Launching ethoFS Node...");
window.node = new IPFS(options)
console.log("Waiting For ethoFS Node Launch Confirmation...");
window.node.once('start', () => {
console.log("ethoFS Node Startup Confirmed...");
window.node.id()
.then((id) => {
window.info = id
console.log("Getting ethoFS Node ID...");
subscribeToHealthChannel()
updateView('ready', window.node)
onSuccess('Node is ready.')
setInterval(refreshPeerList, 10000)
setInterval(sendFileList, 10000)
})
.catch((error) => onError(error))
})
}
}
window.startNode = function() {
start()
}

View File

@@ -173,7 +173,7 @@
</div>
</div>
<div class="modal-footer" style="background-color: #840032;">
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="ethofs-login-button" onclick="window.ethofsLogin(document.getElementById('privatekey').value);">LOGIN</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="ethofs-login-button" onclick="ethofsLogin(document.getElementById('privatekey').value);">LOGIN</button>
</div>
</div>
</div>
@@ -201,7 +201,7 @@
</div>
</div>
<div class="modal-footer" style="background-color: #840032;">
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="ethofs-registration-button" onclick="window.AddNewUser(document.getElementById('username').value);">REGISTER</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="ethofs-registration-button" onclick="AddNewUser(document.getElementById('username').value);">REGISTER</button>
</div>
</div>
</div>
@@ -356,7 +356,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal">CLOSE</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="upload-confirm-button" onclick="window.startUploadProcess();">CONFIRM</button>
<button type="button" class="btn btn-link waves-effect" data-dismiss="modal" id="upload-confirm-button" onclick="startUploadProcess();">CONFIRM</button>
</div>
</main>
</div>
@@ -665,7 +665,7 @@
<!-- Custom Js -->
<script src="assets/dashboard/js/admin.js"></script>
<script src="assets/dashboard/js/bundle.js"></script>
<script src="assets/dashboard/js/misc.js"></script>
<script src="assets/dashboard/js/app.js"></script>
<!-- Demo Js -->
<script src="assets/dashboard/js/demo.js"></script>
<script>

15013
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@
"dist-win": "build --platform=win --arch=x64",
"dist-linux": "build --platform=linux --arch=x64",
"dist-osx": "build --platform=mac --arch=x64",
"bundle": "browserify assets/dashboard/js/app.js > assets/dashboard/js/bundle.js"
"bundle": "browserify assets/dashboard/js/node.js > assets/dashboard/js/bundle.js"
},
"build": {
"appId": "Ether1DesktopWallet",
@@ -63,21 +63,26 @@
"handlebars": ">=4.1.2",
"moment": "^2.23.0",
"nedb": "^1.8.0",
"single-instance": "0.0.1"
},
"devDependencies": {
"electron": "^3.0.12",
"electron-builder": "^20.38.3",
"js-beautify": "^1.9.0",
"unibeautify": "^0.17.0",
"unibeautify-cli": "^0.2.1",
"browserify": "^16.5.0",
"ethereum-private-key-to-address": "0.0.2",
"single-instance": "0.0.1",
"ethereumjs-common": "^1.3.2",
"ipfs": "^0.38.0",
"libp2p-pnet": "^0.1.0",
"node-fetch": "^2.6.0",
"pull-file-reader": "^1.0.2",
"web3": "^1.2.1"
},
"devDependencies": {
"browserify": "^16.5.0",
"electron": "^3.0.12",
"electron-builder": "^20.38.3",
"electron-rebuild": "^1.8.6",
"ethereum-private-key-to-address": "0.0.2",
"ethereumjs-common": "^1.3.2",
"ipfs": "^0.38.0",
"js-beautify": "^1.9.0",
"libp2p-pnet": "^0.1.0",
"node-fetch": "^2.6.0",
"pull-file-reader": "^1.0.2",
"unibeautify": "^0.17.0",
"unibeautify-cli": "^0.2.1",
"web3": "^1.2.1"
}
}