-
Notifications
You must be signed in to change notification settings - Fork 808
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added neutrino mode client support
- Loading branch information
1 parent
093b18f
commit 9084146
Showing
12 changed files
with
378 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,9 @@ for arg in "$@"; do | |
--daemon) | ||
daemon=1 | ||
;; | ||
--neutrino) | ||
cmd='neutrino' | ||
;; | ||
--spv) | ||
cmd='spvnode' | ||
;; | ||
|
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
console.log('Starting bcoin'); | ||
process.title = 'bcoin'; | ||
const Neutrino = require('../lib/node/neutrino'); | ||
|
||
const node = new Neutrino({ | ||
file: true, | ||
argv: true, | ||
env: true, | ||
logFile: true, | ||
logConsole: true, | ||
logLevel: 'debug', | ||
db: 'leveldb', | ||
memory: false, | ||
workers: true, | ||
loader: require | ||
}); | ||
|
||
(async () => { | ||
await node.ensure(); | ||
await node.open(); | ||
await node.connect(); | ||
node.startSync(); | ||
|
||
node.on('full', () => { | ||
console.log('Full node'); | ||
}); | ||
})().catch((err) => { | ||
console.error(err.stack); | ||
process.exit(1); | ||
}); | ||
|
||
process.on('unhandledRejection', (err, promise) => { | ||
throw err; | ||
}); | ||
|
||
process.on('SIGINT', async () => { | ||
await node.close(); | ||
}); |
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
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
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
Oops, something went wrong.