Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Access to Geth and Refresh the Page #30

Open
DhaneshKothari opened this issue Jul 10, 2017 · 8 comments
Open

Allow Access to Geth and Refresh the Page #30

DhaneshKothari opened this issue Jul 10, 2017 · 8 comments

Comments

@DhaneshKothari
Copy link

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

@chainhead
Copy link

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

@ZiangYan
Copy link

same problem, no appropriate solution found in #26

@ryanlowdermilk
Copy link

Same.

@vderelle
Copy link

vderelle commented Feb 7, 2018

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.

@VERTlG0
Copy link

VERTlG0 commented Feb 21, 2018

@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') 
        }
});

@songtaeil
Copy link

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

@sudhaaddagiri
Copy link

sudhaaddagiri commented Aug 7, 2019

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

@zhangyi999
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants