rpc: add dataDir parameter and JSON-RPC handler

This commit is contained in:
Felix Lange
2015-03-09 23:00:27 +01:00
parent 73d1ebe244
commit a11f1d6a7e
5 changed files with 64 additions and 17 deletions

View File

@@ -11,6 +11,7 @@ package rpc
import (
"fmt"
"math/big"
"path"
"strings"
"sync"
"time"
@@ -55,8 +56,8 @@ type EthereumApi struct {
defaultBlockAge int64
}
func NewEthereumApi(eth *xeth.XEth) *EthereumApi {
db, _ := ethdb.NewLDBDatabase("dapps")
func NewEthereumApi(eth *xeth.XEth, dataDir string) *EthereumApi {
db, _ := ethdb.NewLDBDatabase(path.Join(dataDir, "dapps"))
api := &EthereumApi{
eth: eth,
mux: eth.Backend().EventMux(),