Discover a whole new world of curated decentralised applications https://dap.ps
Go to file
Andy Tudhope 430359d081
Merge pull request #1 from dap-ps/master
Sync repos after squashing commits
2019-08-07 18:00:18 +02:00
back-end fix usage of verifyUserAuth 2019-08-06 13:52:41 -04:00
config Updates after mainnet deployment 2019-08-07 11:47:39 +02:00
contracts Slight gas savings 2019-08-07 10:48:17 +02:00
public vote learn more links 2019-05-31 18:21:11 +03:00
src Remove chat until embeddable whisper 2019-08-06 21:00:06 +02:00
test Updates to working test suite 2019-07-10 17:36:55 +02:00
utils Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
.editorconfig Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
.eslintrc.json Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
.gitattributes Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
.gitignore Make sure to ignore full-build 2019-08-07 15:57:20 +02:00
.npmrc use unsafe-perm=true to fix AWS EB deploy errors 2019-06-06 08:58:12 -04:00
.prettierrc cache + withdraw 2019-05-31 14:01:31 +03:00
.soliumignore Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
.soliumrc.json Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
Discover_Specification.md Adds updated contract, tests and spec 2019-05-27 17:22:45 +02:00
LICENSE Initial commit 2019-05-27 15:50:48 +02:00
README.md Update readme 2019-08-05 14:33:59 +02:00
build.sh Updates build script for prod 2019-08-07 17:53:04 +02:00
embark.json Add etherscan verifier and remove embarkArtifacts 2019-07-31 14:54:14 +02:00
package.json Full paths needed 2019-08-07 15:53:31 +02:00
shared.mainnet.chains.json Updates after mainnet deployment 2019-08-07 11:47:39 +02:00
shared.testnet.chains.json Update to formal STT and new Discover instance 2019-07-31 12:37:56 +02:00
yarn.lock move more dependencies to devDependencies 2019-08-05 14:43:35 -04:00

README.md

Discover

Discover new and useful DApps that are mobile-friendly and easy to use. Viewing curated information does not require any special tools, though effecting the way information is ranked will require a web3 wallet, whether that is Status, MetaMask, Trust, Brave or whichever one you prefer.

Available Scripts

This project is based on Embark v4.0.1, with a few things customised for React. Currently, you'll need to run the app and Embark separately, in different tabs in your terminal.

npm run build

Builds the app into the build directory.

Running and building the app

Step 1 Build the contracts and the embark artifacts

Step 1.1 Understand contracts.js

Check the config/contracts.js file in order to check you're working with the correct contract instance. The contracts on Ropsten point at these adresses (the first is STT, the Status Test Token):

MiniMeToken: { address: '0xc55cf4b03948d7ebc8b9e8bad92643703811d162' },
Discover: { address: '0x9fb115BC152aE21ECDc81c73843673fa38e4D2dB' },

On mainnet they are:

MiniMeToken: { address: '0x744d70fdbe2ba4cf95131626614a1763df805b9e' },
Discover: { address: 'TBA' },

If you need to deploy your own, you simply need to target your local machine when deploying.

Tips: Remove any existing .embark directory and run embark run testnet --noserver. Use this etherscan address to check the address of the contract you last deployed.

https://ropsten.etherscan.io/address/0x65767f95799109ba028e0397add89b0ef637e444

Step 1.2 Generate the embark contract artifacts

Run embark build in order to generate src/embarkArtifacts/.

Observe that you find near the beginning of the Discover.js and MiniMeToken.js files the addresses you supplied in Step 1.1

Step 1.3 Fix embark configuration

In embarkjs.js line 125. If you find this._ipfsConnection.id() -> change it to this._ipfsConnection.version() This is needed because Infura's IPFS has deprecated id endpoint, but this is only updated in Embark 4.1.

Step 2. Run the client side app localy.

Run the client side application via npm run start.

Open http://localhost:3000 to view it in the browser. The page will reload if you make edits. You will also see any lint errors in the console.

Important! If you get can't establish a connection to a node error, try to open http://localhost:3000 in Chrome.

Step 3 - Run the unit tests

Use embark test

Will compile your contracts, with hot-reloading, and let you test them locally to your heart's content.

Step 4 - Building for deployment

Run the build procedure via npm run build. Once you are done, copy the contents of the build directory, in the frontend directory in the branch called app-deployment.

Deployments Steps AWS

  1. Run . build.sh, and zip the resulting full-build folder. Use . build.sh --dev when building for our dev environment.

  2. Go to AWS ElasticBeanstal console

  3. Click Upload and deploy button in the middle of the screen.

  4. Choose the .zip file containing the code

  5. Change the version if want to keep some exact numbering

  6. Click Deploy

Changing .env variables in AWS

If you've changed some smart contracts you need to change their addresses in the env variables.

  1. Go to AWS Configuration and on Software section click Modify
  2. Scroll down and find Environment Properties
  3. Change whatever property needs changing
  4. Click Apply at the bottom right

Running slither

slither . --exclude naming-convention --filter-paths token

Make sure you get TrailofBits' latest static analysis tool, and do your own static analysis on the relevant contracts that will be deployed for Discover.