Skip to content

Commit

Permalink
Update dockerfile + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
corentingiraud committed Jan 17, 2020
1 parent 922d6f3 commit 8654213
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
17 changes: 3 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,25 @@ RUN apt-get install -y ethereum

# Install jdk8
RUN apt-get -y install openjdk-8-jdk

ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64s
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV PATH $JAVA_HOME/bin:$PATH

# Install maven
RUN wget http://mirrors.ircam.fr/pub/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.zip

RUN unzip apache-maven-3.6.3-bin.zip
ENV PATH /root/apache-maven-3.6.3/bin:$PATH

# Download Web3J

# Download & install Web3J
RUN wget https://github.com/web3j/web3j/releases/download/v3.5.0/web3j-3.5.0.zip

# Unzip it

RUN unzip web3j-3.5.0.zip

# Linking

RUN echo '#!/bin/bash' >> /bin/web3j
RUN echo '~/web3j-3.5.0/bin/web3j' >> /bin/web3j
RUN chmod +x /bin/web3j

# Install solidity

RUN apt-get install -y solc


# Init private blockchain called chaine1T

RUN mkdir .ethereum && cd .ethereum
WORKDIR /root/.ethereum
COPY genesis.json .
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Ethereum experimentations

Some experimentation in the ethereum ecosystem. This repo include a team project for OT4 course in INSA Lyon.

## Build docker image from Dockerfile

`docker build . -t ethereum-tp`

It will create a new private blackchain called `chaine1T` (chaine d'inté ;-) ) in the `~/.ethereum` directory.

## Run a container in detach mode

Lunch the following command from root:

`docker run -itd --name ethereum-tp -v $(pwd)/java-project:/root/java-project ethereum-tp /bin/bash`

## Enter in the container

To obtain bash command line interface inside the container:
`docker exec -it ethereum-tp /bin/bash`

## Create new ETH account

From `~/.ethereum` directory:
```
cd ~/.ethereum/
geth account new
```

## Lunch a node with mining

From the container command line (cf `Enter in the container`):

`geth --datadir chaine1T --rpcapi personnal,db,eth,net,web3 --rpc --mine --minerthreads=1 console`
14 changes: 0 additions & 14 deletions notes.md

This file was deleted.

0 comments on commit 8654213

Please sign in to comment.