File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ const os = require('os')
44const fs = require ( 'fs' ) . promises
55const repl = require ( 'repl' )
66const minimist = require ( 'minimist' )
7+ const RAM = require ( 'random-access-memory' )
78
89const { Server, Client } = require ( '../' )
910const { migrate : migrateFromDaemon , isMigrated } = require ( '@hyperspace/migration-tool' )
@@ -21,6 +22,7 @@ const argv = minimist(process.argv.slice(2), {
2122 } ,
2223 alias : {
2324 host : 'h' ,
25+ port : 'p' ,
2426 storage : 's' ,
2527 bootstrap : 'b'
2628 }
@@ -67,7 +69,10 @@ async function main () {
6769 // For now, the storage path is determined as follows:
6870 // If ~/.hyperdrive/storage/cores exists, use that (from an old hyperdrive daemon installation)
6971 // Else, use ~/.hyperspace/storage
70- const storage = argv . storage ? argv . storage : await getStoragePath ( )
72+ const storage = argv [ 'memory-only' ] ? getMemoryStorage ( ) :
73+ argv . storage ? argv . storage : await getStoragePath ( )
74+
75+ console . log ( `Using '${ storage } ' for storage` )
7176
7277 const s = new Server ( {
7378 host : argv . host ,
@@ -144,6 +149,11 @@ async function getStoragePath () {
144149 }
145150}
146151
152+ function getMemoryStorage ( ) {
153+ RAM . toString = ( ) => "RAM"
154+ return RAM
155+ }
156+
147157function onerror ( err ) {
148158 console . error ( err . stack )
149159 process . exit ( 1 )
You can’t perform that action at this time.
0 commit comments