GithubHelp home page GithubHelp logo

chococoin / test-trufflecontract Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 22 KB

A repo to find help using infura to connect the testnet from a react component.

JavaScript 76.78% HTML 15.05% CSS 8.17%

test-trufflecontract's Introduction

Trying to figure out how use infura to connect myFirstDapp from a React component.

To reproduce the bug:

Open ganache and use this mnemonic:

resist border lift moon answer require off clay elegant stage party panel

Actually, you may use any seed in Ganache but just to have same variables across the diferent networks we'll use (local and ropsten).

npm install

npm start

if you hit with some error:

Delete the folder dapp/build

git rm -rf ./dapp/build

and the "linked" folder contracts in ./src

git rm -rf ./src/contracts

and migrate the smartcontracts again:

cd dapp

truffle migrate

to migrate and deploy to ganache and

truffle migrate --network ropsten

to migrate and deploy to ropsten

Create a linked folder of ./dapp/build/contracts into src

cd .. && cd src

(In linux and mac)

ln -s ../dapp/build/contracts contracts

return to test-truffleContract

cd ..

and start react server again

npm start

If everything goes ok using ganache you'll see in the broswer info about the smartcontract and the phrase: Done! It is working!

The bug is in the next phase. In the file app.js comment the line 18 and uncomment line 19. Save the file and you'll see that this time infura doesn't work as a provider.

How can I fix this?

Thank you for your help!

test-trufflecontract's People

Watchers

James Cloos avatar  avatar

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.