This application demonstrates how to use the blockapps-rest npm package to interact with a STRATO blockchain, specifically to view assets owned by the user specified in the credentials file.
The application provides a single key functionality:
- Asset Enumeration - List all assets owned by the user configured in credentials.yaml
To run this application, you need:
- A running STRATO node
- Valid credentials in credentials.yaml
- Node.js and npm installed
index.js- Main application file containing all functionality:- OAuth authentication with the STRATO node
- API client setup for interacting with the STRATO node
- Express server and asset display functionality
credentials.yaml- Contains the credentials for authentication and user common namecredentials.template.yaml- Template file with placeholders for setting up credentialspackage.json- Project dependencies and scripts
# Clone the repository
git clone <repository-url>
cd <repository-directory>
# Install dependencies
npm install
# Set up credentials
cp credentials.template.yaml credentials.yaml
# Edit credentials.yaml with your own valuesTo start the web application:
npm startThis will start an Express server at http://localhost:3000 where you can view the assets owned by the user configured in credentials.yaml.
- The application uses OAuth for authentication
- Sensitive credentials are stored in credentials.yaml
- In a production environment, you would implement additional security measures:
- Use HTTPS
- Implement CSRF protection
- Add rate limiting
- Enhance error handling