67P / kredits-web

Kredits Web UI
https://kredits.kosmos.org
6 stars 2 forks source link
emberjs kosmos kredits rsk

Build Status

Kredits Web

This is the main Web UI for Kosmos Kredits. It provides an overview of contributors and contributions, as well as the community's budget, expenses, and reimbursements.

It is an unhosted Web app, fetching all data from Rootstock and IPFS, and caching it in the browser's local database. As such, you can run the app directly from the /release directory on any Web server that can serve static assets.

Development

Prerequisites

You will need the following things properly installed on your computer.

Installation

Building/running for development

See working with locally deployed contracts for details on how to develop with locally deployed contracts.

Code generators

Make use of the many generators for code, try ember help generate for more details

Running tests

Linting

Building

Deploying

(You need collaborator permissions on the 5apps Deploy project.)

npm run deploy

Working with locally deployed contracts

The smart contracts and their JavaScript wrapper library are developed in the kredits-contracts repo/package.

You can run kredits-web on your machine, against a local, simulated blockchain. kredits-contracts contains all the tools to start and set up such a simulated network, as well as to deploy the Kredits smart contracts to it.

These are the basic steps to get up and running:

1. IPFS

Run a local IPFS deamon.

2. kredits-contracts

Run a local devchain with test data. (See kredits-contracts README for details.

3. kredits-web

With IPFS and the local devchain running, you can now link the contracts and start the Ember app:

4. Metamask network

If you want to interact with the local contracts via a Web3 wallet, switch the network to a "Custom RPC" one, with the RPC URL http://localhost:8545.

IPFS

If you haven't configured your IPFS node for CORS yet, you can do so by running the following commands:

ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["localhost:4200"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
ipfs config Addresses.Gateway /ip4/127.0.0.1/tcp/8080

Further Reading / Useful Links