├── .gitignore ├── Dockerfile └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | .idea/ 39 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for Hyperledger blockchain-explorer image 2 | # Workdir is set to /blockchain-explorer/explorer_1 3 | # env: 4 | # HTTP_PORT= 5 | # HYP_REST_ENDPOINT= 6 | 7 | FROM node:6-wheezy 8 | MAINTAINER Baohua Yang 9 | 10 | EXPOSE 8080 11 | 12 | # install maintain tools 13 | #RUN npm install bower grunt-cli graceful-fs@4.1.5 minimatch@3.0.2 -g 14 | 15 | # clone latest code from github 16 | RUN git clone --single-branch -b master --depth 1 https://github.com/hyperledger/blockchain-explorer 17 | 18 | WORKDIR /blockchain-explorer 19 | 20 | #RUN echo '{ "allow_root": true }' > /root/.bowerrc 21 | RUN echo '{ "allow_root": true }' > .bowerrc 22 | 23 | # Modify config.json to update the value of channels/mysql/tls 24 | # Or just mount external one inside 25 | 26 | RUN npm install 27 | 28 | VOLUME /blockchain-explorer 29 | 30 | CMD ["bash", "start.sh"] 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Docker-Blockchain-Explorer 2 | === 3 | Docker images for [Hyperledger Blockchain Explorer](https://github.com/hyperledger/blockchain-explorer). 4 | 5 | # Supported tags and respective Dockerfile links 6 | 7 | * [`latest` (latest/Dockerfile)](https://github.com/yeasy/docker-blockchain-explorer/blob/master/Dockerfile): Default to use latest code on master branch. 8 | 9 | For more information about this image and its history, please see the relevant manifest file in the [`yeasy/docker-blockchain-explorer` GitHub repo](https://github.com/yeasy/docker-blockchain-explorer). 10 | 11 | If you want to quickly deploy a local cluster with explorer enabled, please refer to [Start hyperledger cluster using Compose](https://github.com/yeasy/docker-compose-files#hyperledger). 12 | 13 | # What is docker-blockchain-explorer? 14 | Docker image with an web-UI explorer for a running hyperledger chain. 15 | 16 | # How to use this image? 17 | The docker image is auto built at [https://registry.hub.docker.com/u/yeasy/blockchain-explorer/](https://registry.hub.docker.com/u/yeasy/blockchain-explorer/). 18 | 19 | ## In Dockerfile 20 | ```sh 21 | FROM yeasy/blockchain-explorer:latest 22 | ``` 23 | 24 | ## Local Run 25 | 26 | ### Quick start 27 | 28 | The easiest way to start a explorer is just run 29 | 30 | ```sh 31 | $ docker run -d yeasy/blockchain-explorer 32 | ``` 33 | 34 | It will listen on `:9090`, and try connect to `127.0.0.1:7050` as the hyperledger fabric rest api url. 35 | 36 | ### With configuration 37 | 38 | Environment variables are supported: 39 | 40 | * HTTP_PORT= 41 | * HYP_REST_ENDPOINT= 42 | 43 | E.g., suppose the hyperledger rest api url is `http://172.17.0.2:7050`. 44 | 45 | ```sh 46 | $ docker run -p 9090:9090 -e HYP_REST_ENDPOINT=http://172.17.0.2:7050 yeasy/blockchain-explorer 47 | ``` 48 | 49 | # Which image is based on? 50 | The image is built based on [node:6-wheezy](https://hub.docker.com/r/library/node/) base image. 51 | 52 | # What has been changed? 53 | ## Install dependencies 54 | Install required tools 55 | ```sh 56 | $ npm install npm bower grunt-cli graceful-fs@4.1.5 minimatch@3.0.2 -g 57 | $ apk update && apk add git 58 | ``` 59 | 60 | ## Clone code from github and install dependencies 61 | ```sh 62 | $ git clone https://github.com/hyperledger/blockchain-explorer 63 | $ cd blockchain-explorer/explorer_1 64 | $ npm install grunt grunt-auto-install grunt-contrib-uglify grunt-contrib-copy 65 | $ grunt 66 | ``` 67 | 68 | ## Start the project 69 | 70 | ```sh 71 | $ node exp-server.js 72 | ``` 73 | 74 | # Supported Docker versions 75 | 76 | This image is officially supported on Docker version 1.9.0+. 77 | 78 | Support for older versions (down to 1.0) is provided on a best-effort basis. 79 | 80 | # Known Issues 81 | * N/A. 82 | 83 | # User Feedback 84 | ## Documentation 85 | Be sure to familiarize yourself with the [repository's `README.md`](https://github.com/yeasy/docker-blockchain-explorer/blob/master/README.md) file before attempting a pull request. 86 | 87 | ## Issues 88 | If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/yeasy/docker-blockchain-explorer/issues). 89 | 90 | You can also reach many of the official image maintainers via the email. 91 | 92 | ## Contributing 93 | 94 | You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can. 95 | 96 | Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/yeasy/docker-blockchain-explorer/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing. 97 | --------------------------------------------------------------------------------