Assignment - Marketplace Frontend

@kenn.eth, @thecil.
I’m also trying to create a gh page for this application.But kinda lost here.

npm install gh-pages --save-dev

Used above command in the client folder of the Daap.

package.json

{
  "name": "academy-kitties-template",
  "version": "1.0.0",
  "description": "",
  "main": "truffle-config.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/tagupta/Crypto-kitties-clone.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/tagupta/Crypto-kitties-clone/issues"
  },
  "homepage": "https://tagupta.github.io/Crypto-kitties-clone",
  "dependencies": {
    "@truffle/hdwallet-provider": "^1.4.2",
    "dotenv": "^10.0.0"
  },
  "devDependencies": {
    "gh-pages": "^3.2.3"
  }
}

again in the same client folder was running npm run deploy, but got some error messages, saying-

D:\BlockChain\Ethereum-201\CryptoKitties\academy-kitties-template\client>npm run deploy

[email protected] predeploy D:\BlockChain\Ethereum-201\CryptoKitties\academy-kitties-template
> npm run build

npm ERR! missing script: build

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-08-25T14_23_42_851Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] predeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2021-08-25T14_23_42_936Z-debug.log

Here’s the repo

Are you sure you install everything correctly? Because its missing the script build

1 Like

yeah…earlier while working with Ganache things were fine. Also, I had already stored Ropsten ETH in my account.
rop
Had this error earlier, so I did the job.

 Deploying 'Migrations'
   ----------------------

Error:  *** Deployment Failed ***

"Migrations" could not deploy due to insufficient funds
   * Account:  0x3a5CF5Bb7E5343f95BA959f6835CF6ABA874A4EF
   * Balance:  0 wei
   * Message:  insufficient funds for gas * price + value
   * Try:
      + Using an adequately funded account
      + If you are using a local Geth node, verify that your node is synced.
1 Like

@kenn.eth,
That’s my account history
status

Yeah…I think I’m installing packages correctly.
here’s the repo

Hey @tanu_g, hope you are well.

I think it might be due to a different gas price on the contract deployment, you could try to: remove, increase or decrease the gas in your truffle config for the ropsten network.

Let me know what you find out :nerd_face:

Carlos Z

1 Like

Thanks, @thecil. It worked, I slightly increased the gas from 5.5M to 6.5M.
Now, what is the next step… Do I have to deploy the front end separately using some service?.

Could you also help me with this one? :slightly_smiling_face: :upside_down_face:

Yes, you could use python webserver for it for example.

Then i just run your dapp with python -m http.server and it loads properly for me.

image

Carlos Z

4 Likes

Hi Bhujanga, nice work. Do you have any recommendations for practicing this process of web3.js like in your marketplace.js file.
I am on the last part of selling the cat but having trouble getting approved.
Basically, what helped you understand better this part of the project or what kind of practice or training do you recommend ?

1 Like

Hey Mickey, nice work. How are you selling the cat - I can’t seem to connect to Meta mask and I think I missed seeing that in your final code?

Nice work Vive,
just wondering if you can recommend for learning this part of the course; where to spend one’s time on in order to get this?

Thanks, I just followed the videos. What part do you find most challenging?

Writing the web js code and making that work with JavaScript, I guess the front end

I basically tried to follow the code from Filip and I only have the last step, which is to buy the cat and then finalize the whole project but it has taken me like 3 months. I went from the Ethereum 201 to this course and I just feel there should be more prep work with web3, jQuery, etc. In fact, I skipped React and now I think I really should go back take the React course.

3 Likes

I think you’re right. The 201 course requires more front end work. Knowledge and some experience in that area makes life easier. I started the React course afterwards but I’ve had some development experience so was able to do a simple interface. I didn’t use React in the 201 course it’s not realy necessary I did however do some quick youtube courses on JQuery to get acquainted with it. There is a nice in depth React course in the Academy and if you want some shorter courses I could recomend the youtybe channel by The Net Ninja. Hope this helps.

2 Likes

I agree, the courses are good/ok, but they certainly do not cover everything and could/should be improved greatly. I am working as a frontend dev in a local company since a couple of weeks and there is a loooot that professionals do differently than is reached here in the academy, especially when it comes to frontend. The web3 stuff is ok, but can also be improved I guess. I feel the academy really got me kickstarted with my developing career, but the real journey has just begun. Keep it up and look for some real-life project! I can only highly recommend getting out there and finding a team that you can learn from. Also, focus on one area and get really good at it first. Good Luck!

3 Likes

Thanks, certainly, good advice and nice to hear you are working and it sound like, doing well!

1 Like

@AdamFortuna, @REGO350, @thecil, @kenn.eth
Hello Devs, I am getting really close, but I have a Question…

When I set Offers from the Market Place, I switch accounts on Meta mask. and make a purchase of a cat
I then check Market Place and that cat is removed - like it should.
I check My Kitties while still on the second account but the kitties I bought do not appear.
I should be able to see my newly purchased cats, correct?

Here is the console.log for the Offer from main account on Meta mask:
cryptoCat_Offer
This is the console.log for the Buy order from the second account on Meta mask:
cryptoCat_Buy
But this cat is not appearing on My Kitties page, second Meta mask account…?
I get no errors
Any clues would be greatly appreciated

hey @bjamRez can you share your github repo or the contracts code? I gotta checkout the buy function.

hey Kenn, here is a link to my github repo
https://github.com/brlojam4932/myCryptoKitties_master.git

In VSC says the following:

️Use “type(uint256).max” instead of “uint256(-1)”

…in my constructor, I changed this "uint256(-1) setting to 0 since it failed. I don’t know if this could also have something to do with my current issue?

constructor() {
    // We are creating the first kitty at index 0 since an empty array, does take up space such as integer[0]
    _createKitty(0, 0, 0, uint256(0), address(0)); 
  }