substrate Front-End Template connect localhost error

865 views Asked by At

I am a newbie and experiencing same issue.

Using tutorial [https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup].

Successfully installed Node.js and Yarn - Launched the front-end-template (stated in the above link) in root directory, although I receive an error message in browser [Error Connecting to Substrate [object Event].

I have looked online for solution, but no success.

Would appreciate advice on where I'm going wrong also how to solve issue.

3

There are 3 answers

0
Ricardo Rius On

The front-end-template won't display anything unless a Substrate compatible chain node is running. In this case it should be the Substrate Node template running on the same machine where you are running the front-end.

You should first build your node-template with cargo build --release and then execute the binary ./target/release/node-template --dev. This will start the Substrate node to which your front-end-template should connect.

7
Tasszz44 On

Solved - I found that I can open multiple console windows (Visual Studio Code) from the dropdown 'default shell' - The 1st window ‘cd substrate-node-template/ ‘and run ‘cargo build –release’. In 2nd window ‘cd substrate-front-end template’ and run ‘start yarn’. I can connect to web page [localhost:8000/] and view information about the chain. Thanks for your advice!

1
Eureka On

Edit config file here:

./src/config/development.json

replace 127.0.0.1 with your IP address

yarn start and now system working.