- This is a clone of Substrate Front End Template
- Released under The Unlicense
- Provides exploring a DID URI, Create a DID, Resolves a DID within TrackBack, Update a DID and Revoke a DID
- Please develop further and use in production environment.
The codebase is installed using git and yarn. This tutorial assumes you have installed yarn globally prior to installing it within the subdirectories. For the most recent version and how to install yarn, please refer to yarn documentation and installation guides.
# Clone the repository
git clone https://github.com/substrate-developer-hub/did-book.git
cd did-book
yarn installYou can start the template in development mode to connect to a locally running node
yarn startYou can also build the app in production mode,
yarn buildand open build/index.html in your favorite browser.
The template's configuration is stored in the src/config directory, with
common.json being loaded first, then the environment-specific json file,
and finally environment variables, with precedence.
development.jsonaffects the development environmenttest.jsonaffects the test environment, triggered inyarn testcommand.production.jsonaffects the production environment, triggered inyarn buildcommand.
Some environment variables are read and integrated in the template config object,
including:
REACT_APP_PROVIDER_SOCKEToverridingconfig[PROVIDER_SOCKET]REACT_APP_DEVELOPMENT_KEYRINGoverridingconfig[DEVELOPMENT_KEYRING]
More on React environment variables.
When writing and deploying your own front end, you should configure:
- Custom types as JSON in
src/config/types.json. See Extending types. PROVIDER_SOCKETinsrc/config/production.jsonpointing to your own deployed node.DEVELOPMENT_KEYRINGinsrc/config/common.jsonbe set tofalse. See Keyring.
There are two ways to specify it:
- With
PROVIDER_SOCKETin{common, development, production}.json. - With
rpc=<ws or wss connection>query paramter after the URL. This overrides the above setting.