aboutsummaryrefslogtreecommitdiffstats
path: root/database.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-11 05:44:53 +0800
committerobscuren <geffobscura@gmail.com>2014-01-11 05:44:53 +0800
commit8bbf879cb31e9cb28700773ed788421f9935ac36 (patch)
treeea2ab662a0577aa6238b084eda7ec9644ee35995 /database.go
parentf6fa4f88797030b8e83066cb262a68958953974e (diff)
downloadgo-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.gz
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.zst
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.zip
Moving the ethgo to individual packages
Diffstat (limited to 'database.go')
-rw-r--r--database.go56
1 files changed, 0 insertions, 56 deletions
diff --git a/database.go b/database.go
deleted file mode 100644
index b147756b6..000000000
--- a/database.go
+++ /dev/null
@@ -1,56 +0,0 @@
-package main
-
-import (
- "path"
- "os/user"
- "github.com/syndtr/goleveldb/leveldb"
- "fmt"
-)
-
-type LDBDatabase struct {
- db *leveldb.DB
- trie *Trie
-}
-
-func NewLDBDatabase() (*LDBDatabase, error) {
- // This will eventually have to be something like a resource folder.
- // it works on my system for now. Probably won't work on Windows
- usr, _ := user.Current()
- dbPath := path.Join(usr.HomeDir, ".ethereum", "database")
-
- // Open the db
- db, err := leveldb.OpenFile(dbPath, nil)
- if err != nil {
- return nil, err
- }
-
- database := &LDBDatabase{db: db}
-
- // Bootstrap database. Sets a few defaults; such as the last block
- database.Bootstrap()
-
- return database, nil
-}
-
-func (db *LDBDatabase) Bootstrap() error {
- //db.trie = NewTrie(db)
-
- return nil
-}
-
-func (db *LDBDatabase) Put(key []byte, value []byte) {
- err := db.db.Put(key, value, nil)
- if err != nil {
- fmt.Println("Error put", err)
- }
-}
-
-func (db *LDBDatabase) Get(key []byte) ([]byte, error) {
- return nil, nil
-}
-
-func (db *LDBDatabase) Close() {
- // Close the leveldb database
- db.db.Close()
-}
-