Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
93f9ed73
Unverified
Commit
93f9ed73
authored
Sep 08, 2019
by
kladkogex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added database init
parent
8346a462
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
LevelDB.h
LevelDB.h
+5
-2
Makefile.am
Makefile.am
+2
-2
SGXWalletServer.cpp
SGXWalletServer.cpp
+6
-0
ServerInit.cpp
ServerInit.cpp
+9
-5
No files found.
LevelDB.h
View file @
93f9ed73
...
...
@@ -22,8 +22,11 @@
*/
#ifndef TESTW_LEVELDB_H
#define TESTW_LEVELDB_H
#ifndef SGXWALLET_LEVELDB_H
#define SGXWALLET_LEVELDB_H
#include <memory>
#include <string>
namespace
leveldb
{
class
DB
;
...
...
Makefile.am
View file @
93f9ed73
...
...
@@ -65,7 +65,7 @@ bin_PROGRAMS = sgxwallet testw
COMMON_SRC
=
sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
COMMON_ENCLAVE_SRC
=
secure_enclave_u.c secure_enclave_u.h
sgxwallet_SOURCES
=
sgxwallet.c SGXWalletServer.cpp BLSCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp LevelDB.cpp
$(COMMON_SRC)
sgxwallet_SOURCES
=
sgxwallet.c SGXWalletServer.cpp BLSCrypto.cpp ServerInit.cpp
LevelDB.cpp
BLSPrivateKeyShareSGX.cpp LevelDB.cpp
$(COMMON_SRC)
nodist_sgxwallet_SOURCES
=
$(COMMON_ENCLAVE_SRC)
EXTRA_sgxwallet_DEPENDENCIES
=
secure_enclave.signed.so
...
...
@@ -90,7 +90,7 @@ secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
sgxwallet_LDADD
=
-l
$(SGX_URTS_LIB)
-Lleveldb
/build
-LlibBLS
/build
-LlibBLS
/build/libff/libff
-l
:libbls.a
-l
:libleveldb.a
-l
:libff.a
-lgmp
-ldl
-l
:libsgx_capable.a
-l
:libsgx_tprotected_fs.a
-ljsonrpccpp-stub
-lpthread
-ljsonrpccpp-common
-ljsonrpccpp-server
-ljsoncpp
-lprocps
testw_SOURCES
=
testw.cpp SGXWalletServer.cpp BLSCrypto.cpp ServerInit.cpp BLSPrivateKeyShareSGX.cpp
$(COMMON_SRC)
testw_SOURCES
=
testw.cpp SGXWalletServer.cpp BLSCrypto.cpp ServerInit.cpp
LevelDB.cpp
BLSPrivateKeyShareSGX.cpp
$(COMMON_SRC)
nodist_testw_SOURCES
=
${
nodist_sgxwallet_SOURCES
}
EXTRA_testw_DEPENDENCIES
=
${
EXTRA_sgxwallet_DEPENDENCIES
}
testw_LDADD
=
${
sgxwallet_LDADD
}
\ No newline at end of file
SGXWalletServer.cpp
View file @
93f9ed73
...
...
@@ -20,10 +20,16 @@
#include "SGXWalletServer.h"
#include "LevelDB.h"
using
namespace
jsonrpc
;
using
namespace
std
;
class
SGXWalletServer
:
public
AbstractStubServer
{
public
:
SGXWalletServer
(
AbstractServerConnector
&
connector
,
serverVersion_t
type
);
...
...
ServerInit.cpp
View file @
93f9ed73
...
...
@@ -23,6 +23,8 @@
#include "sgxwallet.h"
#include "LevelDB.h"
#include "SGXWalletServer.h"
#include "BLSCrypto.h"
...
...
@@ -30,16 +32,18 @@
LevelDB
*
levelDb
=
nullptr
;
void
init_daemon
()
{
libff
::
init_alt_bn128_params
();
// Set up database connection information and open database
leveldb
::
DB
*
db
;
leveldb
::
Options
options
;
options
.
create_if_missing
=
true
;
static
std
::
string
dbName
(
"./sgxwalletdb"
);
level
db
::
Status
status
=
leveldb
::
DB
::
Open
(
options
,
"./keysdb"
,
&
db
);
level
Db
=
new
LevelDB
(
dbName
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment