0

At the moment I'm learning Solidity and using online remix to practice coding.

Question 1: As an exercise, can I construct a transaction and invoke my contract, for free (without inserting my contract to the block chain)?


Assume I have designed my contract and stored it in block chain.

Question 2: Do I need to design a web API to let people/users use the contract? or Etherum provide an API?


In general, I'd like to have a bigger picture in designing smart contract, and see how different components fit together.

  • These are significantly different questions, and should probably be split in two. – carver Aug 9 '17 at 15:30
3

Welcome to the train man, it is a bumpy ride. Whilst I'm still learning this new technology, I'll give my 2 cents.

  1. Yes. You can write a contract and invoke it without deploying it to the live network (main blockchain). How? You can either use (Remix and metamask) or (Truffle and testrpc). Invoking contracts cost ether (whether on the live network or test network). But there's a catch, on the test network (that you and every learner will be using) the ether is not real, it's specifically designed for practice.

  2. Currently web3 is being used. It's available online and you don't need to create your own API. It helps to interact with the node (or blockchain on a larger perspective).

  • thanks for the answer. It's not clear to me how to use Remix and metamask. In fact metamask require using web3, but in Remix if we change "JavaScript VM" to "web3 provider" an alert shows up and my code will not run in Remix. – user153465 Aug 9 '17 at 17:42
  • It's not clear how remix and metamask work together! – user153465 Aug 9 '17 at 20:25
  • Remix is an online compiler. You can code with it but to actually execute your code, it will cost ether. Metamask (choose ropsten network from the top right) will be used for this purpose. You can either get free ether from faucet in order to use on your roptsen wallet or get someone to give you some. As soon as you get the ether (not the real one), you'll be able to execute your Solidity contract. – tRosJan Aug 10 '17 at 0:25
  • In remix, you can point out where you want to deploy your contract (Where to insert it) to do that you tell it which node you will be sending the transaction, if you go to the run tab, you can change the environment variable, there you can use metmask, your current injected web3 (IE mist), ooooor a JSVM the virual machine is ran on the browser, emulates the EVM, mines instantly, and doesn't require gas (some prefounded accounts), works in a similar way to Ganache – Enrique Alcazar Nov 19 '18 at 21:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.