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
5c25403b
Commit
5c25403b
authored
Jun 16, 2015
by
Bas van Kervel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored old rpc structure to new
parent
fd764d4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
main.go
cmd/geth/main.go
+1
-0
flags.go
cmd/utils/flags.go
+15
-4
api.go
rpc/api/api.go
+4
-0
No files found.
cmd/geth/main.go
View file @
5c25403b
...
...
@@ -239,6 +239,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils
.
RPCEnabledFlag
,
utils
.
RPCListenAddrFlag
,
utils
.
RPCPortFlag
,
utils
.
RpcApiFlag
,
utils
.
IPCDisabledFlag
,
utils
.
IPCApiFlag
,
utils
.
IPCPathFlag
,
...
...
cmd/utils/flags.go
View file @
5c25403b
...
...
@@ -22,7 +22,6 @@ import (
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc/api"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/comms"
...
...
@@ -209,13 +208,18 @@ var (
Usage
:
"Domain on which to send Access-Control-Allow-Origin header"
,
Value
:
""
,
}
RpcApiFlag
=
cli
.
StringFlag
{
Name
:
"rpcapi"
,
Usage
:
"Specify the API's which are offered over the HTTP RPC interface"
,
Value
:
api
.
DefaultHttpRpcApis
,
}
IPCDisabledFlag
=
cli
.
BoolFlag
{
Name
:
"ipcdisable"
,
Usage
:
"Disable the IPC-RPC server"
,
}
IPCApiFlag
=
cli
.
StringFlag
{
Name
:
"ipcapi"
,
Usage
:
"Specify the API's which are offered over th
is
interface"
,
Usage
:
"Specify the API's which are offered over th
e IPC
interface"
,
Value
:
api
.
DefaultIpcApis
,
}
IPCPathFlag
=
DirectoryFlag
{
...
...
@@ -457,14 +461,21 @@ func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
}
func
StartRPC
(
eth
*
eth
.
Ethereum
,
ctx
*
cli
.
Context
)
error
{
config
:=
rpc
.
Rpc
Config
{
config
:=
comms
.
Http
Config
{
ListenAddress
:
ctx
.
GlobalString
(
RPCListenAddrFlag
.
Name
),
ListenPort
:
uint
(
ctx
.
GlobalInt
(
RPCPortFlag
.
Name
)),
CorsDomain
:
ctx
.
GlobalString
(
RPCCORSDomainFlag
.
Name
),
}
xeth
:=
xeth
.
New
(
eth
,
nil
)
return
rpc
.
Start
(
xeth
,
config
)
codec
:=
codec
.
JSON
apis
,
err
:=
api
.
ParseApiString
(
ctx
.
GlobalString
(
RpcApiFlag
.
Name
),
codec
,
xeth
,
eth
)
if
err
!=
nil
{
return
err
}
return
comms
.
StartHttp
(
config
,
codec
,
apis
...
)
}
func
StartPProf
(
ctx
*
cli
.
Context
)
{
...
...
rpc/api/api.go
View file @
5c25403b
...
...
@@ -20,6 +20,10 @@ const (
)
var
(
DefaultHttpRpcApis
=
strings
.
Join
([]
string
{
EthApiName
,
NetApiName
,
Web3ApiName
,
},
","
)
// List with all API's which are offered over the IPC interface by default
DefaultIpcApis
=
strings
.
Join
([]
string
{
AdminApiName
,
EthApiName
,
DebugApiName
,
MinerApiName
,
NetApiName
,
...
...
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