This repo is a proof of concept for getting Drizzle to work on React Native.
- Install dependencies:
yarn
- Install
ganache-cli
globally:npm install -g ganache-cli
- Install
truffle
globally:npm install -g truffle
- Start React Native Metro bundler:
react-native start
- Start your emulator/plug in your device
- Start
ganache-cli
:ganache-cli -b 3
- Compile and migrate contracts:
yarn run setup
- Do steps for Testing Dynamically Added Contract
- Install app:
react-native run-android
- Start
ganache-cli
:ganache-cli -b 3
- Compile and migrate contracts:
truffle compile && truffle migrate
- Do steps for Testing Dynamically Added Contract
- Install app: Do it through Xcode
- Find your
LOCAL_MACHINE_IP
by checking your network settings on your Mac where Ganache is running - Start
ganache-cli
:ganache-cli -b 3 -h LOCAL_MACHINE_IP
- In
./truffle.js
fordevelopment
, point Truffle toLOCAL_MACHINE_IP
- Compile and migrate contracts:
truffle compile && truffle migrate
- In
./app/core/Core.js
, point Drizzle toLOCAL_MACHINE_IP
const options = { ... web3: { fallback: { type: "ws", url: "ws://192.168.0.107:8545" } } };
- Do steps for Testing Dynamically Added Contract
- Install: Do it through Xcode
- In a different Truffle project, deploy another version of TutorialToken (or any token with the method
totalSupply
) to your Ganache testnet:truffle compile && truffle migrate
- Copy the address that the contract was deployed to
- Paste the address into the variable
address
inapp/examples/DynamicContract.js