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
This commit is contained in:
zelig
2015-10-26 22:24:09 +01:00
parent 3b4ffacd0c
commit 4d005a2c1d
14 changed files with 121 additions and 121 deletions

View File

@ -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 {