mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-18 16:46:38 +00:00
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 = {};
|
||||||
this.config.account.password = fs.embarkPath("templates/boilerplate/config/development/password");
|
this.config.account.password = fs.embarkPath("templates/boilerplate/config/development/password");
|
||||||
this.config.genesisBlock = fs.embarkPath("templates/boilerplate/config/development/genesis.json");
|
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';
|
const spaceMessage = 'The path for %s in blockchain config contains spaces, please remove them';
|
||||||
|
@ -113,6 +113,7 @@ class StorageProcessesLauncher {
|
|||||||
self.processes[storageName].send({
|
self.processes[storageName].send({
|
||||||
action: constants.blockchain.init, options: {
|
action: constants.blockchain.init, options: {
|
||||||
storageConfig: self.storageConfig,
|
storageConfig: self.storageConfig,
|
||||||
|
blockchainConfig: self.blockchainConfig,
|
||||||
cors: self.buildCors(storageName)
|
cors: self.buildCors(storageName)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -9,6 +9,7 @@ class SwarmProcess extends ProcessWrapper {
|
|||||||
constructor(options) {
|
constructor(options) {
|
||||||
super();
|
super();
|
||||||
this.storageConfig = options.storageConfig;
|
this.storageConfig = options.storageConfig;
|
||||||
|
this.blockchainConfig = options.blockchainConfig;
|
||||||
this.cors = options.cors;
|
this.cors = options.cors;
|
||||||
this.command = this.storageConfig.swarmPath || 'swarm';
|
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';
|
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 = [
|
const args = [
|
||||||
`--bzzaccount=${this.storageConfig.account.address}`,
|
'--datadir', datadir,
|
||||||
`--password=${fs.dappPath(this.storageConfig.account.password)}`,
|
'--bzzaccount', this.storageConfig.account.address,
|
||||||
`--corsdomain=${self.cors.join(',')}`
|
'--password', fs.dappPath(this.storageConfig.account.password),
|
||||||
|
'--corsdomain', self.cors.join(',')
|
||||||
];
|
];
|
||||||
|
|
||||||
console.trace('Starting swarm process with arguments: ' + args.join(' '));
|
console.trace('Starting swarm process with arguments: ' + args.join(' '));
|
||||||
this.child = child_process.spawn(this.command, args);
|
this.child = child_process.spawn(this.command, args);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user