Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

Commit be2734c

Browse files
author
alon-e
committed
Merge branch 'release-v1.5.0'
2 parents dbd45bf + dda05dd commit be2734c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4025
-1869
lines changed

.travis.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,37 @@ addons:
1515
apt:
1616
packages:
1717
- jq
18+
- libxml2-utils
1819

1920
matrix:
2021
allow_failures:
2122
- jdk: oraclejdk9
2223

2324
script:
2425
#run tests and integration tests
25-
- mvn integration-test
26-
- echo `mvn help:evaluate -Dexpression=project.version | grep -e '^[^\[]' | grep -v 'Downloading'` > iri.version
26+
# see https://stackoverflow.com/questions/34405047/how-do-you-merge-into-another-branch-using-travis-with-git-commands?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
27+
- build_head=$(git rev-parse HEAD)
28+
- git config --replace-all remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
29+
- git fetch origin dev
30+
- git checkout -f dev
31+
- git checkout $build_head
32+
- git merge dev
33+
- mvn integration-test -Dlogging-level=INFO
2734
#run jar sanity tests
28-
- git clone https://github.com/alon-e/iri-regression
29-
- cd iri-regression
35+
- VERSION=`echo -e 'setns x=http://maven.apache.org/POM/4.0.0\ncat /x:project/x:version/text()' | xmllint --shell pom.xml | grep -v / | tr -d -`
36+
- echo $VERSION
37+
- git clone https://github.com/iotaledger/iri-regression-tests.git
38+
- cd iri-regression-tests
39+
- git checkout -f master
40+
- curl -LO https://s3.eu-central-1.amazonaws.com/iotaledger-dbfiles/dev/testnet_files.tgz
41+
- tar -xzf testnet_files.tgz
3042
- mkdir iri
3143
- cp -rf ../target iri/target
32-
- cp ../iri.version .
33-
- bash run_all_stable_tests.sh `cat iri.version`
44+
- bash run_all_stable_tests.sh $VERSION
3445
- cd ..
3546

