SCRIPT FOR ADDING FUNCTION TO SOLIDITY AND CONNECTING:
- Update the contract.sol to add the function
- run
truffle compile
- run
truffle migrate
- Go to
middleware/
and find corresponding javascript- Add corresponding JS function that accepts any data to go to the solidity contract function
- Go to
/src/actions/index.js
and create an action that will be called by GUI to invoke function- Make sure to export that actions
- At top of file, import this from a reducer that will be created
- Go to
/reducers/
and open the file
This is a template project that can be used as the basis for an Ethereum Dapp.
You'll want to have the following installed globally
In the project directory, run these commands:
npm install
npm start
This is an overview of the development environment I use.
For reference, consider these depictions of generic redux flows taken from [ReachJS Issue #653](https://github.com/reactjs/redux/issues/653].
This section describes the reducers, state model and actions used in the YAEE sample application included in this project.
The reducers maintain state
The redux-thunk middleware component is used to incercept the asynchronous server calls from web3.filter()
events.
The redux-logger middleware component provides clean logging of state before, actions and state after for debugging.
The state model represents on-chain data including accounts
and transactions transactions
and off-chain data like the list of cryptos
or tokens that can be transfered and transfer
details captured from the view.
The application state is initialized by calling actions getAllAccounts
, getCryptos
and fetchTransactions
. For now, fetchTransactions
initalizes the web3.filter()
to listen for the latest transacations.