Skip to content
A blockchain explorer cache server for CITA
Branch: develop
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
app
bin Custom to api only structure Oct 29, 2018
config
db
docker
lib
log init project Jun 11, 2018
public
spec
tmp init project Jun 11, 2018
vendor
.dockerignore Add sidekiq and redis to docker compose. Nov 22, 2018
.env Change loop interval Jan 18, 2019
.env.test fix test db host Aug 24, 2018
.env.test.local.travis
.gitignore Add sidekiq and redis to docker compose. Nov 22, 2018
.pryrc
.rspec add rspec test suites Jul 13, 2018
.rubocop.yml
.ruby-gemset.sample
.ruby-version
.travis.yml
.yardopts
API_DOC.md Split API Doc to a single file Feb 27, 2019
Gemfile Update rails to fix security problem Mar 14, 2019
Gemfile.lock
LICENSE
Makefile Don't enable experimental for secp256k1, create pids dir before start… Nov 30, 2018
README-CN.md Add Chinese version of README Feb 27, 2019
README.md
Rakefile
config.ru add rubocop and fix Sep 21, 2018
docker-compose.yml

README.md

ReBirth

Build Status codecov Documentation

English | 简体中文

A blockchain explorer cache server for CITA.

Now upgrade to work with CITA v0.20

⚠️ NOTE: If you upgrade your chain to 0.18 from 0.17, after upgrade, you should stop sync task(rake daemons:sync:stop) and run rake zero18:update to update your old data, and start your sync task (rake daemons:sync:start), then restart your server 😄

⚠️ NOTE: when update this version, you should run bundle exec rake event_logs:fix_old to sync event logs that it's transaction already saved.

⚠️ NOTE: add errorMessage to transactions, run bundle exec rake transactions:add_error_message to add.

⚠️ NOTE: If you upgrade your chain to 0.20, after upgrade, you should stop sync task(rake daemons:sync:stop) and run rake zero20:update to update your old data, and start your sync task (rake daemons:sync:start), then restart your server

Docker

If you just want to run this, just use docker 🐳

Remember to run rails secret to generate secret key and write in .env.local (read .env for more info) Remember to change your sidekiq username and password in .env.local

⚠️ IMPORTANT: your database data will save at docker/data

⚠️ IMPORTANT: your redis data will save at docker/redis

App will run at http://localhost:8888

$ make setup # run this when you first run this app
$ make up # this command will run docker daemon.
$ make update # when you update the app.

you can get more info from Makefile

Packages

  • postgresql 9.4 and above

  • install secp256k1

    $ cd re-birth/tmp && git clone https://github.com/bitcoin-core/secp256k1.git && cd secp256k1 && ./autogen.sh && ./configure --enable-module-recovery && make && sudo make install && cd ../..

Initial Project

$ bundle
$ touch .env.local (overwrite `.env` config if you need in `.env.local`, such as DB_USERNAME, DB_PASSWORD and CITA_URL...)
$ rails db:setup (or rails db:create db:migrate db:seed)

Running Test

$ touch .env.test.local (test env will not read `.env.local` file, overwrite in `.env.test.local`)
$ rails spec

Run Project

$ rails s

# start sync process
$ rails daemons:sync:start
# run `rails daemons:sync:stop` to stop it
# run `rails daemons:sync:restart` to restart it
# run `rails daemons:sync:status` to see status

Event Log Processor

Create a yaml file with .yml suffix in config/customs, see config/customs/event_log.yml.sample for more detail. For example, your file name is contracts.yml, you can run bundle exec rake event_log:create[contracts] to create your table and now restart sync task bundle exec rake daemons:sync:restart to listen your contact 😝

We'll both use address and topics to select the logs by jsonrpc interface getLogs

Deploy

You can deploy this via mina

# replace `dev` with you env
$ mina dev deploy
$ mina dev 'rake[daemons:sync:start]'

Build Doc

$ bundle exec yard doc
$ bundle exec yard server

API Doc

See API Doc

You can’t perform that action at this time.