In this box you’ll find a basic starter pack. It includes Truffle, React and Express JS.
This starter contains two main elements
app/
folder)Please read app/README to get more information about React app.
Run the unbox command
truffle unbox rsk-react-express-box
For simplicity, there is hook that is going to setup the environment and install all it’s dependencies.
As said before, this box comes with two environments
/app
)Each environment comes with a specific package.json
.
First ensure you are at the root folder and have truffle installed.
If you don’t have truffle installed you’ll need to run this in order to install it.
npm install -g truffle
To install truffle dependencies
# At project root folder (I.E '../rsk-react-express-box/')
npm install
Now, the only thing you’ll need to do it’s to copy your mnemonic to truffle-config.js
// truffle-config.json
const HDWalletProvider = require('truffle-hdwallet-provider');
//Put your mnemonic here, take care of this and don't deploy your mnemonic into production!
const mnemonic = 'A_MNEMONIC';
You can start a truffle console for any RSK network
# Console for Mainnet
truffle console --network mainnet
# Console forn Testnet
truffle console --network testnet
In order to migrate contracts to a specific network
# Migrate for Mainnet
truffle migrate --network mainnet
# Migrate for Testnet
truffle migrate --network testnet
First install it’s dependencies.
# At app folder (I.E '../rsk-react-express-box/app')
npm install
Then you can run the app/
with
# At app folder (I.E '../rsk-react-express-box/app')
npm start
The page will automatically reload if you make changes to the code.
To build the app/
run
# At app folder (I.E '../rsk-react-express-box/app')
npm build
Web3 JS and ethereumjs-tx have been bundled in order to communicate with RSK network.