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
f6e821fd
Commit
f6e821fd
authored
Feb 28, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flag to set RPC port
parent
ad3a21f2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
65 deletions
+69
-65
flags.go
cmd/ethereum/flags.go
+36
-34
main.go
cmd/ethereum/main.go
+1
-1
flags.go
cmd/mist/flags.go
+27
-25
main.go
cmd/mist/main.go
+1
-1
cmd.go
cmd/utils/cmd.go
+2
-2
server.go
rpc/http/server.go
+2
-2
No files found.
cmd/ethereum/flags.go
View file @
f6e821fd
...
@@ -36,40 +36,41 @@ import (
...
@@ -36,40 +36,41 @@ import (
)
)
var
(
var
(
Identifier
string
Identifier
string
KeyRing
string
KeyRing
string
DiffTool
bool
DiffTool
bool
DiffType
string
DiffType
string
KeyStore
string
KeyStore
string
StartRpc
bool
StartRpc
bool
StartWebSockets
bool
StartWebSockets
bool
RpcPort
int
RpcListenAddress
string
WsPort
int
RpcPort
int
OutboundPort
string
WsPort
int
ShowGenesis
bool
OutboundPort
string
AddPeer
string
ShowGenesis
bool
MaxPeer
int
AddPeer
string
GenAddr
bool
MaxPeer
int
BootNodes
string
GenAddr
bool
NodeKey
*
ecdsa
.
PrivateKey
BootNodes
string
NAT
nat
.
Interface
NodeKey
*
ecdsa
.
PrivateKey
SecretFile
string
NAT
nat
.
Interface
ExportDir
string
SecretFile
string
NonInteractive
bool
ExportDir
string
Datadir
string
NonInteractive
bool
LogFile
string
Datadir
string
ConfigFile
string
LogFile
string
DebugFile
string
ConfigFile
string
LogLevel
int
DebugFile
string
LogFormat
string
LogLevel
int
Dump
bool
LogFormat
string
DumpHash
string
Dump
bool
DumpNumber
int
DumpHash
string
VmType
int
DumpNumber
int
ImportChain
string
VmType
int
SHH
bool
ImportChain
string
Dial
bool
SHH
bool
PrintVersion
bool
Dial
bool
PrintVersion
bool
)
)
// flags specific to cli client
// flags specific to cli client
...
@@ -93,6 +94,7 @@ func Init() {
...
@@ -93,6 +94,7 @@ func Init() {
flag
.
StringVar
(
&
KeyRing
,
"keyring"
,
""
,
"identifier for keyring to use"
)
flag
.
StringVar
(
&
KeyRing
,
"keyring"
,
""
,
"identifier for keyring to use"
)
flag
.
StringVar
(
&
KeyStore
,
"keystore"
,
"db"
,
"system to store keyrings: db|file (db)"
)
flag
.
StringVar
(
&
KeyStore
,
"keystore"
,
"db"
,
"system to store keyrings: db|file (db)"
)
flag
.
StringVar
(
&
RpcListenAddress
,
"rpcaddr"
,
"127.0.0.1"
,
"address for json-rpc server to listen on"
)
flag
.
IntVar
(
&
RpcPort
,
"rpcport"
,
8545
,
"port to start json-rpc server on"
)
flag
.
IntVar
(
&
RpcPort
,
"rpcport"
,
8545
,
"port to start json-rpc server on"
)
flag
.
IntVar
(
&
WsPort
,
"wsport"
,
40404
,
"port to start websocket rpc server on"
)
flag
.
IntVar
(
&
WsPort
,
"wsport"
,
40404
,
"port to start websocket rpc server on"
)
flag
.
BoolVar
(
&
StartRpc
,
"rpc"
,
false
,
"start rpc server"
)
flag
.
BoolVar
(
&
StartRpc
,
"rpc"
,
false
,
"start rpc server"
)
...
...
cmd/ethereum/main.go
View file @
f6e821fd
...
@@ -128,7 +128,7 @@ func main() {
...
@@ -128,7 +128,7 @@ func main() {
}
}
if
StartRpc
{
if
StartRpc
{
utils
.
StartRpc
(
ethereum
,
RpcPort
)
utils
.
StartRpc
(
ethereum
,
Rpc
ListenAddress
,
Rpc
Port
)
}
}
if
StartWebSockets
{
if
StartWebSockets
{
...
...
cmd/mist/flags.go
View file @
f6e821fd
...
@@ -37,31 +37,32 @@ import (
...
@@ -37,31 +37,32 @@ import (
)
)
var
(
var
(
Identifier
string
Identifier
string
KeyRing
string
KeyRing
string
KeyStore
string
KeyStore
string
StartRpc
bool
StartRpc
bool
StartWebSockets
bool
StartWebSockets
bool
RpcPort
int
RpcListenAddress
string
WsPort
int
RpcPort
int
OutboundPort
string
WsPort
int
ShowGenesis
bool
OutboundPort
string
AddPeer
string
ShowGenesis
bool
MaxPeer
int
AddPeer
string
GenAddr
bool
MaxPeer
int
BootNodes
string
GenAddr
bool
NodeKey
*
ecdsa
.
PrivateKey
BootNodes
string
NAT
nat
.
Interface
NodeKey
*
ecdsa
.
PrivateKey
SecretFile
string
NAT
nat
.
Interface
ExportDir
string
SecretFile
string
NonInteractive
bool
ExportDir
string
Datadir
string
NonInteractive
bool
LogFile
string
Datadir
string
ConfigFile
string
LogFile
string
DebugFile
string
ConfigFile
string
LogLevel
int
DebugFile
string
VmType
int
LogLevel
int
MinerThreads
int
VmType
int
MinerThreads
int
)
)
// flags specific to gui client
// flags specific to gui client
...
@@ -79,6 +80,7 @@ func Init() {
...
@@ -79,6 +80,7 @@ func Init() {
flag
.
StringVar
(
&
Identifier
,
"id"
,
""
,
"Custom client identifier"
)
flag
.
StringVar
(
&
Identifier
,
"id"
,
""
,
"Custom client identifier"
)
flag
.
StringVar
(
&
KeyRing
,
"keyring"
,
""
,
"identifier for keyring to use"
)
flag
.
StringVar
(
&
KeyRing
,
"keyring"
,
""
,
"identifier for keyring to use"
)
flag
.
StringVar
(
&
KeyStore
,
"keystore"
,
"db"
,
"system to store keyrings: db|file (db)"
)
flag
.
StringVar
(
&
KeyStore
,
"keystore"
,
"db"
,
"system to store keyrings: db|file (db)"
)
flag
.
StringVar
(
&
RpcListenAddress
,
"rpcaddr"
,
"127.0.0.1"
,
"address for json-rpc server to listen on"
)
flag
.
IntVar
(
&
RpcPort
,
"rpcport"
,
8545
,
"port to start json-rpc server on"
)
flag
.
IntVar
(
&
RpcPort
,
"rpcport"
,
8545
,
"port to start json-rpc server on"
)
flag
.
IntVar
(
&
WsPort
,
"wsport"
,
40404
,
"port to start websocket rpc server on"
)
flag
.
IntVar
(
&
WsPort
,
"wsport"
,
40404
,
"port to start websocket rpc server on"
)
flag
.
BoolVar
(
&
StartRpc
,
"rpc"
,
true
,
"start rpc server"
)
flag
.
BoolVar
(
&
StartRpc
,
"rpc"
,
true
,
"start rpc server"
)
...
...
cmd/mist/main.go
View file @
f6e821fd
...
@@ -73,7 +73,7 @@ func run() error {
...
@@ -73,7 +73,7 @@ func run() error {
utils
.
KeyTasks
(
ethereum
.
KeyManager
(),
KeyRing
,
GenAddr
,
SecretFile
,
ExportDir
,
NonInteractive
)
utils
.
KeyTasks
(
ethereum
.
KeyManager
(),
KeyRing
,
GenAddr
,
SecretFile
,
ExportDir
,
NonInteractive
)
if
StartRpc
{
if
StartRpc
{
utils
.
StartRpc
(
ethereum
,
RpcPort
)
utils
.
StartRpc
(
ethereum
,
Rpc
ListenAddress
,
Rpc
Port
)
}
}
if
StartWebSockets
{
if
StartWebSockets
{
...
...
cmd/utils/cmd.go
View file @
f6e821fd
...
@@ -160,9 +160,9 @@ func KeyTasks(keyManager *crypto.KeyManager, KeyRing string, GenAddr bool, Secre
...
@@ -160,9 +160,9 @@ func KeyTasks(keyManager *crypto.KeyManager, KeyRing string, GenAddr bool, Secre
clilogger
.
Infof
(
"Main address %x
\n
"
,
keyManager
.
Address
())
clilogger
.
Infof
(
"Main address %x
\n
"
,
keyManager
.
Address
())
}
}
func
StartRpc
(
ethereum
*
eth
.
Ethereum
,
RpcPort
int
)
{
func
StartRpc
(
ethereum
*
eth
.
Ethereum
,
Rpc
ListenAddress
string
,
Rpc
Port
int
)
{
var
err
error
var
err
error
ethereum
.
RpcServer
,
err
=
rpchttp
.
NewRpcHttpServer
(
xeth
.
New
(
ethereum
),
RpcPort
)
ethereum
.
RpcServer
,
err
=
rpchttp
.
NewRpcHttpServer
(
xeth
.
New
(
ethereum
),
Rpc
ListenAddress
,
Rpc
Port
)
if
err
!=
nil
{
if
err
!=
nil
{
clilogger
.
Errorf
(
"Could not start RPC interface (port %v): %v"
,
RpcPort
,
err
)
clilogger
.
Errorf
(
"Could not start RPC interface (port %v): %v"
,
RpcPort
,
err
)
}
else
{
}
else
{
...
...
rpc/http/server.go
View file @
f6e821fd
...
@@ -29,8 +29,8 @@ import (
...
@@ -29,8 +29,8 @@ import (
var
rpchttplogger
=
logger
.
NewLogger
(
"RPC-HTTP"
)
var
rpchttplogger
=
logger
.
NewLogger
(
"RPC-HTTP"
)
var
JSON
rpc
.
JsonWrapper
var
JSON
rpc
.
JsonWrapper
func
NewRpcHttpServer
(
pipe
*
xeth
.
XEth
,
port
int
)
(
*
RpcHttpServer
,
error
)
{
func
NewRpcHttpServer
(
pipe
*
xeth
.
XEth
,
address
string
,
port
int
)
(
*
RpcHttpServer
,
error
)
{
sport
:=
fmt
.
Sprintf
(
"
127.0.0.1:%d"
,
port
)
sport
:=
fmt
.
Sprintf
(
"
%s:%d"
,
address
,
port
)
l
,
err
:=
net
.
Listen
(
"tcp"
,
sport
)
l
,
err
:=
net
.
Listen
(
"tcp"
,
sport
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
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