mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
readding eth/exp cross compatibility
This commit is contained in:
parent
57638f70e6
commit
9582754492
7 changed files with 48 additions and 3 deletions
|
|
@ -352,6 +352,26 @@ func (s *Ethereum) APIs() []rpc.API {
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: s.netRPCService,
|
Service: s.netRPCService,
|
||||||
Public: true,
|
Public: true,
|
||||||
|
}, {
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: NewPublicEthereumAPI(s),
|
||||||
|
Public: true,
|
||||||
|
}, {
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: NewPublicMinerAPI(s),
|
||||||
|
Public: true,
|
||||||
|
}, {
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux),
|
||||||
|
Public: true,
|
||||||
|
}, {
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: filters.NewPublicFilterAPI(s.ApiBackend, false),
|
||||||
|
Public: true,
|
||||||
},
|
},
|
||||||
}...)
|
}...)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ func (s *Service) login(in *json.Decoder, out *json.Encoder) error {
|
||||||
infos := s.server.NodeInfo()
|
infos := s.server.NodeInfo()
|
||||||
|
|
||||||
var network, protocol string
|
var network, protocol string
|
||||||
if info := infos.Protocols["eth"]; info != nil {
|
if info := infos.Protocols["exp"]; info != nil {
|
||||||
network = strconv.Itoa(info.(*eth.EthNodeInfo).Network)
|
network = strconv.Itoa(info.(*eth.EthNodeInfo).Network)
|
||||||
protocol = fmt.Sprintf("eth/%d", eth.ProtocolVersions[0])
|
protocol = fmt.Sprintf("eth/%d", eth.ProtocolVersions[0])
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,12 @@ func makeCompilerAPIs(solcPath string) []rpc.API {
|
||||||
Service: (*PublicCompilerAPI)(c),
|
Service: (*PublicCompilerAPI)(c),
|
||||||
Public: true,
|
Public: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: (*PublicCompilerAPI)(c),
|
||||||
|
Public: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Namespace: "admin",
|
Namespace: "admin",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
|
|
|
||||||
|
|
@ -2499,6 +2499,7 @@ function Web3 (provider) {
|
||||||
this._requestManager = new RequestManager(provider);
|
this._requestManager = new RequestManager(provider);
|
||||||
this.currentProvider = provider;
|
this.currentProvider = provider;
|
||||||
this.eth = new Eth(this);
|
this.eth = new Eth(this);
|
||||||
|
this.exp = this.eth;
|
||||||
this.db = new DB(this);
|
this.db = new DB(this);
|
||||||
this.shh = new Shh(this);
|
this.shh = new Shh(this);
|
||||||
this.net = new Net(this);
|
this.net = new Net(this);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ var Modules = map[string]string{
|
||||||
"chequebook": Chequebook_JS,
|
"chequebook": Chequebook_JS,
|
||||||
"debug": Debug_JS,
|
"debug": Debug_JS,
|
||||||
"eth": Eth_JS,
|
"eth": Eth_JS,
|
||||||
|
"exp": Eth_JS,
|
||||||
"miner": Miner_JS,
|
"miner": Miner_JS,
|
||||||
"net": Net_JS,
|
"net": Net_JS,
|
||||||
"personal": Personal_JS,
|
"personal": Personal_JS,
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,24 @@ func (s *LightEthereum) APIs() []rpc.API {
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: filters.NewPublicFilterAPI(s.ApiBackend, true),
|
Service: filters.NewPublicFilterAPI(s.ApiBackend, true),
|
||||||
Public: true,
|
Public: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: &LightDummyAPI{},
|
||||||
|
Public: true,
|
||||||
}, {
|
}, {
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: downloader.NewPublicDownloaderAPI(s.protocolManager.downloader, s.eventMux),
|
||||||
|
Public: true,
|
||||||
|
}, {
|
||||||
|
Namespace: "exp",
|
||||||
|
Version: "1.0",
|
||||||
|
Service: filters.NewPublicFilterAPI(s.ApiBackend, true),
|
||||||
|
Public: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
Namespace: "net",
|
Namespace: "net",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
Service: s.netRPCService,
|
Service: s.netRPCService,
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ const (
|
||||||
notificationBufferSize = 10000 // max buffered notifications before codec is closed
|
notificationBufferSize = 10000 // max buffered notifications before codec is closed
|
||||||
|
|
||||||
MetadataApi = "rpc"
|
MetadataApi = "rpc"
|
||||||
DefaultIPCApis = "admin,debug,eth,miner,net,personal,shh,txpool,web3"
|
DefaultIPCApis = "admin,debug,eth,exp,miner,net,personal,shh,txpool,web3"
|
||||||
DefaultHTTPApis = "eth,net,web3"
|
DefaultHTTPApis = "eth,exp,net,web3"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CodecOption specifies which type of messages this codec supports
|
// CodecOption specifies which type of messages this codec supports
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue