etherparty/explorer

Allow Access to Geth and Refresh the Page

Opened this issue · 8 comments

Hi,
I'm getting following pop-up when trying to run explorer:
"Allow Access to Geth and Refresh the Page"

What can I do in order to move forward?

Thanks

@DhaneshKothari
I am also facing the same issue. This is a similar issue #26 However, that didn't work for me.

same problem, no appropriate solution found in #26

I figured out how to solve the issue. The app.js file in ../explorer/app/ contains configuration variables. You simply need to modify the value for GETH_HOSTNAME to your public domain name. Presumably a public IP address would work as well.

I'm not sure why this isn't stated in the README file. It looks like its a common issue for people.

@vderelle Where is this GETH_HOSTNAME variable?

Here is app.js file:

'use strict';

angular.module('ethExplorer', ['ngRoute','ui.bootstrap'])

.config(['$routeProvider',
    function($routeProvider) {
        $routeProvider.
            when('/', {
                templateUrl: 'views/main.html',
                controller: 'mainCtrl'
            }).
            when('/block/:blockId', {
                templateUrl: 'views/blockInfos.html',
                controller: 'blockInfosCtrl'
            }).
            when('/transaction/:transactionId', {
                templateUrl: 'views/transactionInfos.html',
                controller: 'transactionInfosCtrl'
            }).
            when('/address/:addressId', {
                templateUrl: 'views/addressInfo.html',
                controller: 'addressInfoCtrl'
            }).
            otherwise({
                redirectTo: '/'
            });
    }])
    .run(function($rootScope) {
        var web3 = new Web3();
        var eth_node_url = 'http://localhost:8545'; // TODO: remote URL
	web3.setProvider(new web3.providers.HttpProvider(eth_node_url));
        $rootScope.web3 = web3;
        function sleepFor( sleepDuration ){
            var now = new Date().getTime();
            while(new Date().getTime() < now + sleepDuration){ /* do nothing */ } 
        }
        var connected = false;
        if(!web3.isConnected()) {
            $('#connectwarning').modal({keyboard:false,backdrop:'static'}) 
            $('#connectwarning').modal('show') 
        }
});

I have solved it. thank you.
You can change the eth_node_url from localhost to private ip address or public for correcting this problem

I had changed in app.js file to my vm public IP but how are you running geth..
are you adding rpccorsaddress in geth

inpage.js:1 Access to XMLHttpRequest at 'http://0.0.0.0:8889/' from origin 'http://0.0.0.0:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.