3647
after_success:
37-
#codacy-coverage send report
48+
#codacy-coverage send report. Uses Travis Env variable (CODACY_PROJECT_TOKEN)
3849
- test $TRAVIS_PULL_REQUEST = "false" && test $TRAVIS_JDK_VERSION = "oraclejdk8" && wget -O codacy-coverage-reporter-assembly-latest.jar $(curl https://api.github.com/repos/codacy/codacy-coverage-reporter/releases/latest | jq -r .assets[0].browser_download_url)
3950
- test $TRAVIS_PULL_REQUEST = "false" && test $TRAVIS_JDK_VERSION = "oraclejdk8" && java -jar codacy-coverage-reporter-assembly-latest.jar report -l Java -r target/site/jacoco/jacoco.xml
4051

@@ -46,7 +57,7 @@ deploy:
4657
file: target/*.jar*
4758
skip_cleanup: true
4859
before_deploy: openssl aes-256-cbc -K $encrypted_5a15fa813cca_key -iv $encrypted_5a15fa813cca_iv -in codesigning.asc.enc -out codesigning.asc -d && gpg --fast-import codesigning.asc
49-
deploy: mvn package -P build-extras
60+
deploy: mvn package -P build-extras -Dlogging-level=INFO
5061
on:
5162
tags: true
5263
repo: iotaledger/iri

DOCKER.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
## Quickstart
2+
3+
Run the official iotaledger/iri container, passing the mandatory -p option:
4+
5+
```docker run iotaledger/iri:v1.5.0 -p 14265```
6+
7+
This will get your a running IRI with its API listening on port 14265, no neighbours and an empty database. The IRI Docker container by default expects data at /iri/data. Use the `-v` option of the `docker run` command to mount volumes so to have persistent data. You can also pass more command line options to the docker run command and those will be passed to IRI.
8+
9+
If you want to use a iri.ini file with the docker container, supposing it's stored under /path/to/conf/iri.ini on your docker host, then pass `-v /path/to/conf:/iri/conf` and add -c /iri/conf/iri.ini as docker run arguments. So for example the `docker run` command above would become:
10+
11+
```docker run -v /path/to/conf:/iri/conf -v /path/to/data:/iri/data iotaledger/iri:v1.5.0 -p 14265 -c /iri/conf/iri.ini```
12+
13+
Please refer to the IRI documentation for further command line options and iri.ini options.
14+
15+
## DOCKER and IRI in depth
16+
17+
The Dockerfile included in this repo builds a working IRI docker container whilst trying to stay the least opinionated as possible. This allows system administrators the option to deploy and configure IRI based on their own individual circumstances and needs.
18+
19+
When building IRI via the Dockerfile provided, Docker 17.05 minimum is required, due to the use of Docker build stages. During docker build, these are the stages invoked:
20+
- java: installs Oracle Java on top of Ubuntu
21+
- build: installs Maven on top of the java stage and compiles IRI
22+
- final container: copies the IRI jar file using the java stage as base
23+
24+
The built container assumes the WORKDIR inside the container is /iri/data: this means that the database directory will be written inside that directory by default. If a system administrator wants to retain the database across restarts, it is his/her job to mount a docker volume in the right folder.
25+
26+
The docker conatiner supports the env variables to configure advanced options. These variables can be set but are not required to run IRI.
27+
28+
`JAVA_OPTIONS`: these are the java options to pass right after the java command. It must not contain -Xms nor -Xmx. Defaults to a safe value
29+
`JAVA_MIN_MEMORY`: the value of -Xms option. Defaults to 2G
30+
`JAVA_MAX_MEMORY`: the value of -Xmx option. Defaults to 4G
31+
`DOCKER_IRI_JAR_PATH`: defaults to /iri/target/iri*.jar as pushed by the Dockerfile. This is useful if custom IRI binaries want to be executed and the default path needs to be overridden
32+
`DOCKER_IRI_REMOTE_LIMIT_API`: defaults to "interruptAttachToTangle, attachToTangle, addNeighbors, removeNeighbors, getNeighbors"
33+
`DOCKER_IRI_MONITORING_API_PORT_ENABLE`: defaults to 0. If set to 1, a socat on port 14266 directed to 127.0.0.1:DOCKER_IRI_MONITORING_API_PORT_DESTINATION will be open in order to allow all API calls regardless of the DOCKER_IRI_REMOTE_LIMIT_API setting. This is useful to give access to restricted API calls to local tools and still denying access to restricted API calls to the internet. It is highly recommended to use this option together with docker networks (docker run --net).
34+
35+
The container entry point is a shell script that performs few additional steps before launching IRI:
36+
- verifies if `DOCKER_IRI_MONITORING_API_PORT_ENABLE` is set to 1
37+
- launches IRI with all parameters passed as desired
38+
39+
It is important to note that other than --remote and --remote-limit-api "$DOCKER_IRI_REMOTE_LIMIT_API", neither the entrypoint nor the Dockerfile are aware of any IRI configuration option. This is to not tie the Dockerfile and its container to a specific set of IRI options. Instead, this contain still allows the use of an INI file or command line options. Please refer to the IRI documentation to learn what are the allowed options at command line and via the INI file.
40+
41+
**At the time of writing, IRI requires -p to be passed either via INI or via command line. The entrypoint of this docker container does not do that for you.**
42+
43+
Here is a systemd unit example you can use with this Docker container. This is just an example and customisation is possible and recommended. In this example the docker network iri must be created and the paths /mnt/iri/conf and /mnt/iri/data are used on the docker host to serve respectively the neighbors file and the data directory. No INI files are used in this example, instead options are passed via command line options, such as --testnet and --zmq-enabled.
44+
45+
```
46+
[Unit]
47+
Description=IRI
48+
After=docker.service
49+
Requires=docker.service
50+
51+
[Service]
52+
TimeoutStartSec=0
53+
Restart=always
54+
ExecStartPre=-/usr/bin/docker rm %n
55+
ExecStart=/usr/bin/docker run \
56+
--name %n \
57+
--hostname iri \
58+
--net=iri \
59+
-v /mnt/iri/conf:/iri/conf \
60+
-v /mnt/iri/data:/iri/data \
61+
-p 14265:14265 \
62+
-p 15600:15600 \
63+
-p 14600:14600/udp \
64+
iotaledger/iri:v1.5.0 \
65+
-p 14265 \
66+
--zmq-enabled \
67+
--testnet
68+
69+
ExecStop=/usr/bin/docker stop %n
70+
ExecReload=/usr/bin/docker restart %n
71+
72+
[Install]
73+
WantedBy=multi-user.target
74+
```

Dockerfile

Lines changed: 78 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,84 @@
1-
FROM maven:3.5-jdk-8 as builder
1+
FROM ubuntu:18.04 as local_stage_java
2+
3+
4+
# Install Java
5+
ARG JAVA_VERSION=8u171-1
6+
RUN \
7+
apt-get update && \
8+
apt-get install -y software-properties-common --no-install-recommends && \
9+
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
10+
add-apt-repository -y ppa:webupd8team/java && \
11+
apt-get update && \
12+
apt-get install -y oracle-java8-installer=${JAVA_VERSION}~webupd8~0 --no-install-recommends && \
13+
rm -rf /var/lib/apt/lists/* && \
14+
rm -rf /var/cache/oracle-jdk8-installer
15+
16+
# Define commonly used JAVA_HOME variable
17+
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
18+
19+
# install maven on top of java stage
20+
FROM local_stage_java as local_stage_build
21+
ARG MAVEN_VERSION=3.5.3
22+
ARG USER_HOME_DIR="/root"
23+
ARG SHA=b52956373fab1dd4277926507ab189fb797b3bc51a2a267a193c931fffad8408
24+
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
25+
26+
RUN apt-get update && apt-get install -y --no-install-recommends \
27+
curl \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
31+
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
32+
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha256sum -c - \
33+
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
34+
&& rm -f /tmp/apache-maven.tar.gz \
35+
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
36+
37+
ENV MAVEN_HOME /usr/share/maven
38+
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
39+
40+
COPY docker/mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
41+
COPY docker/settings-docker.xml /usr/share/maven/ref/
42+
43+
VOLUME "$USER_HOME_DIR/.m2"
44+
45+
# install build dependencies
46+
RUN apt-get update && apt-get install -y --no-install-recommends \
47+
git \
48+
&& rm -rf /var/lib/apt/lists/*
49+
250
WORKDIR /iri
51+
352
COPY . /iri
453
RUN mvn clean package
554

6-
FROM openjdk:jre-slim
7-
WORKDIR /iri
8-
COPY --from=builder /iri/target/iri-1.4.2.4.jar iri.jar
9-
COPY logback.xml /iri
10-
VOLUME /iri
55+
# execution image
56+
FROM local_stage_java
57+
58+
RUN apt-get update && apt-get install -y --no-install-recommends \
59+
jq curl socat \
60+
&& rm -rf /var/lib/apt/lists/*
61+
62+
COPY --from=local_stage_build /iri/target/iri*.jar /iri/target/
63+
COPY docker/entrypoint.sh /
64+
65+
# Java related options. Defaults set as below
66+
ENV JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+DisableAttachMechanism -XX:InitiatingHeapOccupancyPercent=60 -XX:G1MaxNewSizePercent=75 -XX:MaxGCPauseMillis=10000 -XX:+UseG1GC"
67+
ENV JAVA_MIN_MEMORY 2G
68+
ENV JAVA_MAX_MEMORY 4G
69+
70+
# Additional custom variables. See DOCKER.md for details
71+
ENV DOCKER_IRI_JAR_PATH "/iri/target/iri*.jar"
72+
ENV DOCKER_IRI_REMOTE_LIMIT_API "interruptAttachToTangle, attachToTangle, addNeighbors, removeNeighbors, getNeighbors"
1173

12-
EXPOSE 14265
13-
EXPOSE 14777/udp
14-
EXPOSE 15777
74+
# Setting this to 1 will have socat exposing 14266 and pointing it on
75+
# localhost. See /entrypoint.sh
76+
# !!! DO NOT DOCKER EXPOSE (-p) 14266 as the remote api settings
77+
# will not be applied on that port !!!
78+
# You also have to maintain $DOCKER_IRI_MONITORING_API_PORT_DESTINATION
79+
# based on the actual API port exposed via IRI
80+
ENV DOCKER_IRI_MONITORING_API_PORT_ENABLE 0
81+
ENV DOCKER_IRI_MONITORING_API_PORT_DESTINATION 14265
1582

16-
CMD ["/usr/bin/java", "-XX:+DisableAttachMechanism", "-Xmx8g", "-Xms256m", "-Dlogback.configurationFile=/iri/conf/logback.xml", "-Djava.net.preferIPv4Stack=true", "-jar", "iri.jar", "-p", "14265", "-u", "14777", "-t", "15777", "--remote", "--remote-limit-api", "\"addNeighbors, removeNeighbors, getNeighbors\"", "$@"]
83+
WORKDIR /iri/data
84+
ENTRYPOINT [ "/entrypoint.sh" ]

README.md

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,42 @@
66

77
## IOTA
88

9-
This is the main branch of the main IRI repository, as this is a IOTA reference implementation that is utilized specifically for what we have setup. It is a complete [[IOTA]](http://iota.org/) Node with a JSON-REST HTTP interface.
9+
The IRI repository is the main IOTA Reference Implementation and the embodiment of the IOTA network specification.
1010

11-
It allows to connect easily using java directly to a local or a remote [[IOTA node]](http://learn.iota.org/).
11+
This is a full-featured [[IOTA]](https://iota.org/) node with a convenient JSON-REST HTTP interface.
12+
It allows users to become part of the [[IOTA]](https://iota.org) network as both a transaction relay
13+
and network information provider through the easy-to-use [[API]](https://iota.readme.io/reference).
1214

13-
* **Latest release:** 1.4.2.2 Release
14-
* **License:** GPLv3
15+
It is specially designed for users seeking a fast, efficient and fully-compatible network setup.
16+
17+
Running an IRI node also allows light wallet users a node to directly connect to for their own wallet transactions.
18+
19+
-* **License:** GPLv3
1520

1621
# How to get started
1722

18-
Obviously, because this is its own, independent network, you have to go through the same process as in the main network: **find neighbors**. You can find neighbors in the [[Discord Community]](https://discord.gg/7Gu2mG5), or on [[our forum]](https://forum.iota.org/). Community members are usually very happy to help you out and get you connected. If you want to get tokens for your testcase, please just ask in one of the communication channels as well.
23+
The IOTA network is an independent peer-to-peer network with a first-user, friend-to-friend, network structure:
1924

20-
## Reporting Issues
25+
- As a 'first-user' network, to access the data streams and APIs that other users provide, you must first exchange your IP and port configuration with a current user.
2126

22-
If you notice any issues or irregularities in this release. Please make sure to submit an issue on github.
27+
- As a 'friend-to-friend' network, you have the privilege of joining new users into the network through your node
28+
by adding them to your approved neighbors list — ensuring that you both broadcast to them and also receive their broadcasts.
2329

30+
You can **find neighbors** quickly at both our [[Discord Community]](https://discord.gg/7Gu2mG5) and [[forum.iota.org]](https://forum.iota.org/).
31+
32+
Everyone will be welcoming and very happy to help you get connected.
33+
If you want to get tokens for your testcase, please just ask in one of the communication channels.
2434

25-
# Installing
35+
## Reporting Issues
2636

27-
You have two options, the preferred option is that you compile yourself. The second option is that you utilize the provided jar, which is released regularly (when new updates occur) here: [Github Releases](https://github.com/iotaledger/iri/releases).
37+
If you notice any bugs, problems or other irregularities with this release,
38+
please submit an issue on github [[submit new issue]](https://github.com/iotaledger/iri/issues/new).
2839

40+
# Installing
41+
42+
The preferred option is that you compile yourself.
43+
The second option is that you utilize the provided jar,
44+
which is released whenever there is a new update here: [Github Releases](https://github.com/iotaledger/iri/releases).
2945

3046
### Compiling yourself
3147

@@ -39,13 +55,22 @@ $ mvn clean compile
3955
$ mvn package
4056
```
4157

42-
This will create a `target` directory in which you will find the executable jar file that you can use for the
58+
This will create a `target` directory in which you will find the executable jar file that you can use.
4359

4460
### How to run IRI
4561

4662
#### Locally
4763

48-
Running IRI is pretty simple, and you don't even have to run it under admin rights. Below is a list of command line options. Here is an example script:
64+
Running IRI is quick and easy, and you can usually run it without admin rights.
65+
Below is a list of command line options.
66+
67+
At a minimum, the port must be specified on the command-line — e.g., '`-p 14265`'
68+
or in the `iota.ini` file — e.g., '`PORT = 14265`'.
69+
70+
If the '`iota.ini`' file exists, it will be read.
71+
The port and all the command line options below take precedence over values specified in the ini config file.
72+
73+
Here is an example script that specifies only the port, with all other setting to be read from the ini file **if it exists**:
4974

5075
```
5176
java -jar iri.jar -p 14265
@@ -63,29 +88,27 @@ command line arguments.
6388

6489
Option | Shortened version | Description | Example Input
6590
--- | --- | --- | ---
66-
`--port` | `-p` | This is a *mandatory* option that defines the port to be used to send API commands to your node | `-p 14800`
91+
`--port` | `-p` | This is a *mandatory* option that defines the port to be used to send API commands to your node | `-p 14265`
6792
`--neighbors` | `-n` | Neighbors that you are connected with will be added via this option. | `-n "udp://148.148.148.148:14265 udp://[2001:db8:a0b:12f0::1]:14265"`
6893
`--config` | `-c` | Config INI file that can be used instead of CLI options. See more below | `-c iri.ini`
69-
`--udp-receiver-port` | `-u` | UDP receiver port | `-u 14800`
70-
`--tcp-receiver-port` | `-t` | TCP receiver port | `-t 14800`
94+
`--udp-receiver-port` | `-u` | UDP receiver port | `-u 14600`
95+
`--tcp-receiver-port` | `-t` | TCP receiver port | `-t 15600`
7196
`--testnet` | | Makes it possible to run IRI with the IOTA testnet | `--testnet`
7297
`--remote` | | Remotely access your node and send API commands | `--remote`
7398
`--remote-auth` | | Require authentication password for accessing remotely. Requires a correct `username:hashedpassword` combination | `--remote-auth iotatoken:LL9EZFNCHZCMLJLVUBCKJSWKFEXNYRHHMYS9XQLUZRDEKUUDOCMBMRBWJEMEDDXSDPHIGQULENCRVEYMO`
7499
`--remote-limit-api` | | Exclude certain API calls from being able to be accessed remotely | `--remote-limit-api "attachToTangle, addNeighbors"`
75100
`--send-limit`| | Limit the outbound bandwidth consumption. Limit is set to mbit/s | `--send-limit 1.0`
76101
`--max-peers` | | Limit the number of max accepted peers. Default is set to 0 (mutual tethering) | `--max-peers 8`
77-
`--dns-resolution-false` | | Ignores DNS resolution refreshing | --dns-resolution-false
102+
`--dns-resolution-false` | | Ignores DNS resolution refreshing | `--dns-resolution-false`
78103
### INI File
79104

80105
You can also provide an ini file to store all of your command line options and easily update (especially neighbors) if needed. You can enable it via the `--config` flag. Here is an example INI file:
81106
```
82107
[IRI]
83-
PORT = 14700
84-
UDP_RECEIVER_PORT = 14700
85-
NEIGHBORS = udp://my.favorite.com:15600
108+
PORT = 14265
109+
UDP_RECEIVER_PORT = 14600
110+
NEIGHBORS = udp://my.favorite.com:14600
86111
IXI_DIR = ixi
87-
HEADLESS = true
88-
DEBUG = true
112+
DEBUG = false
89113
DB_PATH = db
90114
```
91-

changelog.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
1.5.0
2+
- Rework of the Tip Selection algorithm (#778)
3+
- Validate the alpha value (#817)
4+
- TipSelection: update API reference (#773)
5+
- Inserted check for number of available processors. (#758)
6+
- Improved Docker support (#744)
7+
- Faster PearlDiver (PoW) (#733)
8+
- Kerl hashing speed improvement (#628)
9+
- Logging routing rework (#727)
10+
11+
Minor changes and fixes
12+
- Fixed `attachmentTimestampUpperBound` value (#777)
13+
- Fixed `getBalances` `tips` parameter parsing (#776)
14+
- Added hash to `tx_trytes` ZMQ topic (#739)
15+
116
1.4.2.4
217
- Tag indexing (#728)
318
- TCP networking issues fixed (#592)

docker/entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# See Dockerfile and DOCKER.md for further info
3+
4+
if [ "${DOCKER_IRI_MONITORING_API_PORT_ENABLE}" == "1" ]; then
5+
nohup socat -lm TCP-LISTEN:14266,fork TCP:127.0.0.1:${DOCKER_IRI_MONITORING_API_PORT_DESTINATION} &
6+
fi
7+
8+
exec java \
9+
$JAVA_OPTIONS \
10+
-Xms$JAVA_MIN_MEMORY \
11+
-Xmx$JAVA_MAX_MEMORY \
12+
-Djava.net.preferIPv4Stack=true \
13+
-jar $DOCKER_IRI_JAR_PATH \
14+
--remote --remote-limit-api "$DOCKER_IRI_REMOTE_LIMIT_API" \
15+
"$@"

0 commit comments

Comments
 (0)