mirror of https://github.com/embarklabs/embark.git
Merge pull request #824 from embark-framework/feature/swarm-use-local-datadir
Swarm use local data dir
This commit is contained in:
commit
286e1d2c95
|
@ -64,7 +64,7 @@ var Blockchain = function(options) {
|
|||
this.config.account = {};
|
||||
this.config.account.password = fs.embarkPath("templates/boilerplate/config/development/password");
|
||||
this.config.genesisBlock = fs.embarkPath("templates/boilerplate/config/development/genesis.json");
|
||||
this.config.datadir = fs.embarkPath(".embark/development/datadir");
|
||||
this.config.datadir = fs.dappPath(".embark/development/datadir");
|
||||
}
|
||||
|
||||
const spaceMessage = 'The path for %s in blockchain config contains spaces, please remove them';
|
||||
|
|
|
@ -113,6 +113,7 @@ class StorageProcessesLauncher {
|
|||
self.processes[storageName].send({
|
||||
action: constants.blockchain.init, options: {
|
||||
storageConfig: self.storageConfig,
|
||||
blockchainConfig: self.blockchainConfig,
|
||||
cors: self.buildCors(storageName)
|
||||
}
|
||||
});
|
||||
|
|
|
@ -9,6 +9,7 @@ class SwarmProcess extends ProcessWrapper {
|
|||
constructor(options) {
|
||||
super();
|
||||
this.storageConfig = options.storageConfig;
|
||||
this.blockchainConfig = options.blockchainConfig;
|
||||
this.cors = options.cors;
|
||||
this.command = this.storageConfig.swarmPath || 'swarm';
|
||||
}
|
||||
|
@ -19,11 +20,14 @@ class SwarmProcess extends ProcessWrapper {
|
|||
return 'Account address and password are needed in the storage config to start the Swarm process';
|
||||
}
|
||||
|
||||
const datadir = this.blockchainConfig.datadir || fs.dappPath(`.embark/development/datadir`);
|
||||
const args = [
|
||||
`--bzzaccount=${this.storageConfig.account.address}`,
|
||||
`--password=${fs.dappPath(this.storageConfig.account.password)}`,
|
||||
`--corsdomain=${self.cors.join(',')}`
|
||||
'--datadir', datadir,
|
||||
'--bzzaccount', this.storageConfig.account.address,
|
||||
'--password', fs.dappPath(this.storageConfig.account.password),
|
||||
'--corsdomain', self.cors.join(',')
|
||||
];
|
||||
|
||||
console.trace('Starting swarm process with arguments: ' + args.join(' '));
|
||||
this.child = child_process.spawn(this.command, args);
|
||||
|
||||
|
|
Loading…
Reference in New Issue