Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
5c25403b
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5c25403b
编写于
6月 16, 2015
作者:
B
Bas van Kervel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactored old rpc structure to new
上级
fd764d4f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
4 deletion
+20
-4
cmd/geth/main.go
cmd/geth/main.go
+1
-0
cmd/utils/flags.go
cmd/utils/flags.go
+15
-4
rpc/api/api.go
rpc/api/api.go
+4
-0
未找到文件。
cmd/geth/main.go
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录