aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2015-10-27 05:24:09 +0800
committerzelig <viktor.tron@gmail.com>2015-10-27 05:24:09 +0800
commit4d005a2c1d2929dc770acd3a2bfed59495c70557 (patch)
tree0442ccefd85cc8b692c2c58a5916bc997909657a /eth/backend.go
parent3b4ffacd0c63952ceda96b3fafb050c91e72b420 (diff)
downloadgo-tangerine-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.gz
go-tangerine-4d005a2c1d2929dc770acd3a2bfed59495c70557.tar.zst
go-tangerine-4d005a2c1d2929dc770acd3a2bfed59495c70557.zip
rpc api: eth_getNatSpec
* xeth, rpc: implement eth_getNatSpec for tx confirmations * rename silly docserver -> httpclient * eth/backend: httpclient now accessible via eth.Ethereum init-d via config.DocRoot * cmd: introduce separate CLI flag for DocRoot (defaults to homedir) * common/path: delete unused assetpath func, separate HomeDir func
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 6ce0d0eb0..ee857e146 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -35,6 +35,7 @@ import (
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/compiler"
+ "github.com/ethereum/go-ethereum/common/httpclient"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
@@ -106,6 +107,7 @@ type Config struct {
LogJSON string
VmDebug bool
NatSpec bool
+ DocRoot string
AutoDAG bool
PowTest bool
ExtraData []byte
@@ -249,6 +251,8 @@ type Ethereum struct {
GpobaseStepUp int
GpobaseCorrectionFactor int
+ httpclient *httpclient.HTTPClient
+
net *p2p.Server
eventMux *event.TypeMux
miner *miner.Miner
@@ -400,6 +404,7 @@ func New(config *Config) (*Ethereum, error) {
GpobaseStepDown: config.GpobaseStepDown,
GpobaseStepUp: config.GpobaseStepUp,
GpobaseCorrectionFactor: config.GpobaseCorrectionFactor,
+ httpclient: httpclient.New(config.DocRoot),
}
if config.PowTest {
@@ -702,6 +707,12 @@ func (self *Ethereum) StopAutoDAG() {
glog.V(logger.Info).Infof("Automatic pregeneration of ethash DAG OFF (ethash dir: %s)", ethash.DefaultDir)
}
+// HTTPClient returns the light http client used for fetching offchain docs
+// (natspec, source for verification)
+func (self *Ethereum) HTTPClient() *httpclient.HTTPClient {
+ return self.httpclient
+}
+
func (self *Ethereum) Solc() (*compiler.Solidity, error) {
var err error
if self.solc == nil {