Deploying the contract
If your RSK node is synchronized with the network, we can easily deploy our contract using Remix. Remix is a browser-based IDE that enables developers to compile and deploy Solidity smart contracts into the blockchain. Further instructions and details about Remix will be presented in Chapter 4, Peer-to-Peer Auctions in Ethereum and Chapter 5, Tontine Game with Truffle and Drizzle.
We need to connect Remix to our running RSK node by performing the following steps:
- Open the Remix IDE by visiting http://remix.ethereum.org.
- In the Run tab (right menu), select Environment | Web3 provider.
- In the popup, define http://localhost:4444 as your Web3 provider endpoint.
Once connected, paste the contract code into Remix's code section and, in the right-hand panel, press the Deploy button to send a transaction that deploys the selected contract. RSK VM is based on Ethereum VM, therefore the cost of deploying and interacting with the smart contract is calculated in gas. Nevertheless, the gas will be paid in SBTC.
While transferring the contract to the RSK network, Remix will display important information in the console located at the bottom of the main section.