Code Monkey home page Code Monkey logo

ethereum-lite-explorer's Introduction

Ethereum Lite Explorer by Alethio

The Lite Explorer is a client-side only web application that connects directly to a Ethereum JSON RPC compatible node. This means you can have your own private Ethereum Explorer should you wish so. No need for servers, hosting or trusting any third parties to display chain data.

CircleCI Docker

WARNING v1.x.x is a breaking update from previous v0.x.x releases

NOTICE Please report any bugs using Github's issues

Contents

Technical Details

The project is built on a React/MobX and TypeScript stack, using the Alethio CMS, which allows us to add extensions dynamically through 3rd party plugins. The basic functionality of the explorer is implemented via a series of open-source core plugins, which we also use internally for our aleth.io platform. Please refer to Alethio CMS for documentation on the plugin system.

Project structure

📁ethereum-lite-explorer
├─📁dev             - dev server for serving the app
├─📁dist            - target folder for application that contains deployables
└─📁src             - source files
  ├─📁app (*1)      - application source code
  ├─📁assets        - static assets (e.g. images) that will be bundled together with the application
  └─📁public        - contains static assets that are copied to the dist folder as they are

(*1)
📁app
├─📁components      - React components
├─📁translation     - localized strings
├─📁util            - application-agnostic utilities. Ideally these would be in a separate repo/package.
└─📄index.ts         - entry point

Getting started

Prerequisites

Please make sure you have the following installed and running properly

Configuration

The application requires a JSON configuration file which is loaded at runtime but with different approaches for development vs production environments.

For development the config file is called config.dev.json located in the root of the repository. As for the production environment the config file is copied in the dist folder and renamed to config.json.

The dist is the target folder for the built application that needs to be served by an HTTP server.

Here are 3 sample config files as starting point.

Config name Description
config.default.json Default configuration file which contains the core plugins of the app that are enough to run the explorer.
config.ibft2.json Configuration file that has the default core plugins plus an extra one useful for IBFT2 based chains that decodes the extraData field of a block.
config.memento.json Configuration file that has the default core plugins plus the memento plugins to use the Memento API as a data source

The possibility to change the URL of the RPC enabled Ethereum node is done through the eth-lite core plugin. See the nodeUrl attribute for the plugin which has the default value set to https://mainnet.infura.io/.

For advanced configuration editing, please refer to the Alethio CMS documentation

Running in Docker

You can run the Lite Explorer in Docker by using the already published images on Docker Hub. The config file in the Docker images have the default values from the config.default.json sample file. By default it will connect to https://mainnet.infura.io/.

The simplest command to run it is

$ docker run -p 80:80 alethio/ethereum-lite-explorer

which will start a container on port 80 of your computer with a nginx embedded to serve the pre-build explorer. You can now open localhost in your browser and use it.

There are 2 env vars that can be passed in at runtime:

