File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-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,11 @@ 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' ]
73+ ? getMemoryStorage ( )
74+ : argv . storage ? argv . storage : await getStoragePath ( )
75+
76+ console . log ( `Using '${ storage } ' for storage` )
7177
7278 const s = new Server ( {
7379 host : argv . host ,
@@ -144,6 +150,11 @@ async function getStoragePath () {
144150 }
145151}
146152
153+ function getMemoryStorage ( ) {
154+ RAM . toString = ( ) => 'RAM'
155+ return RAM
156+ }
157+
147158function onerror ( err ) {
148159 console . error ( err . stack )
149160 process . exit ( 1 )
You can’t perform that action at this time.
0 commit comments