Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
dea68f07
Commit
dea68f07
authored
Nov 11, 2014
by
Marian Oancea
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'debris-subprotocol_prefix_merge'
parents
72036585
7af9cc70
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
97 additions
and
81 deletions
+97
-81
.gitignore
.gitignore
+1
-0
ethereum.js
dist/ethereum.js
+1
-1
ethereum.js.map
dist/ethereum.js.map
+1
-1
ethereum.min.js
dist/ethereum.min.js
+1
-1
gulpfile.js
gulpfile.js
+43
-27
index_qt.js
index_qt.js
+4
-0
main.js
lib/main.js
+46
-51
No files found.
.gitignore
View file @
dea68f07
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
# or operating system, you probably want to add a global ignore instead:
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# git config --global core.excludesfile ~/.gitignore_global
*.swp
/tmp
/tmp
*/**/*un~
*/**/*un~
*un~
*un~
...
...
dist/ethereum.js
View file @
dea68f07
This diff is collapsed.
Click to expand it.
dist/ethereum.js.map
View file @
dea68f07
This diff is collapsed.
Click to expand it.
dist/ethereum.min.js
View file @
dea68f07
This diff is collapsed.
Click to expand it.
gulpfile.js
View file @
dea68f07
...
@@ -16,27 +16,9 @@ var source = require('vinyl-source-stream');
...
@@ -16,27 +16,9 @@ var source = require('vinyl-source-stream');
var
exorcist
=
require
(
'exorcist'
);
var
exorcist
=
require
(
'exorcist'
);
var
bower
=
require
(
'bower'
);
var
bower
=
require
(
'bower'
);
var
DEST
=
'./dist/'
;
var
DEST
=
'./dist/'
;
gulp
.
task
(
'bower'
,
function
(
cb
){
var
build
=
function
(
src
,
dst
)
{
bower
.
commands
.
install
().
on
(
'end'
,
function
(
installed
){
console
.
log
(
installed
);
cb
();
});
});
gulp
.
task
(
'lint'
,
function
(){
return
gulp
.
src
([
'./*.js'
,
'./lib/*.js'
])
.
pipe
(
jshint
())
.
pipe
(
jshint
.
reporter
(
'default'
));
});
gulp
.
task
(
'clean'
,
[
'lint'
],
function
(
cb
)
{
del
([
DEST
],
cb
);
});
gulp
.
task
(
'prepare'
,
[
'clean'
],
function
()
{
return
browserify
({
return
browserify
({
debug
:
true
,
debug
:
true
,
insert_global_vars
:
false
,
insert_global_vars
:
false
,
...
@@ -44,7 +26,7 @@ gulp.task('prepare', ['clean'], function () {
...
@@ -44,7 +26,7 @@ gulp.task('prepare', ['clean'], function () {
bundleExternal
:
false
bundleExternal
:
false
})
})
.
add
(
'./'
)
.
add
(
'./'
)
.
require
(
'./
index
.js'
,
{
expose
:
'web3'
})
.
require
(
'./
'
+
src
+
'
.js'
,
{
expose
:
'web3'
})
.
transform
(
'envify'
,
{
.
transform
(
'envify'
,
{
NODE_ENV
:
'build'
NODE_ENV
:
'build'
})
})
...
@@ -63,20 +45,54 @@ gulp.task('prepare', ['clean'], function () {
...
@@ -63,20 +45,54 @@ gulp.task('prepare', ['clean'], function () {
warnings
:
true
warnings
:
true
})
})
.
bundle
()
.
bundle
()
.
pipe
(
exorcist
(
path
.
join
(
DEST
,
'ethereum
.js.map'
)))
.
pipe
(
exorcist
(
path
.
join
(
DEST
,
dst
+
'
.js.map'
)))
.
pipe
(
source
(
'ethereum
.js'
))
.
pipe
(
source
(
dst
+
'
.js'
))
.
pipe
(
gulp
.
dest
(
DEST
));
.
pipe
(
gulp
.
dest
(
DEST
));
}
)
;
};
gulp
.
task
(
'build'
,
[
'prepare'
],
function
()
{
var
uglifyFile
=
function
(
file
)
{
return
gulp
.
src
(
DEST
+
'ethereum
.js'
)
return
gulp
.
src
(
DEST
+
file
+
'
.js'
)
.
pipe
(
uglify
())
.
pipe
(
uglify
())
.
pipe
(
rename
(
'ethereum
.min.js'
))
.
pipe
(
rename
(
file
+
'
.min.js'
))
.
pipe
(
gulp
.
dest
(
DEST
));
.
pipe
(
gulp
.
dest
(
DEST
));
};
gulp
.
task
(
'bower'
,
function
(
cb
){
bower
.
commands
.
install
().
on
(
'end'
,
function
(
installed
){
console
.
log
(
installed
);
cb
();
});
});
gulp
.
task
(
'lint'
,
function
(){
return
gulp
.
src
([
'./*.js'
,
'./lib/*.js'
])
.
pipe
(
jshint
())
.
pipe
(
jshint
.
reporter
(
'default'
));
});
gulp
.
task
(
'clean'
,
[
'lint'
],
function
(
cb
)
{
del
([
DEST
],
cb
);
});
gulp
.
task
(
'build'
,
[
'clean'
],
function
()
{
return
build
(
'index'
,
'ethereum'
);
});
gulp
.
task
(
'buildQt'
,
[
'clean'
],
function
()
{
return
build
(
'index_qt'
,
'ethereum_qt'
);
});
gulp
.
task
(
'uglify'
,
[
'build'
],
function
(){
return
uglifyFile
(
'ethereum'
);
});
gulp
.
task
(
'uglifyQt'
,
[
'buildQt'
],
function
()
{
return
uglifyFile
(
'ethereum_qt'
);
});
});
gulp
.
task
(
'watch'
,
function
()
{
gulp
.
task
(
'watch'
,
function
()
{
gulp
.
watch
([
'./lib/*.js'
],
[
'lint'
,
'prepare'
,
'build'
]);
gulp
.
watch
([
'./lib/*.js'
],
[
'lint'
,
'prepare'
,
'build'
]);
});
});
gulp
.
task
(
'default'
,
[
'bower'
,
'lint'
,
'prepare'
,
'build'
]);
gulp
.
task
(
'default'
,
[
'bower'
,
'lint'
,
'build'
,
'uglify'
]);
gulp
.
task
(
'qt'
,
[
'bower'
,
'lint'
,
'buildQt'
,
'uglifyQt'
]);
index_qt.js
0 → 100644
View file @
dea68f07
var
web3
=
require
(
'./lib/main'
);
web3
.
providers
.
QtProvider
=
require
(
'./lib/qt'
);
module
.
exports
=
web3
;
lib/main.js
View file @
dea68f07
...
@@ -15,17 +15,12 @@
...
@@ -15,17 +15,12 @@
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
along with ethereum.js. If not, see <http://www.gnu.org/licenses/>.
*/
*/
/** @file main.js
/** @file main.js
* @authors:
* @authors:
* Jeffrey Wilcke <jeff@ethdev.com>
* Jeffrey Wilcke <jeff@ethdev.com>
* Marek Kotewicz <marek@ethdev.com>
* Marek Kotewicz <marek@ethdev.com>
* Marian Oancea <marian@ethdev.com>
* Marian Oancea <marian@ethdev.com>
* @date 2014
* @date 2014
*/
*/
function
isPromise
(
o
)
{
return
o
instanceof
Promise
;
}
function
flattenPromise
(
obj
)
{
function
flattenPromise
(
obj
)
{
if
(
obj
instanceof
Promise
)
{
if
(
obj
instanceof
Promise
)
{
...
@@ -46,7 +41,7 @@
...
@@ -46,7 +41,7 @@
});
});
});
});
}
}
if
(
obj
instanceof
Object
)
{
if
(
obj
instanceof
Object
)
{
return
new
Promise
(
function
(
resolve
)
{
return
new
Promise
(
function
(
resolve
)
{
var
keys
=
Object
.
keys
(
obj
);
var
keys
=
Object
.
keys
(
obj
);
...
@@ -68,82 +63,83 @@
...
@@ -68,82 +63,83 @@
var
ethMethods
=
function
()
{
var
ethMethods
=
function
()
{
var
blockCall
=
function
(
args
)
{
var
blockCall
=
function
(
args
)
{
return
typeof
args
[
0
]
===
"string"
?
"
blockByHash"
:
"
blockByNumber"
;
return
typeof
args
[
0
]
===
"string"
?
"
eth_blockByHash"
:
"eth_
blockByNumber"
;
};
};
var
transactionCall
=
function
(
args
)
{
var
transactionCall
=
function
(
args
)
{
return
typeof
args
[
0
]
===
"string"
?
'
transactionByHash'
:
'transactionByNumber'
;
return
typeof
args
[
0
]
===
"string"
?
'
eth_transactionByHash'
:
'eth_transactionByNumber'
;
};
};
var
uncleCall
=
function
(
args
)
{
var
uncleCall
=
function
(
args
)
{
return
typeof
args
[
0
]
===
"string"
?
'
uncleByHash'
:
'uncleByNumber'
;
return
typeof
args
[
0
]
===
"string"
?
'
eth_uncleByHash'
:
'eth_uncleByNumber'
;
};
};
var
methods
=
[
var
methods
=
[
{
name
:
'balanceAt'
,
call
:
'balanceAt'
},
{
name
:
'balanceAt'
,
call
:
'
eth_
balanceAt'
},
{
name
:
'stateAt'
,
call
:
'stateAt'
},
{
name
:
'stateAt'
,
call
:
'
eth_
stateAt'
},
{
name
:
'countAt'
,
call
:
'countAt'
},
{
name
:
'countAt'
,
call
:
'
eth_
countAt'
},
{
name
:
'codeAt'
,
call
:
'codeAt'
},
{
name
:
'codeAt'
,
call
:
'
eth_
codeAt'
},
{
name
:
'transact'
,
call
:
'transact'
},
{
name
:
'transact'
,
call
:
'
eth_
transact'
},
{
name
:
'call'
,
call
:
'call'
},
{
name
:
'call'
,
call
:
'
eth_
call'
},
{
name
:
'block'
,
call
:
blockCall
},
{
name
:
'block'
,
call
:
blockCall
},
{
name
:
'transaction'
,
call
:
transactionCall
},
{
name
:
'transaction'
,
call
:
transactionCall
},
{
name
:
'uncle'
,
call
:
uncleCall
},
{
name
:
'uncle'
,
call
:
uncleCall
},
{
name
:
'compile'
,
call
:
'compile'
}
{
name
:
'compile'
,
call
:
'eth_compile'
},
{
name
:
'lll'
,
call
:
'eth_lll'
}
];
];
return
methods
;
return
methods
;
};
};
var
ethProperties
=
function
()
{
var
ethProperties
=
function
()
{
return
[
return
[
{
name
:
'coinbase'
,
getter
:
'
coinbase'
,
setter
:
'
setCoinbase'
},
{
name
:
'coinbase'
,
getter
:
'
eth_coinbase'
,
setter
:
'eth_
setCoinbase'
},
{
name
:
'listening'
,
getter
:
'
listening'
,
setter
:
'
setListening'
},
{
name
:
'listening'
,
getter
:
'
eth_listening'
,
setter
:
'eth_
setListening'
},
{
name
:
'mining'
,
getter
:
'
mining'
,
setter
:
'
setMining'
},
{
name
:
'mining'
,
getter
:
'
eth_mining'
,
setter
:
'eth_
setMining'
},
{
name
:
'gasPrice'
,
getter
:
'gasPrice'
},
{
name
:
'gasPrice'
,
getter
:
'
eth_
gasPrice'
},
{
name
:
'account'
,
getter
:
'account'
},
{
name
:
'account'
,
getter
:
'
eth_
account'
},
{
name
:
'accounts'
,
getter
:
'accounts'
},
{
name
:
'accounts'
,
getter
:
'
eth_
accounts'
},
{
name
:
'peerCount'
,
getter
:
'peerCount'
},
{
name
:
'peerCount'
,
getter
:
'
eth_
peerCount'
},
{
name
:
'defaultBlock'
,
getter
:
'
defaultBlock'
,
setter
:
'
setDefaultBlock'
},
{
name
:
'defaultBlock'
,
getter
:
'
eth_defaultBlock'
,
setter
:
'eth_
setDefaultBlock'
},
{
name
:
'number'
,
getter
:
'number'
}
{
name
:
'number'
,
getter
:
'
eth_
number'
}
];
];
};
};
var
dbMethods
=
function
()
{
var
dbMethods
=
function
()
{
return
[
return
[
{
name
:
'put'
,
call
:
'put'
},
{
name
:
'put'
,
call
:
'
db_
put'
},
{
name
:
'get'
,
call
:
'get'
},
{
name
:
'get'
,
call
:
'
db_
get'
},
{
name
:
'putString'
,
call
:
'putString'
},
{
name
:
'putString'
,
call
:
'
db_
putString'
},
{
name
:
'getString'
,
call
:
'getString'
}
{
name
:
'getString'
,
call
:
'
db_
getString'
}
];
];
};
};
var
shhMethods
=
function
()
{
var
shhMethods
=
function
()
{
return
[
return
[
{
name
:
'post'
,
call
:
'post'
},
{
name
:
'post'
,
call
:
'
shh_
post'
},
{
name
:
'newIdentity'
,
call
:
'newIdentity'
},
{
name
:
'newIdentity'
,
call
:
'
shh_
newIdentity'
},
{
name
:
'haveIdentity'
,
call
:
'haveIdentity'
},
{
name
:
'haveIdentity'
,
call
:
'
shh_
haveIdentity'
},
{
name
:
'newGroup'
,
call
:
'newGroup'
},
{
name
:
'newGroup'
,
call
:
'
shh_
newGroup'
},
{
name
:
'addToGroup'
,
call
:
'addToGroup'
}
{
name
:
'addToGroup'
,
call
:
'
shh_
addToGroup'
}
];
];
};
};
var
ethWatchMethods
=
function
()
{
var
ethWatchMethods
=
function
()
{
var
newFilter
=
function
(
args
)
{
var
newFilter
=
function
(
args
)
{
return
typeof
args
[
0
]
===
'string'
?
'
newFilterString'
:
'
newFilter'
;
return
typeof
args
[
0
]
===
'string'
?
'
eth_newFilterString'
:
'eth_
newFilter'
;
};
};
return
[
return
[
{
name
:
'newFilter'
,
call
:
newFilter
},
{
name
:
'newFilter'
,
call
:
newFilter
},
{
name
:
'uninstallFilter'
,
call
:
'uninstallFilter'
},
{
name
:
'uninstallFilter'
,
call
:
'
eth_
uninstallFilter'
},
{
name
:
'getMessages'
,
call
:
'getMessages'
}
{
name
:
'getMessages'
,
call
:
'
eth_
getMessages'
}
];
];
};
};
var
shhWatchMethods
=
function
()
{
var
shhWatchMethods
=
function
()
{
return
[
return
[
{
name
:
'newFilter'
,
call
:
'shh
N
ewFilter'
},
{
name
:
'newFilter'
,
call
:
'shh
_n
ewFilter'
},
{
name
:
'uninstallFilter'
,
call
:
'shh
U
ninstallFilter'
},
{
name
:
'uninstallFilter'
,
call
:
'shh
_u
ninstallFilter'
},
{
name
:
'getMessage'
,
call
:
'shh
G
etMessages'
}
{
name
:
'getMessage'
,
call
:
'shh
_g
etMessages'
}
];
];
};
};
...
@@ -204,7 +200,7 @@
...
@@ -204,7 +200,7 @@
Object
.
defineProperty
(
obj
,
property
.
name
,
proto
);
Object
.
defineProperty
(
obj
,
property
.
name
,
proto
);
});
});
};
};
var
web3
=
{
var
web3
=
{
_callbacks
:
{},
_callbacks
:
{},
_events
:
{},
_events
:
{},
...
@@ -246,7 +242,6 @@
...
@@ -246,7 +242,6 @@
var
hex
=
this
.
toHex
(
str
);
var
hex
=
this
.
toHex
(
str
);
while
(
hex
.
length
<
pad
*
2
)
while
(
hex
.
length
<
pad
*
2
)
hex
+=
"00"
;
hex
+=
"00"
;
return
"0x"
+
hex
;
return
"0x"
+
hex
;
},
},
...
@@ -302,11 +297,11 @@
...
@@ -302,11 +297,11 @@
setupMethods
(
web3
.
shh
,
shhMethods
());
setupMethods
(
web3
.
shh
,
shhMethods
());
var
ethWatch
=
{
var
ethWatch
=
{
changed
:
'changed'
changed
:
'
eth_
changed'
};
};
setupMethods
(
ethWatch
,
ethWatchMethods
());
setupMethods
(
ethWatch
,
ethWatchMethods
());
var
shhWatch
=
{
var
shhWatch
=
{
changed
:
'shh
C
hanged'
changed
:
'shh
_c
hanged'
};
};
setupMethods
(
shhWatch
,
shhWatchMethods
());
setupMethods
(
shhWatch
,
shhWatchMethods
());
...
@@ -453,5 +448,5 @@
...
@@ -453,5 +448,5 @@
}
}
}
}
module
.
exports
=
web3
;
module
.
exports
=
web3
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment