Getting Started with SKALE — Part 1
By: Christine Perry
Tags: Dapps, Getting Started, Blockchain, Ethereum, Layer 2

Deploying to Your SKALE Chain

For the first article in this series, we’ll be covering the process of deploying an existing decentralized application to a SKALE Chain. In our next article, we will cover the usage of SKALE Admin and review: SKALE Chain configuration, creation, and destruction.

Nothing New To Learn

If you have ever used Truffle and MetaMask, this should be a breeze for you! The only difference in your setup for deploying to SKALE is that you will be using a custom RPC address from one of the running SKALE Chain testnets. As we continue to test and make SKALE Chains more robust and user friendly, we ask that you join our Discord to provide any feedback you may have on your experience and how we can improve! You’ll also need to join that to use our testnet faucet…

Note: If you are attending ETHDenver 2019 and plan on competing for one of SKALE’s prizes or bounties, make sure to reserve your SKALE Chain here.

Connecting to the Testnet

Before updating your Truffle configuration, make sure to connect to one of our testnets with your favorite web3 provider / wallet (we like MetaMask).

In this video, we connect to a SKALE testnet using a custom RPC connection in MetaMask. Now that we’ve connected, the next step is to get testnet ETH to use it. Leave a message in #gas-me in our discord channel with your address and we will add you to the whitelist to enable the transfer of 1 testnet Ether to your account within 30 minutes.

Deploying to the Testnet

Updating truffle.js

After you’ve confirmed receipt of your testnet Ether, it’s time to update your deployment scripts to point to one of SKALE’s testnets.

Just as truffle can be used to deploy your smart contracts on to Ethereum, it can also be used to deploy them to SKALE! Simply update your truffle configuration file (truffle.js) to point to your SKALE Chain’s IP Address / port and include your private key or MetaMask mnemonic to sign your dApp’s transactions.

NOTE: If you prefer to sign with your MetaMask account, the truffle-hdwallet-provider package allows you to use your MetaMask mnemonic. Alternatively, if you simply want to use a private key, utilizing the truffle-privatekey-provider package will make this possible.

Deploying Your Contracts

After you’ve configured your truffle.js file, running truffle migrate — network skale will deploy your contracts (assuming they don’t have syntax errors).

After your first successful deployment, you may want to try deploying something a little more complex — remember, SKALE can handle much greater computation abilities at a fraction of the cost! So, any compromises you made on your code to fit it into the EVM can likely be reverted :)

Calling Your Contracts

After your code has been deployed, you can use web3.js or any similar tool to call your contracts just as you did before! SKALE is written on the EVM, so all existing tooling is 100% compatible — allowing you to continue focusing on #buidling instead of having to learn yet another toolset.

Congratulations, you are now running and calling contracts on a PoS testnet!

Learn More

Want to learn more about SKALE? Make sure to join us on Discord and check out our Developer Documentation!

Feel free to also check out our Technical Overview and Consensus Overview for a deeper dive into how SKALE works and is able to provide 20,000 TPS.