Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ if (process.browser){
}
exports.database = {};

// allows to set the directory for the database
// add to conf.js in project root
// if not set: default behaviour (e.g. ~/.config/byteball on a linux system)
//exports.DatabaseDir = '/home/john/myDatabaseDir';

/*
There are 3 ways to customize conf in modules that use byteballcore lib:
Expand Down
9 changes: 9 additions & 0 deletions desktop_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ function getAppDataDir(){
return (getAppsDataDir() + '/' + getAppName());
}

// database can be located in another directory
function getDatabaseDir(){

const customDatabaseDir = require('./conf.js').DatabaseDir;
if (customDatabaseDir) return customDatabaseDir;

return getAppDataDir();
}

exports.getAppRootDir = getAppRootDir;
exports.getAppDataDir = getAppDataDir;
exports.getDatabaseDir = getDatabaseDir;

2 changes: 1 addition & 1 deletion sqlite_pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (bCordova){
}
else{
sqlite3 = require('sqlite3');//.verbose();
path = require('./desktop_app.js'+'').getAppDataDir() + '/';
path = require('./desktop_app.js'+'').getDatabaseDir() + '/';
console.log("path="+path);
}

Expand Down
5 changes: 5 additions & 0 deletions wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ function handleMessageFromHub(ws, json, device_pubkey, bIndirectCorrespondent, c
callbacks.ifOk();
break;

case "remove_paired_device":
device.removeCorrespondentDevice(from_address, function(){});
callbacks.ifOk();
break;

case "create_new_wallet":
// {wallet: "base64", wallet_definition_template: [...]}
walletDefinedByKeys.handleOfferToCreateNewWallet(body, from_address, callbacks);
Expand Down