These are chat archives for ethereum/tutorials

13th
Jul 2018
Emanuele Ricci
@StErMi
Jul 13 2018 09:45

I've for instance created a shop SC. The flow should be like this:

  • Seller login into the backend system (server). Create a product and the backend send the transaction to the SC that write the product on the SC.
  • Buyer login into the backend system and want to buy the product. It send a transaction with the ID of the product and the correct amount of token to the SC.

Now the backend need to know when the product has been correctly bought. How can the backend listen as a callback from the SC? What usually do developers?

Karthikeyan K R
@pion33r
Jul 13 2018 13:37
I'm creating an exchange site. I've installed go-ethereum blockchain in my web server. I want to add an erc20 token which is smart contracted in myetherwallet. For that what flags should I add when running geth daemon?
andreemic
@andreemic
Jul 13 2018 16:41
@StErMi A common solution would be to run a node.js script in the backend server. You can use the library web3, although I recommend and use ethjs. In ethjs you would set up a so called event filter which would listen for a specific event fired by the SC. Hmu at andreemic@gmail.com if you want more help with that
@soodakshay A smart contract for a token/coin only holds the information about holder balances and functions to transfer these balances. It doesn't actually sell any coins. In order to sell your coins, you would need a second Smart Contract, which is often called the "ICO Contract". It can accept ether and transfer the appropriate amount of your coins to the buyer. There, you can set an initial price (for example, you get 10 of your coins for 1 ether). hmu if you want more help with it andreemic@gmail.com
andreemic
@andreemic
Jul 13 2018 16:46
@giefk9 the minting functionality would need to be defined inside the Token Smart Contract. check out https://www.ethereum.org/token for a simple minting function example. It can also be done dynamically