diff options
author | Felix Lange <fjl@twurst.com> | 2015-03-10 06:00:27 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-03-10 06:08:46 +0800 |
commit | a11f1d6a7ec2eaa1a348776072c49019368a5ef3 (patch) | |
tree | cd2d7e9c3ade2ea02462436a908ca1caf9c06de3 /rpc/api.go | |
parent | 73d1ebe244644c2d74a1c0c38a3b339e72140886 (diff) | |
download | go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.tar go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.tar.gz go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.tar.bz2 go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.tar.lz go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.tar.xz go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.tar.zst go-tangerine-a11f1d6a7ec2eaa1a348776072c49019368a5ef3.zip |
rpc: add dataDir parameter and JSON-RPC handler
Diffstat (limited to 'rpc/api.go')
-rw-r--r-- | rpc/api.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rpc/api.go b/rpc/api.go index 9c792dd61..c3aa7186b 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -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(), |