• Dapps
  • Getting Started
  • Docs
  • Community

Command: view

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:

  • /path/to/jon - path to your Dapp spec .json file
  • /path/to/contract/artifacts - Path to the folder containing the Truffle/Hardhat contract JSON artifacts

Example usage

Clone the demo repository and set it up:

git clone
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:

Demo Dapp

Spec validation

When you view a Dapp, solUI will first validate the spec and immediately display an error if there are any problems.

Spec error

Auto reload

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:

Auto reload

Additional options

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 ...