-
Notifications
You must be signed in to change notification settings - Fork 0
Getting started with RSK – step by step
Hello everyone! It’s a really easy-to-follow tutorial to start with RSK Smart Contracts. It’s divided into small modules which duration are between 10 and 30 minutes, so you can organize your time and learn! First of all, We propose you to mount your own development environment. So, you should get/install:
Tool | Details |
---|---|
TESTRPC | on memory blockchain |
TRUFFLE | a framework to deploy and interact with deployed smart contracts |
REMIX | an online Solidity compiler, open the link in browser |
It’s a good idea to start with TestRPC because on a real blockchain we should wait miners to include our transactions on a block and then we could query over our data. With TestRPC (and because it’s a local and on memory blockchain) we would see our changes on blockchain as an instantly operation.
- Open Remix.
- You can see a default contract written in Solidity, the HelloWorld smart contract. Easy to understand!
Note the word pragma
. Source files can (and should) be annotated with a so-called version pragma to reject being compiled with future compiler versions that might introduce incompatible changes.
And a tip to learn: the constructor runs only when the contract is created.
So, we have our first smart contract!
We need TestRPC running. So, open a terminal and write:
testrpc
Ok, now you have an on memory blockchain running on your PC.
You can create your contracts using any text editor but it is a good idea to use some more advanced tool, the following is a list of some of them:
Atom IntelliJ IDEA Visual Studio Code Vim You can find a more complete list here.