Random vote generator based on property-based testing
We recommend using conda to manage python environment.
conda create -n "resdb" python=3.10.0 ipython
conda activate resdb
pip install -r requirements.txtTo save some time, we also provide a docker image that has all the dependencies installed.
docker pull yfhecs/rsdb
docker run -d -p 18000:18000 --name resdb yfhecs/rsdbIf you choose to use docker, you can skip the following steps. Please wait a few minutes for the docker container to start. You can check if it is ready by the follow command:
❯ curl -X POST -d '{"id":"key1","value":"value1"}' localhost:18000/v1/transactions/commit
id: key1
❯ curl 127.0.0.1:18000/v1/transactions/key1
{"id":"key1","value":"value1"}You can also find the related dockerfile in the ./docker directory.
The following commands will clone and build ResilientDB, and then starts 4 replicas and 1 client. Each replica instantiates a key-value store.
git clone https://github.com/apache/incubator-resilientdb.git resilientdb
cd resilientdb
./INSTALL.sh
./service/tools/kv/server_tools/start_kv_service.shgit clone https://github.com/apache/incubator-resilientdb-graphql.git resilientdb-graphql
cd resilientdb-graphql
sh ./INSTALL.sh
pip install -r requirements.txtbazel build service/http_server/crow_service_main
bazel-bin/service/http_server/crow_service_main service/tools/config/interface/client.config service/http_server/server_config.configpython test_driver.py source ./env.sh
python app/serve.pysource ./env.sh
python app/tui.py- start the express server with
node expressMiddleware/express.js - cd into resVote2.0 (
cd resVote2.0) and runnpm start
- Note: Make sure you have resVault set up on chrome. Currently I have mongo synced to main-net for resDB so connect to it.
- I don't know whether or not this will cause duplicates in mongoDB
- To sync your mongoDB, change the mongoURI in
expressMiddleware/express.jsandresVote2.0/src/mongoDB/sync.js- Run sync.js to populate the transactions into your DB
- Then run express.js to field requests from
resVote2.0/src/mongoDB/mongoAPI.js