https://github.com/3esmit/my-governance-example
https://github.com/3esmit/my-governance-example
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/3esmit/my-governance-example
- Owner: 3esmit
- License: cc0-1.0
- Created: 2020-09-23T21:56:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T17:26:19.000Z (over 5 years ago)
- Last Synced: 2025-02-23T21:16:02.550Z (over 1 year ago)
- Language: JavaScript
- Size: 457 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# My Governance Example
This is a demo project for embark framework.
## Getting Started
0. clone repository and move into folder
```bash
git clone git@github.com:3esmit/my-governance-example.git
cd my-governance-example
```
1. install node 10.17.0, recommended using nvm https://github.com/creationix/nvm
```bash
nvm install 10.17.0
nvm alias default 10.17.0
```
2. install go-ethereum (geth)
```bash
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install geth -y
```
3. install a. `ipfs` or b. `swarm` and initialize it.
- IPFS:
```bash
sudo snap install ipfs
ipfs init
```
- SWARM:
```bash
#TODO
```
4. run unit test
```bash
npx embark test
```
5. run development environment
```bash
npx embark run
```
## Deploy
### Ropsten
To deploy to ropsten you must provide the environment variable `ETH_DEPLOY_ADDRESS`:
```bash
$ export ETH_DEPLOY_ADDRESS="0x"
```
This account must appear in the accounts list (`npm run list-accs-ropsten`), and it must be encrypted with the password written in the file `config/ropsten/.password`.
If you don't have an address, use `npm run new-acc-ropsten` to create a new account, copy the address outputed in the terminal and go to a [faucet](https://faucet.dimensions.network/) to get some ropsten test ether. This keys will be saved in `~/keys/ropsten/`.
To customize the behavior, look into `config/ropsten/.env`, `script/ethereum.sh` and `package.json`.
See your address in a block explorer: `https://ropsten.etherscan.io/address/0x`
## Upload
### IPFS
To upload to a descentralized storage run `npm run upload-ropsten`.
The manual command to upload the build folder is `ipfs add -r dist/`
To access the uploaded dapp in localhost, run ipfs service:
```
ipfs daemon
```
### Swarm
TODO
The manual command to upload the build folder is `swarm --defaultpath dist/index.html --recursive up dist/`
## Publish to ENS
Setup ENS domain (go to https://app.ens.domains/)
## Scripts
Runs dapp on development network (ganache):
`npx embark test`
Runs unit tests on development network (ganache):
`npx embark run`
Creates a new account for ropsten:
`npm run new-acc-ropsten`
Lists ropsten accounts:
`npm run list-accs-ropsten`
Starts an ETH node for ropsten:
`npm run eth-ropsten`
Waits until ropsten network is synced:
`npm run wait-ropsten`
Starts ropsten node, waits network sync, deploy contracts and start webserver:
`npm run run-ropsten`
Builds ropsten, waits network sync, deploy contracts and upload to ipfs:
`npm run upload-ropsten`