Use the view command to render and a Dapp in your browser:
solui view --spec /path/to/json --artifacts /path/to/contract/artifacts
What the arguments mean:
Clone the demo repository and set it up:
git clone https://github.com/solui/demo.git cd demo npm install
Compile and deploy the demo contracts (ensure you have a private chain running in a separate terminal):
npm run truffle compile npm run truffle migrate
Now view the interface:
solui view --spec contracts/erc20/ui.json --artifacts build/contracts
Open up the browser to http://localhost:3001. You should now be able to view and use the ERC20 token Dapp:
When you view a Dapp, solUI will first validate the spec and immediately display an error if there are any problems.
The CLI will watch both the spec file and contract artifacts for changes. If any file changes are detected then the in-browser Dapp will seamlessly automatically reload.
This makes for a very smooth edit -> save -> preview development cycle.
The CLI will output information to the terminal whenever a change is detected and the Dapp is to be reloaded:
To change the default HTTP listening port for the Dapp renderer:
solui view --port 12345 ...
For more verbose logging in the terminal:
solui view --verbose ...