IoTone / TheShellProject

The Shell Project aims to build a viable general purpose blockchain written in Dlang, with attributes of security, ease of deployment, clear specification, ease of use for DAPPs, and multiple implementation interop
1 stars 1 forks source link

Project needs a simple persistent datastore #4

Closed truedat101 closed 6 years ago

truedat101 commented 6 years ago

We can assume each client needs a small database for persistence. Please integrate leveldb for this purpose:

http://code.dlang.org/packages/d-leveldb

Please add to package.json. Add a sample use of this in the main app. Add a unit test to verify the integration.

truedat101 commented 6 years ago

This d-leveldb turned out to be trash, old, crashes.

truedat101 commented 6 years ago

Try out rocksdb. Need to figure out the build.

truedat101 commented 6 years ago

Need to get a rocksdb build done, and figure out a "clean" way to make this something that someone can do easily. Perhaps we need to add cmake?

truedat101 commented 6 years ago

Rocks install info: https://github.com/facebook/rocksdb/blob/master/INSTALL.md

truedat101 commented 6 years ago

So many packages are not well documented.

rocksdb just says have a library.

It is looking for leveldb.lib . If it finds it, I get:

.dub\build\shell-d-test-library-unittest-windows-x86_64-ldc_2077-058ABF0C1E61DA99DBEE00E965C6CA1F\shell-d-test-library.exe : fatal error LNK1120: 14 unresolved externals Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\link.exe failed with status: 1120 ldc2 failed with exit code 1120.

truedat101 commented 6 years ago

Either this build file issue, or the version of the library I built using vcpkg: .\vcpkg install rocksdb:x64-windows

is bad.

truedat101 commented 6 years ago

In fact, who knows what version of the vcpkg I got.

truedat101 commented 6 years ago

I'll file a bug against the rocksdb package to find out what version of rocksdb to use.

BTW, to build rocksdb on windows, use this: https://github.com/facebook/rocksdb/

and then

mkdir build && cmake -G "Visual Studio 15 2017 Win64" ..

Make sure to do this with the Win64 otherwise you get a broken package for a win64 target.

truedat101 commented 6 years ago

Rocksdb for d is here: https://github.com/b1naryth1ef/rocksdb

truedat101 commented 6 years ago

Filed a bug on that module: https://github.com/b1naryth1ef/rocksdb/issues/2

truedat101 commented 6 years ago

In the meantime, just building whatever master version of rocksdb for windows. This sucks. Everything is a bit easier on the not-windows.

truedat101 commented 6 years ago

Will check in on the build tomorrow. Why it's such a huge build for rocks db I don't know.

truedat101 commented 6 years ago

I'll add some dummy persistence layer right now.

truedat101 commented 6 years ago

I'm moving this out to proto2.

truedat101 commented 6 years ago

Moving it back.

truedat101 commented 6 years ago

@pedroalvesbatista you will need to run setup-deps.sh , make sure it grabs the rocksdb code, and you will need to manually build rocksdb (using cmake), and copy the rocksdb.so into your root of the project.

truedat101 commented 6 years ago

This gives us persistence. I've added an example into persistence.d.

truedat101 commented 6 years ago

We can work out better how to handle external deps later with cmake.