0

I first started GUI version of Ganache. Then I run the following commands to try pet-shop. http://localhost:3002/ is then opened in my browser, When I click "Adopt" for a dog, I see no transactions in Ganache. Does anybody know whether there is something wrong?

bash> truffle unbox pet-shop
Downloading...
Unpacking...
Setting up...
Unbox successful. Sweet!

Commands:

  Compile:        truffle compile
  Migrate:        truffle migrate
  Test contracts: truffle test
  Run dev server: npm run dev
bash> truffle compile
Compiling ./contracts/Migrations.sol...

Compilation warnings encountered:

/private/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/tmp.RJe3ehbB6u/contracts/Migrations.sol:11:3: Warning: No visibility specified. Defaulting to "public".
  function Migrations() {
  ^ (Relevant source part starts here and spans across multiple lines).
,/private/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/tmp.RJe3ehbB6u/contracts/Migrations.sol:15:3: Warning: No visibility specified. Defaulting to "public".
  function setCompleted(uint completed) restricted {
  ^ (Relevant source part starts here and spans across multiple lines).
,/private/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/tmp.RJe3ehbB6u/contracts/Migrations.sol:19:3: Warning: No visibility specified. Defaulting to "public".
  function upgrade(address new_address) restricted {
  ^ (Relevant source part starts here and spans across multiple lines).

Writing artifacts to ./build/contracts

bash> truffle migrate
Using network 'development'.

Network up to date.
bash> truffle test
Using network 'development'.



  0 passing (1ms)

bash> npm run dev

> pet-shop@1.0.0 dev /private/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/tmp.RJe3ehbB6u
> lite-server

** browser-sync config **
{ injectChanges: false,
  files: [ './**/*.{html,htm,css,js}' ],
  watchOptions: { ignored: 'node_modules' },
  server: 
   { baseDir: [ './src', './build/contracts' ],
     middleware: [ [Function], [Function] ] } }
[Browsersync] Access URLs:
 --------------------------------------
       Local: http://localhost:3002
    External: http://10.10.200.116:3002
 --------------------------------------
          UI: http://localhost:3003
 UI External: http://10.10.200.116:3003
 --------------------------------------
[Browsersync] Serving files from: ./src
[Browsersync] Serving files from: ./build/contracts
[Browsersync] Watching files...
18.04.10 08:15:00 200 GET /index.html
18.04.10 08:15:00 200 GET /css/bootstrap.min.css
18.04.10 08:15:00 200 GET /js/bootstrap.min.js
18.04.10 08:15:00 200 GET /js/web3.min.js
18.04.10 08:15:00 200 GET /js/truffle-contract.js
18.04.10 08:15:00 200 GET /js/app.js
18.04.10 08:15:01 200 GET /pets.json
18.04.10 08:15:01 200 GET /images/scottish-terrier.jpeg
18.04.10 08:15:01 200 GET /images/french-bulldog.jpeg
18.04.10 08:15:01 200 GET /images/boxer.jpeg
18.04.10 08:15:01 200 GET /images/golden-retriever.jpeg
18.04.10 08:15:01 404 GET /favicon.ico
  • Did you start ethereum client – Crissi Mariam Robert Apr 10 '18 at 4:16
  • @CrissiMariamRobert No. How to start it? – user1424739 Apr 10 '18 at 8:21
  • Install testrpc or ganache-cli – Crissi Mariam Robert Apr 10 '18 at 10:41
  • I have ganache-cli installed and I run ganache-cli before I run truffle. I also changed the port in truffle.js from 7545 to 8545 so that it matches the port used by ganache-cli. But when I click "Adopt" for a dog, I see no transactions in Ganache, I still see nothing changed in the browser. How to debug this problem? – user1424739 Apr 11 '18 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.