-
Notifications
You must be signed in to change notification settings - Fork 3
Home
chmwang edited this page Oct 5, 2018
·
2 revisions
Nebulas rank offline service
Compile and install nebulas, tutorial here.
- Cpp boost library, Boost version >= 1.67.0
- Compiler, LLVM/Clang++ version >= 6.0.0
- Python version 2.7
- Python restful api framework, Flask version >= 1.0.2
- Arangodb version >= 3.3.14
- Arangodb c++ driver fuerte, branch makeFuerteGreateAgain
- Arangodb serialization and storage format, velocypack
- Arangodb python driver, python-arango
- Http-parser version >= 2.8.1
$ git clone https://github.com/nebulasio/nr-service.git
$ git submodule update --init
$ cd nr-service/cpp
$ ./prepare.shWhen running with prepare.sh, it will take a long time to compile, build and install depencencies, just be patient.
$ sudo dpkg -i 3rd_party/arangodb3-3.3.16-1_amd64.deb$ sudo pip install python-arango$ sudo pip install Flask
$ sudo pip install flask-restful$ source env.set.sh$ cd /path/to/nr-service
$ mkdir build && cd build
$ cmake .. && make$ cd path/to/go-nebulas
$ ./neb -c mainnet/conf/config.confWait until nebulas node syncs blocks from genesis block to the latest, it takes days or week.
$ arangod --server.endpoint http+tcp://127.0.0.1:8529$ cd path/to/nr-service
$ python python/arango/arango_graph.py
$ ./cpp/bin/transaction_writerRunning transaction_writer in directory $PATH_TO_NR-SERVICE/cpp/bin will build transaction graph to arangodb colelctions from nebulas node (genesis block to the latest), also takes days or week.
$ cd path/to/nr-servie
$ ./cpp/bin/nr --start_ts=xx --end_ts=xxBuild nr db collection from start timestamp to end timestamp with day interval.
$ cd path/to/nr-service
$ python python/api/api.py$ curl -s "http://localhost:6000/nebulas-transaction?start_block=400100&end_block=400200"
$ curl -s "http://localhost:6000/nebulas-transaction?address=n1Q6JhXKWXCkyvoqymN4LPd6J1tentyKRVF"$ curl -s "http://localhost:6000/nebulas-nr?date=20180620"