From 7f46ed2d821e965fecad3a96727128dbc9be5c8f Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 16 Feb 2019 19:38:17 -0800 Subject: [PATCH] 0.0.3 --- .gitignore | 3 +++ README.md | 38 ++++++++++++++++++++++++++++---------- bin/blockexplorer.sh | 7 +++++-- package.json | 4 ++-- yarn.lock | 37 +++++++------------------------------ 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index fc10acad..34a0d3c1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ /.pnp .pnp.js +# yarn.lock is used instead +/package-lock.json + # testing /coverage diff --git a/README.md b/README.md index acd77883..00d9b2c8 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,8 @@ [travis-image]: https://api.travis-ci.org/solana-labs/blockexplorer.svg?branch=master [travis-url]: https://travis-ci.org/solana-labs/blockexplorer -# Working with Block Explorer - +# Solana Block Explorer ## Prerequisites - ### Redis * Ubuntu: `apt-get install redis-server` * MacOS: `brew install redis` @@ -16,13 +14,37 @@ * Install yarn (typically `npm install -g yarn`) ## Quick Start -Setup the workspace, ensure Redis is running +Ensure Redis is running with `redis-cli ping`. If the ping fails, start redis +with: ```bash -$ yarn $ redis-server & ``` -Start the API service and Web UI: +Then install the block explorer: +```bash +$ npm install -g @solana/blockexplorer +``` + +Build and run a local Solana node: +```bash +$ git clone https://github.com/solana-labs/solana.git +$ cd solana/ +$ cargo build --all +$ ./run.sh +``` + +In another terminal start the block explorer: +```bash +$ solana-blockexplorer +``` + +## Development Info +Setup the workspace: +```bash +$ yarn +``` + +Start the API service and Web UI manually with: ```bash $ yarn start:api $ yarn start:ui @@ -37,7 +59,3 @@ and if desired for UI testing: ```bash $ ./multinode-demo/client.sh --tx_count 40 --threads 2 -z 400 ``` - -## Running the production Web UI -$ yarn build:ui -$ PORT=80 npx serve -s build diff --git a/bin/blockexplorer.sh b/bin/blockexplorer.sh index a29184d2..a21c8126 100755 --- a/bin/blockexplorer.sh +++ b/bin/blockexplorer.sh @@ -1,13 +1,12 @@ #!/usr/bin/env bash set -e - rootDir=$( cd "$(dirname "$0")"; node -p ' let p; try { - p = require.resolve("../lib/node_modules/@solana/blockexplorer"); + p = require.resolve("../lib/node_modules/@solana/blockexplorer/package.json"); } catch (err) { p = require.resolve("../package.json"); } @@ -21,6 +20,10 @@ if [[ ! -d build || ! -f build/api/api.js ]]; then exit 1 fi +set -x + +redis-cli ping + node build/api/api.js & api=$! diff --git a/package.json b/package.json index 47fc3d92..67174d1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@solana/blockexplorer", - "version": "0.0.2", + "version": "0.0.3", "license": "MIT", "dependencies": { "@solana/web3.js": "^0.14.7", @@ -8,6 +8,7 @@ "cors": "^2.8.5", "express": "^4.16.4", "express-ws": "^4.0.0", + "ip": "^1.1.5", "lodash": "^4.17.11", "nocache": "^2.0.0", "redis": "^2.8.0" @@ -26,7 +27,6 @@ "eslint-plugin-import": "^2.16.0", "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-react": "^7.0", - "node-ip": "^0.1.2", "prettier": "^1.16.4", "qrcode.react": "^0.9.2", "react": "^16.7.0", diff --git a/yarn.lock b/yarn.lock index 6bb82bd8..f37e1569 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1568,18 +1568,18 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async@, async@^2.1.4, async@^2.5.0: +async@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= + +async@^2.1.4, async@^2.5.0: version "2.6.2" resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" integrity sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg== dependencies: lodash "^4.17.11" -async@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -3009,7 +3009,7 @@ color@^3.0.0: color-convert "^1.9.1" color-string "^1.5.2" -colors@^1.0.3, colors@^1.1.2: +colors@^1.1.2: version "1.3.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.3.tgz#39e005d546afe01e01f9c4ca8fa50f686a01205d" integrity sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg== @@ -7464,14 +7464,6 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-ip@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/node-ip/-/node-ip-0.1.2.tgz#3dacccacb3957c1f5a7f11dd6d724b16c3ab505b" - integrity sha1-PazMrLOVfB9afxHdbXJLFsOrUFs= - dependencies: - colors "^1.0.3" - node-localip "0.0.2" - node-libs-browser@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.0.tgz#c72f60d9d46de08a940dedbb25f3ffa2f9bbaa77" @@ -7501,14 +7493,6 @@ node-libs-browser@^2.0.0: util "^0.11.0" vm-browserify "0.0.4" -node-localip@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/node-localip/-/node-localip-0.0.2.tgz#1d408a116aeaa7c193194ffc8363d3fab3bc6a2c" - integrity sha1-HUCKEWrqp8GTGU/8g2PT+rO8aiw= - dependencies: - colors "^1.0.3" - wmic "0.0.7" - node-notifier@^5.2.1: version "5.4.0" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" @@ -11187,13 +11171,6 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -wmic@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/wmic/-/wmic-0.0.7.tgz#a491a1c6f910f6da368def294796694cf9689785" - integrity sha1-pJGhxvkQ9to2je8pR5ZpTPlol4U= - dependencies: - async "" - wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"