mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 22:34:24 +00:00
initialized ipfs object to environment
This commit is contained in:
parent
e2c2373249
commit
0363c676d4
@ -22,6 +22,7 @@ class Console {
|
|||||||
'versions - ' + __('display versions in use for libraries and tools like web3 and solc'),
|
'versions - ' + __('display versions in use for libraries and tools like web3 and solc'),
|
||||||
// TODO: only if the blockchain is actually active!
|
// TODO: only if the blockchain is actually active!
|
||||||
// will need to pass te current embark state here
|
// will need to pass te current embark state here
|
||||||
|
'ipfs - ' + __('instantiated js-ipfs object configured to the current environment (available if ipfs is enabled)'),
|
||||||
'web3 - ' + __('instantiated web3.js object configured to the current environment'),
|
'web3 - ' + __('instantiated web3.js object configured to the current environment'),
|
||||||
'quit - ' + __('to immediatly exit (alias: exit)'),
|
'quit - ' + __('to immediatly exit (alias: exit)'),
|
||||||
'',
|
'',
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
let UploadIPFS = require('./upload.js');
|
let UploadIPFS = require('./upload.js');
|
||||||
let utils = require('../../utils/utils.js');
|
let utils = require('../../utils/utils.js');
|
||||||
let fs = require('../../core/fs.js');
|
let fs = require('../../core/fs.js');
|
||||||
|
let RunCode = require('../../core/runCode.js');
|
||||||
|
let IpfsApi = require('ipfs-api');
|
||||||
|
|
||||||
class IPFS {
|
class IPFS {
|
||||||
|
|
||||||
@ -18,6 +20,7 @@ class IPFS {
|
|||||||
this.setServiceCheck();
|
this.setServiceCheck();
|
||||||
this.addIPFSToEmbarkJS();
|
this.addIPFSToEmbarkJS();
|
||||||
this.addSetProvider();
|
this.addSetProvider();
|
||||||
|
this.addIpfsObjectToConsole();
|
||||||
}
|
}
|
||||||
|
|
||||||
commandlineDeploy() {
|
commandlineDeploy() {
|
||||||
@ -111,6 +114,12 @@ class IPFS {
|
|||||||
|
|
||||||
this.embark.addProviderInit('storage', code, shouldInit);
|
this.embark.addProviderInit('storage', code, shouldInit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addIpfsObjectToConsole() {
|
||||||
|
let ipfs = IpfsApi(this.storageConfig.host, this.storageConfig.port);
|
||||||
|
RunCode.doEval("", {ipfs: ipfs});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = IPFS;
|
module.exports = IPFS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user