Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions api/api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This component is a Node.JS server that implements
API handler methods to support the Block Explorer
API handler methods to support the Bus Explorer
Web UI.
*/
import express from 'express';
Expand All @@ -16,8 +16,7 @@ import geoip from 'geoip-lite';
import YAML from 'yaml';
import fs from 'fs';
import assert from 'assert';
//import * as solanaWeb3 from '@solana/web3.js';
import * as bitconchWeb3 from '@bitconch/bitconch-web3j';
import * as web3 from '@bitconch/bitconch-web3j';

import config from './config';

Expand All @@ -28,7 +27,7 @@ let FULLNODE_URL = 'http://localhost:10099';

const app = express();

const port = 8961;
const port = 8960;
const MINUTE_MS = 60 * 1000;

function getClient() {
Expand Down Expand Up @@ -405,11 +404,9 @@ function sendAccountResult(req, res) {

let thePromises = _.map(ids, id => {
return new Promise(resolve => {
//const connection = new solanaWeb3.Connection(FULLNODE_URL);
const connection = new bitconchWeb3.Connection(FULLNODE_URL);
const connection = new web3.Connection(FULLNODE_URL);
return connection
// .getBalance(new solanaWeb3.PublicKey(id))
.getBalance(new bitconchWeb3.PublicKey(id))
.getBalance(new web3.PublicKey(id))
.then(balance => {
return resolve({id: id, balance: balance});
});
Expand Down
2 changes: 1 addition & 1 deletion api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
unixds: true,
host: '127.0.0.1',
port: 7654,
socket: '/tmp/bitconch-blockstream.sock',
socket: '/bitconch/tmp/bitconch-blockstream.sock',
},
redis: {
host: '127.0.0.1',
Expand Down
3 changes: 1 addition & 2 deletions api/inbound-stream.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
This component is a Node.JS service that listens for events from
the Solana EntryStream class. It runs a main event loop listening to
the Bitconch EntryStream class. It runs a main event loop listening to
a TCP, UDP, and/or Unix Domain Socket and dispatches events to one
or more handlers (typically Redis for event aggregation and realtime
streaming).
Expand All @@ -9,7 +9,6 @@ import Base58 from 'base-58';
import dgram from 'dgram';
import net from 'net';
import redis from 'redis';
//import {Transaction} from '@solana/web3.js';
import {Transaction} from '@bitconch/bitconch-web3j';
import _ from 'lodash';
import fs from 'fs';
Expand Down
73 changes: 73 additions & 0 deletions bin/blockexplorer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env bash
set -e

cwd=$PWD

rootDir=$(
cd "$(dirname "$0")";
node -p '
try {
let package_json = [
"../lib/node_modules/@bitconch/bus-explorer/package.json",
"../@bitconch/bus-explorer/package.json",
"../package.json"
].find(require("fs").existsSync);

assert(
require(package_json)["name"] === "@bitconch/bus-explorer",
"Invalid package name in " + package_json
);

const path = require("path");
path.resolve(path.dirname(package_json))
} catch (err) {
throw new Error("Unable to locate bus-explorer directory: " + String(err));
}
'
)
cd "$rootDir"

if [[ ! -d build || ! -f build/api/api.js ]]; then
echo "Error: build/ artifacts missing. Run |yarn run build| to create them"
exit 1
fi

cleanup() {
set +e
for pid in "$api" "$ui"; do
[[ -z $pid ]] || kill "$pid"
done
exit 1
}
trap cleanup SIGINT SIGTERM ERR

(
set -x
redis-cli ping
)

rm -f "$cwd"/bitconch-bus-explorer-{api,ui}.log

api=
ui=
while true; do
if [[ -z $api ]] || ! kill -0 "$api"; then
logfile="$cwd"/bitconch-bus-explorer-api.log
echo "Starting api process (logfile: $logfile)"
date | tee -a "$logfile"
npm run start-prod:api >> "$logfile" 2>&1 &
api=$!
echo " pid: $api"
fi

if [[ -z $ui ]] || ! kill -0 "$ui"; then
logfile="$cwd"/bitconch-bus-explorer-ui.log
echo "Starting ui process (logfile: $logfile)"
date | tee -a "$logfile"
npm run start-prod:ui >> "$logfile" 2>&1 &
ui=$!
echo " pid: $ui"
fi

sleep 1
done
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bitconch/bus-explorer",
"version": "0.0.0-development",
"version": "1.1.2-development",
"license": "MIT",
"author": "Bitconch Labs, Inc",
"homepage": "http://bitconch.io/",
Expand All @@ -12,12 +12,12 @@
"url": "https://github.com/bitconch/bus-explorer/issues "
},
"dependencies": {
"@bitconch/bitconch-web3j": "1.1.2",
"@bitconch/bitconch-web3j":"bitconch/bitconch-web3j#master",
"babel-plugin-transform-runtime": "^6.23.0",
"base-58": "^0.0.1",
"copy-to-clipboard": "^3.2.0",
"cors": "^2.8.5",
"express": "^4.16.4",
"express": "^4.17.0",
"express-ws": "^4.0.0",
"geoip-lite": "^1.3.7",
"google-map-react": "^1.1.4",
Expand All @@ -27,7 +27,7 @@
"react-debounce-render": "^5.0.0",
"redis": "^2.8.0",
"serve": "^11.0.0",
"yaml": "^1.5.1"
"yaml": "^1.6.0"
},
"devDependencies": {
"@material-ui/core": "^3.9.3",
Expand All @@ -45,7 +45,7 @@
"eslint-plugin-react": "^7.13",
"history": "^4.9.0",
"moment": "^2.24.0",
"prettier": "^1.17.0",
"prettier": "^1.17.1",
"qrcode.react": "^0.9.3",
"react": "^16.8.6",
"react-chartjs-2": "^2.7.6",
Expand All @@ -69,7 +69,7 @@
"prepack": "set -ex; npm run lint; npm run build",
"pretty": "prettier --write '{,{api,src}/**/}*.js{,x}'",
"start:api": "PORT=8960 set -ex; redis-cli ping; babel-node --presets env api/api.js",
"start:ui": "PORT=8961 react-scripts start",
"start:ui": "HTTPS=true&&PORT=8961 react-scripts start",
"start-prod:api": " node build/api/api.js",
"start-prod:ui": "serve -s build",
"test:ui": "react-scripts test"
Expand Down
55 changes: 55 additions & 0 deletions public/bitconch-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions public/bitconch-logo1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/bitconch_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon.ico
Binary file not shown.
Binary file added public/images/guide.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/block-height.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/block-price.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/block-tps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/ent-leader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/entry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/last-dt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/tick-height.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/transaction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon/txn-count.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<meta name="theme-color" content="#f4f5f9" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Bitconch Block Explorer</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
15 changes: 15 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "Bitconch Block Explorer",
"name": "Bitconch Block Explorer",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
/*"theme_color": "#000000",*/
"background_color": "#f4f5f9"
}
27 changes: 27 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
body {
background-color: #f4f5f9;
}

.App {
text-align: center;
}

.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
}

.App-header {
/*background-color: #282c34;*/
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}
Loading