Simple example of Truffle interacting with Loom DappChain, this example uses loom-truffle-provider (check LoomTruffleProvider repository for more details)
Node >= 8
In order to download the Truffle DAppChain Example there're two methods Git or Unbox
git clone https://github.com/loomnetwork/truffle-dappchain-example
cd truffle-dappchain-example
yarn install
# or
npm install
# Install Truffle if not installed
npm install -g truffle
mkdir truffle-dappchain-example
cd truffle-dappchain-example
truffle unbox loomnetwork/truffle-dappchain-example
# Download
curl https://raw.githubusercontent.com/loomnetwork/loom-sdk-documentation/master/scripts/get_loom.sh | sh
# Run
./loom init
./loom run
# On second terminal
# Deploy Migrations.sol and SimpleStore.sol
yarn deploy
# Running test on directory /test
yarn test
In order to correctly redeploy the contracts there's a command "yarn deploy:reset"
Also is possible to call truffle command directly by call "yarn truffle"
We're not versioning the build directory for this particular example, although is recommended to versioning, the limitation can be removed by editing .gitignore
The web interface is build with React using webpack to compile and generate the page
# On a third terminal
yarn serve
The web interface will be available on http://localhost:8080
- Events declared on smart contracts should have an named parameter like
NewValueSet(uint _value)
in the contractSimpleStore.sol
. Also it helps to dealing with events
BSD 3-Clause License