English | 简体中文
A blockchain explorer cache server for CITA.
Now only support CITA v0.22 and above.
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 😄
bundle exec rake event_logs:fix_old
to sync event logs that it's transaction already saved.
errorMessage
to transactions
, run bundle exec rake transactions:add_error_message
to add.
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
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
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
-
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 ../..
$ 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)
The default value of CITA_URL
is: localhost:1337
Please make sure that the cita blockchain is RUNNING
$ touch .env.test.local (test env will not read `.env.local` file, overwrite in `.env.test.local`)
$ rails spec
$ 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
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
You can deploy this via mina
# replace `dev` with you env
$ mina dev deploy
$ mina dev 'rake[daemons:sync:start]'
$ bundle exec yard doc
$ bundle exec yard server
##How to view log
Under log
folder you can the production.log
and sidekiq.log
file
log
├── production.log
└── sidekiq.log
See API Doc
open a new issue: https://github.com/citahub/re-birth/issues/new
with your version info
Read docs/tech_stack.md to know the programming languages, frameworks, and tools that developers use to build this software.
git clone git@github.com:citahub/re-birth.git
- coding style guide: https://rubystyle.guide
- linter: RuboCop
- code formatter: $ rubocop -x
- coding style guide: https://github.com/Haufe-Lexware/docker-style-guide
- formatter: https://www.fromlatest.io/
- best-practices: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
- coding style guide: https://style-guides.readthedocs.io/en/latest/makefile.html
- tutorial: https://makefiletutorial.com/
- conventions: https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
- best-practices: https://suva.sh/posts/well-documented-makefiles/
$ rails spec
GitHub Flow, Understanding the GitHub flow
use git-style-guide for Branches, Commits,Messages, Merging