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.
You will need the following things properly installed on your computer.
- Git
- Node.js (with npm)
- Ember CLI
- Google Chrome (only for running tests)
git clone git@github.com:67P/kredits-web.git
this repositorycd kredits-web
npm install
npm start
- by default Kredits Web connects to the Rootstock testnet network- Visit the app at http://localhost:4200.
- Visit the tests at http://localhost:4200/tests.
See working with locally deployed contracts for details on how to develop with locally deployed contracts.
Make use of the many generators for code, try ember help generate
for more details
ember test
ember test --server
npm run lint:hbs
npm run lint:js
npm run lint:js -- --fix
ember build
(development)npm run build
(production)
(You need collaborator permissions on the 5apps Deploy project.)
npm run deploy
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:
Run a local IPFS deamon.
- Make sure CORS headers are configured. See IPFS for more info.
ipfs daemon
Run a local devchain with test data. (See kredits-contracts README for details.
- Clone kredits-contracts
npm install
npm run devchain
- runs a local development chainnpm run bootstrap
- deploys all contracts and seeds test datanpm link
- makes thekredits-contracts
module linkable askredits-contracts
on your machine
With IPFS and the local devchain running, you can now link the contracts and start the Ember app:
npm link kredits-contracts
- links the localkredits-contracts
package (has to be done again after everynpm install
)npm run start:local
- runs the Ember app with WEB3_PROVIDER_URL=http://localhost:8545 set
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
.
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