forked from mbeaudru/ethereum-todolist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (37 loc) · 1.07 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const gulp = require('gulp');
const watch = require('gulp-watch');
const shell = require('gulp-shell');
const clean = require('gulp-clean');
const runSequence = require('run-sequence');
gulp.task('watch-contracts', () => {
runSequence(['migrate-contracts'], () => {
watch('contracts/*.sol', function () {
runSequence(['clean-build', 'migrate-contracts']);
});
});
});
gulp.task('clean-build', () => {
return gulp
.src('build/**')
.pipe(clean({force: true}));
});
gulp.task('migrate-contracts', () => {
gulp
.src('contracts/*.sol')
.pipe(shell([
'truffle compile'
]))
.pipe(shell([
'truffle migrate --reset'
]));
});
gulp.task('geth', () => {
gulp
.src('./')
.pipe(shell([
'geth --rpc --rpcport "8545" --rpccorsdomain "*" --datadir "blockchain" --rpcapi "db,eth,net,web3" --nodiscover --networkid 1999 init blockchain/genesis.json'
]))
.pipe(shell([
'geth --rpc --rpcport "8545" --rpccorsdomain "*" --datadir "blockchain" --rpcapi "db,eth,net,web3" --nodiscover --networkid 1999 console'
]))
})