Dapp for donating ether without losing ownership
Welcome to the code for Giveth's dapp. This is an open source effort to realize the potential of ethereum smart contracts. More specifically, the Giveth dapp provides an alternative to traditional donation.
- Getting Started
- Build
- Dependencies
- Where are the config files?
- You don't use Redux?
- Local Development with TestRPC
- Testing Environments and CI
- Help
- Click Star on this repo near the top-right corner of this web page (if you want to).
- Join our slack if you haven't already.
- Fork this repo by clicking Fork button in top-right corner of this web page. Continue to follow instruction steps from your own giveth-dapp repo.
- Clone your own "giveth-dapp" repo. Copy the link from the "Clone or download" button near the top right of this repo's home page.
- The rest of these steps must be done from your machine's command line. See the OSX and Linux or Windows section to continue.
- From the desired directory you wish to copy the "giveth-dapp" folder with source files to.
NOTE: Please use
git clone {paste your own repo link here}
develop
branch for contributing.git clone -b develop {paste your own repo link here}
- Change directories to giveth-dapp:
cd giveth-dapp
- Make sure you have NodeJS (v8.4.0 or higher) and npm (5.4.1 or higher) installed.
- Install dependencies from within giveth-dapp directory:
npm install
- That is it, you are now ready to run the giveth-dapp! Head to the Run dapp section for further instructions.
- Make sure you have the LTS version of 64-bit NodeJS (v8.9.1)
- Run the node-v8.9.1-x64.msi installer and then continue through the installation as normal. Be sure to have the "Enable in PATH" option enabled before installing.
- Open the command line in administrator mode by right clicking on the cmd.exe application and selecting "Run as administrator"
- In the administrator command prompt, change to the directory where you want to store this repository.
cd C:\some\directory\for\repositories
- Update npm to the latest version (in order to make sure the next step has the latest dependencies to install) with:
npm install npm@latest -g
- You must install the NodeJS/NPM dependcies for Windows before you are able to continue. This command will take a few minutes to install all of the necessary dependencies for building NodeJS applications on Windows.
npm install -g windows-build-tools
- Install dependencies from within giveth-dapp directory:
npm install
- For some reason the npm node-sass package does not install correctly in windows when using the 'npm install' command, so you must rebuild the node-sass package with:
npm rebuild node-sass
- The web3 package does not install correctly when using the 'npm install' command, so you must install it separately in order for this dapp to run. Use the following to install web3:
npm install web3
- That is it, you are now ready to run the giveth-dapp! Head to the Run dapp section for further instructions.
-
The Giveth dapp will need to connect to a feathers-giveth server. Follow the feathers-giveth readme instructions to install and run server before proceeding further.
-
From the giveth-dapp directory, create a filed called
.env.local
with these configs.PORT=3010 REACT_APP_FEATHERJS_CONNECTION_URL=http://localhost:3030 REACT_APP_ETH_NODE_CONNECTION_URL=ws://localhost:8546
-
Start the dapp.
npm start
-
Once the dapp is up in your browser, click "Sign In" from the main menu.
-
For testing locally, choose any of the wallet files found in the
giveth-dapp/keystores/
folder using the wallet password:password
. DO NOT USE THESE ON MAINNET ETHEREUM.
Video tutorial walkthrough here: https://tinyurl.com/y9lx6jrl
npm run build
NOTE: due to a bug in Safari create-react-app's output does not work in Safari (and any iPhone browser) To fix this:
cd /node_modules/giveth-react-scripts/config
open webpack.config.prod.js
go to line 300, and add:
mangle: {
safari10: true,
},
now the build will work in Safari
- You need to use Node > v6
- You need to use npm 4.x, or npm >= 5.3, or yarn to correctly install the dependencies
- Don't use NPM? All commands can be used using Yarn.
- Don't like port 3010? Change it in
.env
- Bootstrap 4 (via CDN)
- Font Awesome (via CDN)
- Sass
All dependencies can be found in package.json, however here are the most important ones:
- React Router
This project is setup using Create React App. It can do almost everything (config via package.json) and best, it just works! :-)
If required you can 'eject' the project by running npm run eject
. Note that there's no way back!
Nope. We use container architecture instead. So persistent data is loaded in containers, for example Application.js
, and passed on as props to its children.
As long as a container is rendered the data is persistent.
When running testrpc
locally and in deterministic
mode, you can use any of the keystores in the keystores
when loading your wallet.
This will provide you access to the testrpc accounts for local development. Each keystore uses the same password: password
. DO NOT USE
THESE ON MAINNET ETHEREUM.
- The Giveth Dapp is auto deployed from the master branch and is live on Ropsten and can be reached here: https://alpha.giveth.io
- In order to use the dapp you will need ETH on the Ropsten network. You can use this faucet to get some: http://faucet.ropsten.be:3001/
- "sign up" on the dapp to create an account.
- Go to the "wallet" page to see your new address (0x..). Copy and past that address into the faucet link above and you will have Ropsten network ETH for testing.
- The Giveth Dapp is auto deployed from the develop branch to a remote testrpc instance and can be reached here: https://giveth-develop.netlify.com/
- In order to use the dapp you will need ETH on testrpc. You can do this by downloading a testrpc wallet from here: https://drive.google.com/open?id=1EU3U2dFkFD0MuSQqN2GjZIosvuaP4u_S
- You can use one of the downloaded json files to "sign in" on the dapp. The password is: password
- Never use this wallet anywhere except for testing. It should have ETH if you run testrpc locally or here on the develop environment: https://giveth-develop.netlify.com/
- Sometimes testrpc crashes. You can check if it's up by seeing if there is an error here: https://feathers3.giveth.io/get-state/
- If you see pretty json, then you're looking at the state of the running testrpc blockchain. If you see an error message, than testrpc needs to be restarted. Reach out to @oz on slack.
- We are hoping to replace remote testrpc with private geth node via puppeth, as soon as we figure it out :)
Reach out to us on slack for any help or to share ideas.