Skip to content

Commit

Permalink
Merge pull request #919 from chronologic/develop
Browse files Browse the repository at this point in the history
v1.2.1
  • Loading branch information
josipbagaric authored Dec 14, 2018
2 parents fd92508 + 9e0a362 commit d066578
Show file tree
Hide file tree
Showing 13 changed files with 1,574 additions and 1,478 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ eth-alarm-clock-dapp**
yarn-error.log
electron-builds
yarn.lock
TimeNode.app/
TimeNode.app/
dappnode/build_*
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ _Update: This DApp is operational on the Mainnet as well as on the Kovan and Rop

__Homepage:__ [Ethereum Alarm Clock](http://www.ethereum-alarm-clock.com/)

__Looking for the latest install?__: [Latest Releases](https://github.com/chronologic/eth-alarm-clock-dapp/releases)
__Looking for the latest install?__ [Latest Releases](https://github.com/chronologic/eth-alarm-clock-dapp/releases)

__Want to run a TimeNode?__: [Guide](https://blog.chronologic.network/how-to-prove-day-ownership-to-be-a-timenode-3dc1333c74ef)
__Want to run a TimeNode?__ [Guide](https://blog.chronologic.network/how-to-prove-day-ownership-to-be-a-timenode-3dc1333c74ef)

__Smart Contracts__: [Source](https://github.com/ethereum-alarm-clock/ethereum-alarm-clock)

Expand All @@ -28,10 +28,16 @@ __Smart Contracts__: [Source](https://github.com/ethereum-alarm-clock/ethereum-a
### Docker
If you wish to run the DApp as a Docker container, we have a Docker [image](Dockerfile) prepared for you.
To run the container, use the following commands:
1. Build the image - `docker build -t eac_dapp https://raw.githubusercontent.com/chronologic/eth-alarm-clock-dapp/master/Dockerfile`
1. Build the image - `docker build -t eac_dapp https://raw.githubusercontent.com/chronologic/eth-alarm-clock-dapp/master/dappnode/build/Dockerfile`
2. Run the container - `docker run --name eac_dapp -d -p 8080:80 eac_dapp`
3. Visit `localhost:8080` in your browser to see the DApp running

### DAppNode
You can now run a TimeNode through [DAppNode](https://dappnode.io/):
- Search the DAppNode Installer for `timenode.public.dappnode.eth`
- Click Install
- Go to `my.timenode.public.dappnode.eth` in your browser.

### Debugging
Having issues with the project? Try these:
- Try cleaning the project `npm run clean` then running `npm run dev`
Expand Down
28 changes: 23 additions & 5 deletions app/config/web3Config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import DAYTokenABI from '../abi/DAYTokenABI';

import testnetDAYFaucetABI from '../abi/testnetDAYFaucetABI';
import { isRunningInDAppNode } from '../lib/dappnode-util';

export const MAIN_NETWORK_ID = 1;
export const ROPSTEN_NETWORK_ID = 3;
Expand All @@ -15,21 +16,38 @@ export const requestFactoryStartBlocks = {
[KOVAN_NETWORK_ID]: 5555500
};

export const PROVIDER_URLS = {
MAINNET: {
QUIKNODE: {
ws:
'wss://neatly-tolerant-coral.quiknode.io/73b04107-89ee-4261-9a8f-3c1e946c17b2/CyYMMeeGTb-EeIBHGwORaw==/',
http:
'https://neatly-tolerant-coral.quiknode.io/73b04107-89ee-4261-9a8f-3c1e946c17b2/CyYMMeeGTb-EeIBHGwORaw==/'
},
DAPPNODE: {
ws: 'ws://my.ethchain.dnp.dappnode.eth:8546',
http: 'http://my.ethchain.dnp.dappnode.eth:8546'
}
}
};

const Networks = {
0: {
id: 0,
name: 'Private',
name: 'Local',
endpoint: 'http://localhost:8545',
showInChooser: false,
explorer: '127.0.0.1:7545'
},
[MAIN_NETWORK_ID]: {
id: MAIN_NETWORK_ID,
name: 'Mainnet',
endpoint:
'wss://neatly-tolerant-coral.quiknode.io/73b04107-89ee-4261-9a8f-3c1e946c17b2/CyYMMeeGTb-EeIBHGwORaw==/',
httpEndpoint:
'https://neatly-tolerant-coral.quiknode.io/73b04107-89ee-4261-9a8f-3c1e946c17b2/CyYMMeeGTb-EeIBHGwORaw==/',
endpoint: isRunningInDAppNode()
? PROVIDER_URLS.MAINNET.DAPPNODE.ws
: PROVIDER_URLS.MAINNET.QUIKNODE.ws,
httpEndpoint: isRunningInDAppNode()
? PROVIDER_URLS.MAINNET.DAPPNODE.http
: PROVIDER_URLS.MAINNET.QUIKNODE.http,
showInChooser: true,
dayTokenAddress: '0xe814aee960a85208c3db542c53e7d4a6c8d5f60f',
dayTokenAbi: DAYTokenABI,
Expand Down
5 changes: 5 additions & 0 deletions app/lib/dappnode-util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const isRunningInDAppNode = () => {
return process.env.DAPPNODE || false;
};

export { isRunningInDAppNode };
12 changes: 12 additions & 0 deletions dappnode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# How to release to DAppNode
0. If you haven't already, create your own DAppNode on Heroku and connect to it through a VPN
1. Make sure the DApp version number (e.g. 1.1.6) in the following files matches the one in `package.json`
- `dappnode_package.json`
- `docker-compose.yml`
1. Test the new release:
- `dappnode build`
- Take the IPFS hash that was given to you and install it in your local DAppNode.
- Go to http://my.timenode.public.dappnode.eth/ and test the functionality
2. If everything looks OK, publish it with `dappnode publish`

Note: If you're having troubles setting up the DAppNode SDK, follow points 1, 2, 4 and 5 of this guide https://github.com/dappnode/DAppNodeSDK/wiki/DAppNode-SDK-tutorial.
12 changes: 9 additions & 3 deletions Dockerfile → dappnode/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM nginx:alpine
FROM nginx:1.15.6-alpine

RUN apk update && apk add --no-cache bash git jq nano python alpine-sdk nginx nodejs nodejs-npm

WORKDIR /usr/src/app
RUN git clone https://github.com/chronologic/eth-alarm-clock-dapp.git . --single-branch -b master

RUN git clone https://github.com/chronologic/eth-alarm-clock-dapp.git . --single-branch -b develop

RUN npm install
RUN npm run build
RUN npm run build:dappnode:dev

RUN rm -rf /usr/share/nginx/html/*
RUN cp -r dist/* /usr/share/nginx/html/

# Fixes an error with routing in Nginx
RUN sed -i '11itry_files $uri /index.html;' /etc/nginx/conf.d/default.conf

RUN rm -rf dist node_modules .git

EXPOSE 80
37 changes: 37 additions & 0 deletions dappnode/dappnode_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "timenode.public.dappnode.eth",
"version": "1.0.0",
"description": "The TimeNode DApp can be used earn ETH by executing transactions scheduled on the Ethereum Alarm Clock. It also allows the users to schedule a transaction themselves.",
"avatar": "../electron-app/icons/icon.png",
"type": "service",
"image": {
"path": "",
"hash": "",
"size": "",
"restart": "always",
"volumes": [
"ipfsdnpdappnodeeth_export:/export",
"/home/ipfs_data:/data/ipfs",
"data:/usr/src/app"
],
"ports": [
"31313:80"
],
"keywords": [
"ethereum",
"alarm",
"clock",
"scheduling",
"transactions",
"timenode"
]
},
"author": "Joseph Bagaric, https://github.com/Bagaric",
"homepage": "https://app.chronologic.network",
"repository": {
"type": "git",
"url": "git+https://github.com/chronologic/eth-alarm-clock-dapp.git"
},
"bugs": "https://github.com/chronologic/eth-alarm-clock-dapp/issues",
"license": "MIT"
}
10 changes: 10 additions & 0 deletions dappnode/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.4'
services:
timenode.public.dappnode.eth:
image: 'timenode.public.dappnode.eth:1.0.0'
build: ./build
volumes:
- 'ipfsdnpdappnodeeth_export:/export'
- '/home/ipfs_data:/data/ipfs'
volumes:
ipfsdnpdappnodeeth_export: {}
Loading

0 comments on commit d066578

Please sign in to comment.