Skip to content

Commit

Permalink
General improvement and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
eduadiez committed Nov 9, 2018
1 parent 807c409 commit 702800b
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 52 deletions.
5 changes: 0 additions & 5 deletions Dockerfile

This file was deleted.

79 changes: 68 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,72 @@
# DNP_rinkeby
Dappnode package responsible for providing the rinkeby chain
# Rinkeby Testnet DAppNode package

Aragon Repo at [0x2dbc4622fde0dc5d1d1c6fc908678cddba81c189](https://etherscan.io/address/0x2dbc4622fde0dc5d1d1c6fc908678cddba81c189)
[![DAppNodeStore Available](https://img.shields.io/badge/DAppNodeStore-Available-brightgreen.svg)](http://my.admin.dnp.dappnode.eth/#/installer/rinkeby.dnp.dappnode.eth)

Version 0.1.0
[![Website dappnode.io](https://img.shields.io/badge/Website-dappnode.io-brightgreen.svg)](https://dappnode.io/)
[![Documentation Wiki](https://img.shields.io/badge/Documentation-Wiki-brightgreen.svg)](https://github.com/dappnode/DAppNode/wiki)
[![GIVETH Campaign](https://img.shields.io/badge/GIVETH-Campaign-1e083c.svg)](https://alpha.giveth.io/campaigns/OcKJryNwjeidMXi9)
[![RIOT DAppNode](https://img.shields.io/badge/RIOT-DAppNode-blue.svg)](https://riot.im/app/#/room/#DAppNode:matrix.org)
[![Twitter Follow](https://img.shields.io/twitter/follow/espadrine.svg?style=social&label=Follow)](https://twitter.com/DAppNode?lang=es)

Dappnode package responsible for providing the Rinkeby chain ( based on go-ethereum v1.8.17)

Aragon Package Manager Repo at [0x2dbc4622fde0dc5d1d1c6fc908678cddba81c189](https://etherscan.io/address/0x2dbc4622fde0dc5d1d1c6fc908678cddba81c189)

You can use this package without installing it in your DAppNode following these instructions:

## Prerequisites

- git

Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) commandline tool.

- docker

Install [docker](https://docs.docker.com/engine/installation). The community edition (docker-ce) will work. In Linux make sure you grant permissions to the current user to use docker by adding current user to docker group, `sudo usermod -aG docker $USER`. Once you update the users group, exit from the current terminal and open a new one to make effect.

- docker-compose

Install [docker-compose](https://docs.docker.com/compose/install)

**Note**: Make sure you can run `git`, `docker ps`, `docker-compose` without any issue and without sudo command.


## Buidling

`docker-compose build`

## Running

### Start

`docker-compose up -d`

### View logs

`docker-compose logs -f`

### Stop

`docker-compose down`

## Extra options

You can write extra options on the adminui or edit the `docker-compose.yml` and add extra options, such as:
```
- EXTRA_OPTS=--syncmode full --gcmode archive --wsapi "db,eth,net,ssh,miner,web3,personal,admin"
```

## Connect using web3js

If the package is running and you're connected to your dappnode you can use:
```
var Web3 = require('web3');
var web3 = new Web3('ws://my.rinkeby.dnp.dappnode.eth:8546')
web3.eth.getBlockNumber().then(console.log)
```
[
{
"path": "dappnode_package.json",
"hash": "QmWs8dH5H8Jkukncbna5qj8ASWsCAa7W2TRsSXeystV4mm",
"size": 885
}
]
In case you are running it locally:
```
var Web3 = require('web3');
var web3 = new Web3('ws://127.0.0.1:8546')
web3.eth.getBlockNumber().then(console.log)
```
20 changes: 20 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Build Geth in a stock Go builder container
FROM golang:1.11-alpine as builder

WORKDIR /usr/src/app

RUN apk add --no-cache make gcc musl-dev linux-headers git

ARG BRANCH=v1.8.17

RUN git clone -b $BRANCH https://github.com/ethereum/go-ethereum.git
RUN cd go-ethereum && make geth

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest

RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/src/app/go-ethereum/build/bin/geth /usr/local/bin/

EXPOSE 30303 30303/udp 30304/udp
ENTRYPOINT geth --rinkeby --rpc --rpccorsdomain "*" --rpcaddr="0.0.0.0" --rpcvhosts "*" --ws --wsaddr="0.0.0.0" --wsorigins="*" $EXTRA_OPTS
77 changes: 43 additions & 34 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
{
"name": "rinkeby.dnp.dappnode.eth",
"version": "0.1.0",
"description": "Rinkeby chain for DAppNode (ethereum/client-go:v1.8.11)",
"avatar": "/ipfs/QmShX6GQ7j3893zRuyLU6mryuPaNufyjFqLy7xJRSFaMMa",
"type": "library",
"image": {
"path": "rinkeby.dnp.dappnode.eth_0.1.0.tar.xz",
"hash": "/ipfs/QmeuB9AhaE36PWCxbke1uWy1mUnt75cot4e1enPnS6Mirt",
"size": 10062348,
"ports": [
"30303"
],
"volumes": [
"rinkeby:/home/.rinkeby"
]
},
"author": "Eduardo Antuña Díez (eduadiez)",
"keywords": [
"geth",
"rinkeby",
"ethereum"
"name": "rinkeby.dnp.dappnode.eth",
"version": "0.2.0",
"description": "Rinkeby chain for DAppNode based on go-ethereum v1.8.17",
"avatar": "rinkeby.png",
"type": "library",
"image": {
"path": "",
"hash": "",
"size": "",
"ports": [
"31313:30303",
"31313:30303/udp",
"31314:30304"
],
"homepage": {
"homepage": "http://rinkeby.io/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/DAppNodePackages/rinkeby.git"
},
"bugs": {
"url": "https://github.com/dappnode/DAppNode/issues"
},
"license": "GPL-3.0",
"dependencies": {}
}
"volumes": [
"rinkeby:/root/.ethereum/rinkeby"
],
"environment": [
"EXTRA_OPTS"
]
},
"author": "DAppNode Association <admin@dappnode.io> (https://github.com/dappnode)",
"contributors": [
"Eduardo Antuña <eduadiez@gmail.com> (https://github.com/eduadiez)"
],
"keywords": [
"geth",
"rinkeby",
"ethereum",
"testnet",
"go-ethereum"
],
"homepage": {
"homepage": "http://rinkeby.io/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dappnode/DAppNodePackage-rinkeby.git"
},
"bugs": {
"url": "https://github.com/dappnode/DAppNodePackage-rinkeby/issues"
},
"license": "GPL-3.0"
}
16 changes: 14 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
version: '3.4'
services:
rinkeby.dnp.dappnode.eth:
build: .
image: 'rinkeby.dnp.dappnode.eth:0.1.0'
image: 'rinkeby.dnp.dappnode.eth:0.2.0'
build: ./build
volumes:
- 'rinkeby:/root/.ethereum/rinkeby'
environment:
- EXTRA_OPTS=
ports:
- '127.0.0.1:8546:8546'
- '127.0.0.1:8545:8545'
- '31313:30303'
- '31313:30303/udp'
- '31314:30304/udp'
volumes:
rinkeby: {}

0 comments on commit 702800b

Please sign in to comment.