ENV var Description
APP_NODE_URL URL of RPC enabled node. (e.g. https://host:port, also supports Basic Auth by prepending user:pass@ to the host). This overrides in the config file the nodeUrl attribute of the eth-lite core plugin.
APP_BASE_URL It is used ONLY in index.html for og:tags (e.g. https://my.app.tld). Overrides build time defined value.

For example if you want to connect to your node on localhost with all default configs run the following command:

$ docker run -p 80:80 -e APP_NODE_URL="http://localhost:8545" alethio/ethereum-lite-explorer

If more customization is needed, a full configuration file can be mounted in the application root (e.g. in the /usr/share/nginx/html folder).

$ docker run -p 80:80 -v /your-config-dir/config.json:/usr/share/nginx/html/config.json alethio/ethereum-lite-explorer

Running in Kubernetes

You can deploy the Lite Explorer in Kubernetes using the following steps:

  • cd .kubernetes
  • Run ./deploy.sh to deploy, uses config.default.json as config.
  • Use for example ./deploy.sh ../config.memento.json to select other config files.
  • Run ./remove.sh to remove

Building from source

Clone the explorer in a folder of your choosing

$ git clone https://github.com/Alethio/ethereum-lite-explorer.git
$ cd ethereum-lite-explorer

IMPORTANT: Make sure you are using npm 6.9+ for the next step. Older versions will NOT work due to alias feature usages introduced in npm 6.9.

Install npm packages

$ npm install

Copy the sample config file

$ cp config.default.json config.dev.json

Make necessary modifications into config.dev.json if needed. For development, you must also remove the version query strings ?v=#.#.# from the "plugins" URIs. Full list of configuration options available here

To start the development build run the following command:

$ npm run watch

This terminal will be kept open, as the above command continuously watches the source files for changes and triggers an incremental build on every change.

Alternatively, to build the minified version (used also for production) use:

$ npm run build

Since the app is using the Alethio CMS for using the core plugins the next step is to install them:

$ npm i -g @alethio/cms-plugin-tool
$ acp install --dev \
    @alethio/explorer-plugin-eth-common \
    @alethio/explorer-plugin-eth-lite \
    @alethio/explorer-plugin-eth-memento \
    @alethio/explorer-plugin-3box

If you need other custom plugins like for example to decode the extraData field of a block for the IBFT2 based networks, you can install them at this step:

$ acp install --dev @alethio/explorer-plugin-eth-ibft2

The above command acp installs the plugins in the dist folder. Basically they will be copied, together with the base app.

IMPORTANT: Whenever you use npm run build or npm run build-dev the dist folder is emptied, thus the plugins are also deleted and they need to be reinstalled.

Finally, you can start the local Explorer development server with

$ npm start

Deploying the built assets to production

When building from source, you are responsible for setting up your own production environment. There are two available options: you can either start from our existing Dockerfile found in the root of the repo and customize that, or you can use your own custom solution.

For a custom deployment, first make sure you have built the Explorer distributables for production, using npm run build. Assuming you already have a web server, such as Nginx, you will need to copy everything from the dist/ folder to the public folder of the web server (e.g. /usr/share/nginx/html). Then, in the same target folder you need a valid config.json file. Note the filename, which is different from the development version. You can use the config.*.json from the root of the repo as templates. Make sure to also fill in the nodeUrl in the eth-lite plugin config section. Lastly, make sure that your web server redirects all routes to the index.html to enable HTML5 routing. You can refer to .docker/nginx.conf as an example.

Custom build arguments

The following env vars can be passed when building from source:

ENV var Description
APP_BASE_URL It is used ONLY in index.html for og:tags (e.g. https://my.app.tld)
APP_BASE_PATH Enables serving the app on a sub-path instead of the domain root (e.g. some/path/to/app).

Example: If serving the app from https://my.tld/path/to/app: $ APP_BASE_URL="https://my.tld" APP_BASE_PATH="path/to/app" npm run build

Example setups

With Memento

Memento is Alethio's open source tool for scraping and indexing Ethereum data from any web3-compatible node. The biggest advantage of using Memento as a data source is the indexed data which allows a faster access as well as the ability to show transactions on the account page.

If you don't have a Memento environment set up already, follow the instructions here

This requires Memento >= v1.1.0

Easiest way to run with Memento is to follow the steps from Running in Docker and mount config.memento.js as config file.

If you want a more customized setup, follow Building from source and the following steps

Build the Lite Explorer

$ npm run build

Install the necessary plugins

$ acp install --dev \
    @alethio/explorer-plugin-eth-common \
    @alethio/explorer-plugin-eth-memento \
    @alethio/explorer-plugin-3box

Copy the config file

$ cp config.memento.json config.dev.json

Modify the apiBasePath to point to Memento's API and, since we are running in dev mode, remove the version query strings ?v=#.#.# from the "plugins". The "plugins" section should look as follows:

"plugins": [{
    "uri": "plugin://aleth.io/eth-common"
}, {
    "uri": "plugin://aleth.io/3box",
    "config": {
        "ipfsUrlMask": "https://ipfs.infura.io/ipfs/%s"
    }
}, {
    "uri": "plugin://aleth.io/eth-memento",
    "config": {
        "apiBasePath": "http://localhost:3001/api/explorer"
    }
}],

Start the explorer

$ npm start

With Infura

  • Sign-up for an account or sign-in into your Infura account.

  • From the control panel, obtain your endpoint url for the network you are interested in (mainnet, ropsten, kovan, rinkeby). It will looks similar to https://mainnet.infura.io/v3/aa11bb22cc33......

  • Update config.dev.json file and set the nodeUrl attribute for the eth-lite plugin to your Infura endpoint.

Build and start Lite Explorer

$ npm run build && npm start

With Parity Light Client

This will allow you to run both your own node and explorer. No third-party dependencies. It will be slower to browse older data because it is fetching it real time from other ethereum peer nodes but it's fast to sync and low in resource usage.

Install Parity Ethereum through one of the convenient methods and start it with the --light cli flag.

As a simple step, if you have Docker, you could just run

$ docker run -d --restart always --name parity-light -p 127.0.0.1:8545:8545 parity/parity:stable --light --jsonrpc-interface all

Update config.dev.json file and set the nodeUrl attribute for the eth-lite plugin to http://127.0.0.1:8545.

Build and start Lite Explorer

$ npm run build && npm start

With Ganache

First of all, if you do not have it, download and install Ganache which will give you your own personal test chain.

After setting up and starting Ganache, update the config.dev.json file and set the nodeUrl attribute for the eth-lite plugin to http://127.0.0.1:7545.

Build and start Lite Explorer

$ npm run build && npm start

With Besu

This is a great way to use a full featured client, and to see how the explorer works with a private network.

Refer to Besu Light Explorer HowTo to configure your node and explorer.

Example Deployments

surge.sh

Surge.sh is a simple, single-command web publishing service that you can use to deploy your own version of the Lite Explorer.

Make sure you have set a proper and accessible APP_NODE_URL environment variable.

# copy and edit a config file
$ cp config.default.json config.json
# install surge
$ npm install --global surge
# build explorer
$ npm run build
# go to build dir
$ cd dist
# make push state work as it should
$ cp ../config.json config.json && cp index.html 200.html
# deploy
$ surge

How to

Deploy to a domain sub-path

This case is supported only when building from source. You will have to pass the APP_BASE_PATH env variable to the build command. See Custom build arguments for reference and examples.

Show the network name

You can use our predefined module that shows the current network and an optional switch for navigating to other deployments/networks. To use this module, just add the following in config.json:

{
    // ...
    "pages": [
        // ...
        {
            "def": "page://aleth.io/dashboard",
            "children": {
                "content": [
                    {
                        "def": "module://aleth.io/dashboard/network",
                        "options": {
                            "networkName": "MyTestNet",
                            // This is optional
                            "otherNetworks": [
                                { "name": "Ethereum MainNet", "url": "https://aleth.io" }
                            ]
                        }
                    },
                    // ...
                ]
            }
        }
    ]
}

Link to a custom deployment of EthStats

If you have a custom deployment of our EthStats product, you can easily link to it from the main app toolbar using the predefined module. You'll have to edit config.json as shown below:

{
    "plugins": [{
        "uri": "plugin://aleth.io/eth-common?v#.#.#",
        "config": {
            // ...
            "ethstatsUrl": "https://ethstats.io"
        }
    }],
    // ...
    "rootModules": {
        "toolbarTop": [
            // ...
            { "def": "module://aleth.io/toolbar/ethstats" }
        ],
        // ...
    }
}

Use a custom ETH currency symbol

If you are deploying for a private or test net, you can customize the main currency symbol by editing the config:

{
    "plugins": [{
        "uri": "plugin://aleth.io/eth-lite?v#.#.#",
        "config": {
            // ...
            "ethSymbol": "GöETH"
        }
    }]
}

Show the transactions per account in account page

This module requires @alethio/explorer-plugin-eth-memento and access to call the api of a memento lite pipeline deployment. Edit the config:

{
    "plugins": [{
        "uri": "plugin://aleth.io/eth-memento?v#.#.#",
        "config": {
            "ethSymbol": "GoETH",
            "apiBasePath": "http://memento-api.example/api/explorer"
        }
    }]
}

And add the module to account page:

{
    "pages": [{
        "def": "page://aleth.io/account",
        "children": {
            // ...
            "bottom": [
                { "def": "module://aleth.io/memento/account/txs" }
                // ...
            ]
        }
    }]
}

If you want to use Memento as a full backend replacement (recommended), see the With Memento section.

Override specific text strings (translations)

You can customize texts for each plugin by overriding the corresponding translation keys in the plugin's configuration:

{
    "plugins": [{
        "uri": "plugin://aleth.io/eth-lite?v#.#.#",
        "config": {
            //...
        },
        "translations": {
            "en-US": {
                "dashboardView.title": "My Private Network Explorer"
            }
        }
    }]
}

You can refer to individual translation keys in the core plugins repo. Follow this link for the eth-lite plugin translations and this one for eth-common plugin translations.

Use a custom RPC node authentication method

If your RPC node requires a custom authentication step (e.g. Besu), the eth-lite plugin supports initialization hooks for the purpose of injecting authorization headers into the web3 instance. You will need to create a plugin that handles the authentication steps (e.g. collects credentials via a login form or 3rd party page redirect). The plugin will export a data adapter returning an object that follows the IAuthStore interface definition. The public URI for that adapter is passed to the eth-lite plugin config via the authStoreUri key. This will pause the initialization of the eth-lite plugin until the authentication is handled.

Check out this Besu plugin as an example: https://www.npmjs.com/package/@adetante/explorer-besu-plugin

ethereum-lite-explorer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum-lite-explorer's Issues

Not connecting to node when using HTTP Basic Authentication

When basic auth is active on a node using an Nginx reverse proxy, I can access the RPC fine manually, but the explorer doesn't seem to be connecting.

I've set the APP_NODE_URL to be:

https://username:[email protected]

When loading the explorer, I can see the title and search bar but no node information. Looking at the network requests, I can see the explorer is making an OPTIONS request to the node, which is failing with 401 unauthorized, presumably because the explorer is not sending the correct authentication header.

POA extradata breaks eth-ibft2

we may need an option to have ibft2 parse the extradata differently when the consensus algo is POA and not POW, seems like the size of extradata goes from 32b to 140 or something around that.

the plugin:

 {
         "uri": "plugin://aleth.io/eth-ibft2?v=2.0.1"
    }],

in config

 "extraData": [{
                        "def": "module://aleth.io/eth-ibft2/block/lite/extra-data"
                    }]

the error in browser

Couldn't fetch data from adapter "local-adapter://2f7aff2c-eef1-4771-a1c3-077f689f191a/0" TypeError: Cannot read property 'forEach' of undefined
    at be.decode (ExtraDataDecoder.ts:30)
    at Object.<anonymous> (extraDataModule.ts:18)
    at Generator.next (<anonymous>)
    at tslib.es6.js:71
    at new Promise (<anonymous>)
    at h (tslib.es6.js:67)
    at Object.load (extraDataModule.ts:17)
    at DataLoader.ts:123 {context: {…}}

Cannot access from outside localhost

Using docker, if I try to check a transaction from other machine, nothing is displayed.

Example:

http://192.168.0.123:8080/tx/0x5d9f0075e01b91bb15dc20f98e0c73b059ff37d9d73663238ca01fa696da36e7

but I can access perfectly from localhost:

http://localhost:8080/tx/0x5d9f0075e01b91bb15dc20f98e0c73b059ff37d9d73663238ca01fa696da36e7

The docker console says:

geth-explorer     | 192.168.0.100 - - [10/Mar/2020:13:46:46 +0000] "GET /js/app.bundle.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0" "-"

and the webconsole of my web-browser is stuck in:

Data sources loaded. TransportConsole.ts:36:21

NOTE:

  • 192.168.0.123: is the machine executing the docker with the port 8080 visible for connecting to the docker
  • 192.168.0.100: is the machine where I am accessing

Add infura support

the explorer should have a drop down to select one of the infura networks and a way to specify a infura auth token, maybe an ENV var.

Help running with Besu

Hi there,
I am trying to use this project to see an instance of Hyperledger besu permissioned network.

Right now I can use my besu node to move ETH, send txs etc with whitelisted accounts. On metamask for example, I can see ETH balances on the network by simply connecting to the node. I can submit txs with a whitelisted account. It is possible that I cannot GET from the blockchain without private key authentication.

In the instructions for besu it is stated that we can use APP_NODE_URL to set the rpc endpoint. That's fine. I am wondering if there is some extra step to pass a private key to the app so it can access permissioned data? Let me know. Attached here in is what I see when I search a contract address that I know I have deployed to this network

image

Can I add plugin in the Docker container?

I have run a ethereum-lite-explorer container, and I want to add some plugins or functions as the README file said.

I use docker exec -it CONTAINER_ID/bin/sh to enter the container, and modified the /app/config.json according to the README file, and save it. Then I restarted the container but it doesn't work, no new plugins can be found in the ethereum-lite-explorer page.

I also try to copy the modified /app/config.json to /usr/share/nginx/html/, and restart container, it also doesn't work.

I added the "Show the network name" plugin and "Link to a custom deployment of EthStats" (I have started EthStats by docker ) plugin. None of them can be used.

Need your help, thanks!

This is my ethereum-lite-explorer container that has been installed plugins:
1

Extract swarm source

Cut swarm source from account code to a different property.
Fixes opcodes view
Display swarm source in a different place

index.js is missing while npm start

GET /plugins/aleth.io/eth-common/4.0.0/index.js 404 7.522 ms - 272
Error: ENOENT: no such file or directory, stat '/home/manzik/Besu/ethereum-lite-explorer/dist/plugins/aleth.io/eth-common/4.0.0/index.js'
GET /plugins/aleth.io/3box/1.1.1/index.js 404 3.768 ms - 266
Error: ENOENT: no such file or directory, stat '/home/manzik/Besu/ethereum-lite-explorer/dist/plugins/aleth.io/3box/1.1.1/index.js'
GET /plugins/aleth.io/eth-lite/4.2.0/index.js 404 3.118 ms - 270
Error: ENOENT: no such file or directory, stat '/home/manzik/Besu/ethereum-lite-explorer/dist/plugins/aleth.io/eth-lite/4.2.0/index.js'

can not find plugin version

I (too ?) quickly installed ethereum-lite-explorer including the plugins on Arch Linux.

Successfully installed plugin "aleth.io/eth-common" to "/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/eth-common".
Successfully installed plugin "aleth.io/eth-lite" to "/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/eth-lite".
Successfully installed plugin "aleth.io/eth-memento" to "/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/eth-memento"
Successfully installed plugin "aleth.io/3box" to "/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/3box".

but looks like its looking for specific versions (which results in a 404 in the browser)

$ npm start

> [email protected] start /home/sum/DEV/ETH/ethereum-lite-explorer
> cd dev && npm start && cd ..


> [email protected] start /home/sum/DEV/ETH/ethereum-lite-explorer/dev
> ts-node index.ts

Listening on 127.0.0.1:3000
GET / 200 3.210 ms - 7148
GET /js/app.bundle.js?242397e15484383ef74b 304 1.118 ms - -
GET /css/normalize.css 304 0.924 ms - -
GET /css/fonts.css 304 0.959 ms - -
GET /css/style.css 304 0.951 ms - -
GET /config.json 304 0.981 ms - -
GET /js/d83770d5ef5211c092fe.bundle.js 304 0.260 ms - -
GET /plugins/aleth.io/eth-common/4.0.0/index.js 404 2.929 ms - 272
Error: ENOENT: no such file or directory, stat '/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/eth-common/4.0.0/index.js'
GET /plugins/aleth.io/3box/1.1.1/index.js 404 2.131 ms - 266
Error: ENOENT: no such file or directory, stat '/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/3box/1.1.1/index.js'
GET /plugins/aleth.io/eth-lite/4.1.0/index.js 404 1.166 ms - 270
Error: ENOENT: no such file or directory, stat '/home/sum/DEV/ETH/ethereum-lite-explorer/dist/plugins/aleth.io/eth-lite/4.1.0/index.js'
GET /fonts/Barlow-Regular.woff 304 0.499 ms - -
GET /fonts/Barlow-Medium.woff 304 0.560 ms - -

Latest DockerHub image not updated?

Hi,

I've just runned a lite-explorer with memento in a local PoA with Parity. Everything is ok but I can find some differences between my explorer and the https://explorer.aleth.io/.
When related with Tokens in aleth.io explorer if I search for a tx_hash I can see a summary with "Token Transfers" and "Input data" with the events, but in my blockexplorer I can see just raw log entries... Also when searching for an account the summary is different... I don't know if there's something else I have to configure or if the latest image in Docker hub isn't the same as the one running in aleth.io.

Thanks in advance

Guillermo

How to update translations?

What's the correct way to update translations and customise the appearance? It seems whenever I install the plugins everything is getting overwritten

Integrate data from IBFT config with data from memento

I interfaced the lite-explorer and memento with a local besu node, and I seem not to be able to display infos from memento AND from the ibft config as well.

What I would like would be to hide the memento's extraData field and display the ibft informations instead.

Here is the relevant part of my config file I tried with :

{
  "GOOGLE_ANALYTICS_ID": null,
  "HOTJAR_ID": null,
  "SENTRY_ENABLED": false,

  "pluginsUrl": "plugins",

  "plugins": {
    "plugin://aleth.io/eth-common?v=2.4.0": {},
    "plugin://aleth.io/eth-memento?v=1.1.0": {
      "apiBasePath": "http://172.18.0.5:3001/api/explorer"
    },
    "plugin://aleth.io/eth-ibft2?v=1.1.0": {}
  },

  "pages": [
    {
      "def": "page://aleth.io/block",
      "children": {
        "sidebar": [
          {
            "def": "context://aleth.io/block/list",
            "children": [{ "def": "module://aleth.io/block/list" }]
          }
        ],
        "content": [
          {
            "def": "module://aleth.io/memento/block/basic",
            "pageCritical": true,
            "children": {
              "confirmations": [
                { "def": "module://aleth.io/block/confirmations" }
              ]
            }
          },
          {
            "def": "module://aleth.io/memento/block/txs",
            "pageCritical": true
          },
          {
            "def": "module://aleth.io/memento/block/advanced",
            "pageCritical": true,
            "children": {
              "confirmations": [
                { "def": "module://aleth.io/block/confirmations" }
              ],
              "extraData": [
                {
                  "def": "module://aleth.io/block/ibft2-extra-data"
                }
              ]
            }
          },
          {
            "def": "module://aleth.io/memento/block/logs-bloom",
            "pageCritical": true
          }
        ]
      }
    },
...
}

I am unsuccessful doing it no matter how I play with the json. Is there a way to achieve what I want without modifying or creating a plugin by myself ?

npm run build

2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild-js-prod', 'build-js-prod', 'postbuild-js-prod' ]
5 info lifecycle [email protected]prebuild-js-prod: [email protected]
6 info lifecycle [email protected]
build-js-prod: [email protected]
7 verbose lifecycle [email protected]build-js-prod: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build-js-prod: PATH: /home/coding4world/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/$
9 verbose lifecycle [email protected]build-js-prod: CWD: /home/coding4world/projects/besu-sample-networks/block-explorer-light/ethereum-lite-explorer
10 silly lifecycle [email protected]
build-js-prod: Args: [ '-c', 'webpack --config=./webpack.config.prod.js' ]
11 silly lifecycle [email protected]build-js-prod: Returned: code: 1 signal: null
12 info lifecycle [email protected]
build-js-prod: Failed to exec build-js-prod script
13 verbose stack Error: [email protected] build-js-prod: webpack --config=./webpack.config.prod.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/home/coding4world/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess. (/home/coding4world/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/coding4world/projects/besu-sample-networks/block-explorer-light/ethereum-lite-explorer
16 verbose Linux 5.4.0-1031-azure
17 verbose argv "/home/coding4world/.nvm/versions/node/v14.15.0/bin/node" "/home/coding4world/.nvm/versions/node/v14.15.0/bin/npm" "run" "build-js-prod"
18 verbose node v14.15.0
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build-js-prod: webpack --config=./webpack.config.prod.js
22 error Exit status 1
23 error Failed at the [email protected] build-js-prod script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Health check of the explorer

Hi guys,

I'm using the block-explorer for a private network in an AWS instance. I need a kind of health check so that the domain to access to the service stops/restarts. Something like a HTTP GET which returns a 200 OK, or some api to check the status would be very useful. Something like 'connection' in https://github.com/Alethio/ethstats-network-server/blob/master/docs/WEBSOCKET-API.md but I need simple HTTP GETs...

Also I need it for the ethstats network-server and dashboard.

Thanks in advance

Guillermo

npm run build wrong, Could you kindly update package.json?

Environment:
npm -v 6.9.0
node --version v10.16.0
ubuntu 18.04

error log:

➜  ethereum-lite-explorer git:(master) ✗ yarn build
yarn run v1.16.0
$ npm run clean && npm run build-js-prod && npm run check-prod-bundle-size
npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1560826950934-0.4852175849399103/node but npm is using /root/.nvm/versions/node/v11.14.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> [email protected] clean /home/user/Documents/ethereum-lite-explorer
> rimraf ./dist

npm WARN lifecycle The node binary used for scripts is /tmp/yarn--1560826950934-0.4852175849399103/node but npm is using /root/.nvm/versions/node/v11.14.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
..............
  js/app (653 KiB)
      js/app.bundle.js


ERROR in /home/user/Documents/ethereum-lite-explorer/src/app/page/account/ContractDetails.tsx
ERROR in /home/user/Documents/ethereum-lite-explorer/src/app/page/account/ContractDetails.tsx(60,18):
TS2322: Type '{ label: string; noDataContent: Element; items: IContractAccordionItemConfig[]; renderExpander: (args: { config: IContractAccordionItemConfig; isOpen: boolean; onClick(): void; }) => ReactElement<{}, string | ... 1 more ... | (new (props: any) => Component<...>)>; ... 4 more ...; onContentError: (e: any, item: Accor...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<AccordionHorizontal<IContractAccordionItemConfig>> & Pick<Readonly<IAccordionHorizontalProps<IContractAccordionItemConfig>> & Readonly<...>, never> & Partial<...> & Partial<...>'.
  Property 'items' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<AccordionHorizontal<IContractAccordionItemConfig>> & Pick<Readonly<IAccordionHorizontalProps<IContractAccordionItemConfig>> & Readonly<...>, never> & Partial<...> & Partial<...>'.
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [aYSr] (webpack)/buildin/module.js 497 bytes {0} [built]
    [fRV1] (webpack)/buildin/global.js 472 bytes {0} [built]
    [i4UL] /home/user/Documents/ethereum-lite-explorer/node_modules/html-webpack-plugin/lib/loader.js!../public/index.html 3.46 KiB {0} [built]
        + 1 hidden module
Child vs/editor/editor:
                         Asset     Size  Chunks             Chunk Names
        js/vs/editor.worker.js  101 KiB       0  [emitted]  main
    js/vs/editor.worker.js.map  458 KiB       0  [emitted]  main
    Entrypoint main = js/vs/editor.worker.js js/vs/editor.worker.js.map
    [fRV1] (webpack)/buildin/global.js 472 bytes {0} [built]
    [s5Qh] /home/user/Documents/ethereum-lite-explorer/node_modules/monaco-editor/esm/vs/editor/editor.worker.js + 30 modules 288 KiB {0} [built]
        |    31 modules
        + 5 hidden modules
Child vs/language/json/jsonWorker:
                       Asset     Size  Chunks             Chunk Names
        js/vs/json.worker.js  209 KiB       0  [emitted]  main
    js/vs/json.worker.js.map  918 KiB       0  [emitted]  main
    Entrypoint main = js/vs/json.worker.js js/vs/json.worker.js.map
    [FojF] /home/user/Documents/ethereum-lite-explorer/node_modules/monaco-editor/esm/vs/language/json/json.worker.js + 54 modules 581 KiB {0} [built]
        |    55 modules
    [fRV1] (webpack)/buildin/global.js 472 bytes {0} [built]
        + 6 hidden modules
Child webapp-webpack-plugin:
     1 asset
    Entrypoint block-explorer-logo.svg = 65f9b32d8d3928a5df5b
    [Rzkz] /home/user/Documents/ethereum-lite-explorer/node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"/home/user/Documents/ethereum-lite-explorer/node_modules/.cache/webapp-webpack-plugin"}!/home/user/Documents/ethereum-lite-explorer/node_modules/webapp-webpack-plugin/src/loader.js?{"prefix":"assets/","options":{"appName":"ethereum-lite-explorer","appDescription":"Ethereum Lite Explorer","version":"1.0.0-beta.4"},"path":"/"}!../assets/block-explorer-logo.svg 764 KiB {0} [built]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build-js-prod: `webpack --config=./webpack.config.prod.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] build-js-prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-06-18T03_04_00_240Z-debug.log
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here is install module as example:
in package.json, "ethstats-ui": "^1.0.0-beta.3",
after node install, "name": "ethstats-ui" , "version": "1.0.0-beta.10",
but in fact, ethstats-ui maybe move to https://www.npmjs.com/package/@alethio/ui,

Could you kindly check and help to fix the npm run build?

Thank you first!

Help running with Geth

I'm running the docker instance.
I can see it runs with Parity.
I'm trying the same with Geth, but couldn't find anything on the documentation. Can you please help me ?

Ideally I would like to have the command line docker run command, and the config json changes

Thanks in advance

How to use APP_BASE_URL?

Hi,

I'm trying to use the APP_BASE_URL in order to change og:tags in .html when using docker but I don't know how do I have to use it...

Thanks in advance

Cors origin & Error: Latest block should be set by now

After reading the manual. I build the repo from source (https://github.com/Alethio/ethereum-lite-explorer#building-from-source)

I managed to build and run the application without the error.

I used npm run build-dev to check the app in the 3000 port.

Errors

  1. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:8545/. (Reason: CORS request did not succeed).
  2. Error: Latest block should be set by now

I added cors code in the dev/index.ts also. I added cors params in Geth and parity server.

Can someone help me to figure out the issue.
eth

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.