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
ad0e6e97
Commit
ad0e6e97
authored
Jun 02, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
console: remove unnecessary JS evaluation in Welcome
parent
fdba0cb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
console.go
console/console.go
+8
-10
No files found.
console/console.go
View file @
ad0e6e97
...
@@ -244,15 +244,13 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
...
@@ -244,15 +244,13 @@ func (c *Console) AutoCompleteInput(line string, pos int) (string, []string, str
// console's available modules.
// console's available modules.
func
(
c
*
Console
)
Welcome
()
{
func
(
c
*
Console
)
Welcome
()
{
// Print some generic Geth metadata
// Print some generic Geth metadata
fmt
.
Fprintf
(
c
.
printer
,
"Welcome to the Geth JavaScript console!
\n\n
"
)
c
.
jsre
.
Run
(
`
c
.
jsre
.
Run
(
`
(function () {
console.log("instance: " + web3.version.node);
console.log("Welcome to the Geth JavaScript console!\n");
console.log("coinbase: " + eth.coinbase);
console.log("instance: " + web3.version.node);
console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")");
console.log("coinbase: " + eth.coinbase);
console.log(" datadir: " + admin.datadir);
console.log("at block: " + eth.blockNumber + " (" + new Date(1000 * eth.getBlock(eth.blockNumber).timestamp) + ")");
`
)
console.log(" datadir: " + admin.datadir);
})();
`
)
// List all the supported modules for the user to call
// List all the supported modules for the user to call
if
apis
,
err
:=
c
.
client
.
SupportedModules
();
err
==
nil
{
if
apis
,
err
:=
c
.
client
.
SupportedModules
();
err
==
nil
{
modules
:=
make
([]
string
,
0
,
len
(
apis
))
modules
:=
make
([]
string
,
0
,
len
(
apis
))
...
@@ -260,9 +258,9 @@ func (c *Console) Welcome() {
...
@@ -260,9 +258,9 @@ func (c *Console) Welcome() {
modules
=
append
(
modules
,
fmt
.
Sprintf
(
"%s:%s"
,
api
,
version
))
modules
=
append
(
modules
,
fmt
.
Sprintf
(
"%s:%s"
,
api
,
version
))
}
}
sort
.
Strings
(
modules
)
sort
.
Strings
(
modules
)
c
.
jsre
.
Run
(
"(function () { console.log(' modules: "
+
strings
.
Join
(
modules
,
" "
)
+
"'); })();"
)
fmt
.
Fprintln
(
c
.
printer
,
" modules:"
,
strings
.
Join
(
modules
,
" "
)
)
}
}
c
.
jsre
.
Run
(
"(function () { console.log(); })();"
)
fmt
.
Fprintln
(
c
.
printer
)
}
}
// Evaluate executes code and pretty prints the result to the specified output
// Evaluate executes code and pretty prints the result to the specified output
...
...
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