-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
292 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
#!/usr/bin/env node | ||
const ChluIPFS = require('../src/index.js'); | ||
const ChluIPFS = require('../dist/ChluIPFS.min.js'); | ||
|
||
let serviceNode = null; | ||
|
||
async function main(){ | ||
function main(){ | ||
console.log('Starting Chlu IPFS Service Node'); | ||
serviceNode = new ChluIPFS({ type: ChluIPFS.types.service }); | ||
await serviceNode.start(); | ||
return serviceNode.start(); | ||
} | ||
|
||
main().then(() => console.log('Service Node Started')); | ||
|
||
process.on('SIGINT', async function() { | ||
process.on('SIGINT', function() { | ||
console.log('Stopping gracefully'); | ||
try { | ||
if (serviceNode) { | ||
await serviceNode.stop(); | ||
} | ||
process.exit(0); | ||
} catch(exception) { | ||
process.exit(1); | ||
} | ||
serviceNode.stop() | ||
.then(() => process.exit(0)) | ||
.catch(exception => { | ||
console.log(exception.message); | ||
process.exit(1); | ||
}); | ||
}); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,6 @@ | |
<title>ChluIPFS Customer Example</title> | ||
</head> | ||
<body> | ||
|
||
<!-- ChluIPFS requires ipfs-js and orbit-db but does not include them in the prebuilt browser script --> | ||
<!-- we can easily include them before loading ChluIPFS thanks to the unpkg CDN --> | ||
|
||
<!-- Currently using non minified version of IPFS due to this issue https://github.com/ipfs/js-ipfs/issues/1136 --> | ||
<!-- IPFS --> | ||
<script src="https://unpkg.com/[email protected]/dist/index.js"></script> | ||
<!-- OrbitDB --> | ||
<script src="https://unpkg.com/[email protected]/dist/orbitdb.min.js"></script> | ||
<script src="../dist/ChluIPFS.min.js"></script> | ||
<script> | ||
// Utility function to output strings to the web page | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,6 @@ | |
<title>ChluIPFS Service Node Example</title> | ||
</head> | ||
<body> | ||
<!-- Currently using non minified version of IPFS due to https://github.com/ipfs/js-ipfs/issues/1136 --> | ||
<script src="https://unpkg.com/[email protected]/dist/index.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/orbitdb.min.js"></script> | ||
<script src="../dist/ChluIPFS.min.js"></script> | ||
<script> | ||
|
||
|
Oops, something went wrong.