Skip to content

Latest commit

 

History

History
105 lines (73 loc) · 2.58 KB

1-01.md

File metadata and controls

105 lines (73 loc) · 2.58 KB
Step 1: Setup Environment

I'm using node v9.11.2 and yarn v1.7.0 for this. NPM and other versions of node should, work just a heads up ☝️

First off, make a new project folder somewhere:

mkdir ./workshop && cd ./workshop

Unbox truffle shavings and install your dependencies using npx (should be included with current version of npm).

npx truffle unbox okwme/truffle-shavings

yarn
# or
npm install

Create your .env and open the project in your favorite editor in order to add your different network specific mnemonic phrases and Infura API key:

touch .env

code .
# or
atom .
TRUFFLE_MNEMONIC=buddy drum hawk truck taxi dish card medal sketch shallow intact stool
GANACHE_MNEMONIC=grid voyage cream cry fence load stove sort grief fuel room save
TESTNET_MNEMONIC=your mnemonic phrase that unlocks accounts with rinkenby balances
INFURA_API_KEY=y0uRiNfUr4k3y 

If you don't have an account with Rinkeby ETH you can use the account I made for this tutorial. Just be careful cause if you're using it at the same time as someone else and try to run transactions at the same time, there will be nonce collisions which will prevent some transactions from going through.

TESTNET_MNEMONIC=flash gravity sister tip question story slam square resemble intact require voyage

And you're welcome to use the Infura key I made for this workshop:

INFURA_API_KEY=85939c42711147b291a40dc3a77177f8

Make sure the boilerplate contracts compile, deploy and pass the dummy test locally and on rinkeby

$ yarn test
Using network 'test'.

Compiling ./contracts/Migrations.sol...
Compiling ./contracts/Sample.sol...
        Sample deployed at: 0x345cA3e014Aaf5dcA488057592ee47305D9B3e10


  Contract: Sample
        68922 - Deploy sample
        -----------------------
        68,922 - Total Gas
    Sample.sol
      ✓ should pass


  1 passing (171ms)

and just make sure our testnet account has gas let's try rinkeby

$ yarn test --network rinkeby
Using network 'rinkeby'.

Compiling ./contracts/Migrations.sol...
Compiling ./contracts/Sample.sol...
        Sample deployed at: 0x345cA3e014Aaf5dcA488057592ee47305D9B3e10


  Contract: Sample
        68922 - Deploy sample
        -----------------------
        68,922 - Total Gas
    Sample.sol
      ✓ should pass


  1 passing (171ms)

Create a new repo on github, gitlab or bitbucket and add our boilerplate

git init
git add .
git commit -m 'Step 1: Setup Environment'
git remote add origin git@github.com:{username}/{repo}.git
git push -u origin master

Go to step 2