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

Commit e1776fb

Browse files
author
Gal Rogozinski
committed
Merge branch 'release-v1.8.1'
2 parents 6e0f635 + de72153 commit e1776fb

File tree

95 files changed

+1740
-1447
lines changed

Some content is hidden

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

95 files changed

+1740
-1447
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ about: Report a bug
66

77
<!--- Remove text and sections that do not apply -->
88
The issue tracker is only for reporting bugs or submitting feature requests.
9-
If you need technical assistance for running a node please consult the #fullnode channel on Discord (https://discord.gg/jrxApWC) or https://forum.helloiota.com/Technology/Help.
10-
If you have general questions on IOTA you can go to https://iota.stackexchange.com/, https://helloiota.com/, or browse Discord channels (https://discord.gg/C88Wexg).
9+
If you need technical assistance for running a node please consult the #fullnode channel on Discord (https://discord.iota.org) or https://forum.helloiota.com/Technology/Help.
10+
If you have general questions on IOTA you can go to https://iota.stackexchange.com/, https://helloiota.com/, or browse Discord channels (https://discord.iota.org).
1111

1212
### Bug description
1313
A general description of the bug.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ bin/
2121
*.jar
2222
src/main/ixi/
2323
dependency-reduced-pom.xml
24-
24+
.checkstyle
25+
db-bench/
26+
db-log-bench/
2527

2628
# Created by https://www.gitignore.io/api/osx,linux,windows
2729

.travis.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@ after_success:
5454
- 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')
5555
- 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
5656

57-
deploy:
58-
- provider: releases
59-
api_key:
60-
secure: "j+KolvRrsinh6OTqjli1y5I4gdPdD5MT6RFahVRrznxtcb2t7y6x41PknkI/8BksxLJKKQ1f40L307Aquzih9FmLesWcrYrCOS/B40dlCc3uV8DEZKhZF+QWqvsDpZ0EfiluGFljqGpxwngb/miNObqQzQvzpdUXBpZcuzxgqziynJD6jt3TYbNn544m/i4cWbb++b1h2Bm+jwELzJcf6/CZ1TxUh49vdM4S6yTpvnKwg4NLeH6g8s9oYEN1iwYtQokGKlH/emBZDsqDtF4KH7kXPpEKTcho4nH504XWJpanVAQ02Pha4SAnyVu4rKiLH4e6v99xZOBLVTH/qkvlwzvkNYr2xS5q9T9G7DZBRE+oc2MIbcnuSkhHwrUcmf2Hc0zCIP4RLCXAUuVlNEmIQUKgTezVzaqaEQLsa+EFIoosS+8pT/kVnaLbwxrITUmgM246+gvzMcVg8SmyPvVj6iRxfR6spTd7V2M0ePdqWlCL8P9RY4YrtxR2yJ6/3C0XNf29t+s/r1jat8fwWp8Gf7GiCaJEYG9VO24Chhi+MZCKBJnmx5G/98zvLw3f6a1FsEGZrw9RhF2vJKK6sD3rIvNkUsYmf0OhM7bf0NceFMGTJ/mFzM/JX0OHMtIyAvUfyyPVbQkIHNcGBgQMZasx07K3fjcn2lqv4FbHVi3HbdM="
61-
file_glob: true
62-
file: target/*.jar*
63-
skip_cleanup: true
64-
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
65-
deploy: mvn package -P build-extras -Dlogging-level=INFO
66-
on:
67-
tags: true
68-
repo: iotaledger/iri
69-
branch:
70-
- master
7157
env:
7258
global:
7359
- secure: oJutGSe5KK3ymwSvohFZ89UL7XaNlXH6fdO2nBEYbk5KyYuQ1Wm+h6+N/05EbwxwDK9dEiF73ZJh76sZ3IWKjRC8VWjUAz+8p38hGvQwByrVsJkrbs5SA4wA4XnyvEqyMV3yqbcgRNbMlIvj7ubUbxMizz7MA7plnumrnx9ejPG1WP4rNgzUA3XcBWHdITyOSg9rSMBJzMZ9CN1Dv+1SxZV+GlkyWN8n1Cshkq2TnNl1oRZqGKs7O0ma1dN0hUKtBa80AsCTjH8ojZFJU92gmkvAWDw5BTSZ8mhX9sZcbBYT8SnQxNDrf51HJ+K7hvdpFbsy5Z0g24cNJkA8lfUnzXFznZ/PH4hm8MeVWjRiWdE4VZr47iYzJcs0brOHSeab6fBoeTPS5899Q3V+yAw6CahfvOBthuF3Ymy+fZXoDO5242PSWXXsGwFqK7r/gT0iwJZxMBI/UUWsP/s7J/CWux8ftwbOdSbs4XdQZsuqxzKEKDDwU0FTytantsMS/vcgI41K5azyY4tbkixzydaBPvhimkflaWcuZb//mXcntitgyenaSwfkLX5pD5l1srVzSliyabnH7AprLOm1B9DBfk2leI2XgGJg/Q/GrVtcjcl1FU0aXBFhLrp3BkK7chlG2v/Eacr8Pb6NOQHORyq64n2prF6zvExX0aadOddefoA=

DOCKER.md

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
Run the official iotaledger/iri container, passing the mandatory -p option:
44

5-
```docker run iotaledger/iri:vX.X.X-RELEASE -p 14265```
5+
```sh
6+
docker run iotaledger/iri:vX.X.X-RELEASE -p 14265
7+
```
68

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.
9+
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.
810

911
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:
1012

11-
```docker run -v /path/to/conf:/iri/conf -v /path/to/data:/iri/data iotaledger/iri:vX.X.X-RELEASE -p 14265 -c /iri/conf/iri.ini```
13+
```sh
14+
docker run -v /path/to/conf:/iri/conf -v /path/to/data:/iri/data iotaledger/iri:vX.X.X-RELEASE -p 14265 -c /iri/conf/iri.ini
15+
```
1216

1317
Please refer to the IRI documentation for further command line options and iri.ini options.
1418

@@ -23,15 +27,29 @@ When building IRI via the Dockerfile provided, Docker 17.05 minimum is required,
2327

2428
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.
2529

26-
The docker conatiner supports the env variables to configure advanced options. These variables can be set but are not required to run IRI.
30+
### Advanced Configuration
31+
32+
The docker container supports the env variables to configure advanced options. These variables can be set but are not required to run IRI.
33+
34+
`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.
35+
36+
`JAVA_MIN_MEMORY` the value of -Xms option. Defaults to 2G
37+
38+
`JAVA_MAX_MEMORY` the value of -Xmx option. Defaults to 4G
39+
40+
`DOCKER_IRI_JAR_PATH` the directory where the IRI jar file is. Defaults to `/iri/target/` as pushed by the Dockerfile. This is useful if custom IRI binaries want to be executed and the default path needs to be overridden.
41+
42+
`DOCKER_IRI_JAR_FILE` the IRI jar file name to execute. Defaults to `iri*.jar`
2743

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).
44+
`DOCKER_IRI_REMOTE_LIMIT_API` defaults to "interruptAttachToTangle, attachToTangle, addNeighbors, removeNeighbors, getNeighbors"
3445

46+
`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).
47+
48+
`DOCKER_IRI_REMOTE` defaults to "true". This sets the boolean value for the "--remote" command line option. Setting to "false" ensures that the API port binds only to the localhost interface. The setting of "true" lets the API listen on all the interfaces (0.0.0.0). Set this value to "false" if you plan on running the container on the host network and want the API to bind to the localhost interface only. Set this value to false if you want to bind the --api-host (API_HOST) to a specific interface.
49+
50+
`DOCKER_JAVA_NET_PREFER_IPV4_STACK` defaults to "true". This sets the boolean value for the -Djava.net.preferIPv4Stack option. To be able to use IPv6 make sure to set this to false.
51+
52+
### Entrypoint
3553
The container entry point is a shell script that performs few additional steps before launching IRI:
3654
- verifies if `DOCKER_IRI_MONITORING_API_PORT_ENABLE` is set to 1
3755
- launches IRI with all parameters passed as desired
@@ -40,7 +58,8 @@ It is important to note that other than --remote and --remote-limit-api "$DOCKER
4058

4159
**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.**
4260

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.
61+
### Systemd Unit
62+
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 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 true` and `--zmq-enabled false`.
4463

4564
```
4665
[Unit]
@@ -53,22 +72,30 @@ TimeoutStartSec=0
5372
Restart=always
5473
ExecStartPre=-/usr/bin/docker rm %n
5574
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:vX.X.X-RELEASE \
65-
-p 14265 \
66-
--zmq-enabled \
67-
--testnet
75+
--name %n \
76+
--hostname iri \
77+
--user=1000 \
78+
--net=host \
79+
--cap-drop=ALL
80+
-v /mnt/iri/conf:/iri/conf \
81+
-v /mnt/iri/data:/iri/data \
82+
-e DOCKER_IRI_REMOTE=true \
83+
iotaledger/iri:vX.X.X-RELEASE \
84+
--port 14265 \
85+
--zmq-enabled false \
86+
--testnet false
6887
6988
ExecStop=/usr/bin/docker stop %n
7089
ExecReload=/usr/bin/docker restart %n
7190
7291
[Install]
7392
WantedBy=multi-user.target
7493
```
94+
95+
## Security Considerations
96+
97+
It is highly recommended to run IRI with an unprivileged user and not as user `root`.
98+
99+
An unprivileged user can be created on the host and the UID passed to the docker command (e.g. `--user 1001`). Directories that are mounted to the container from the host should be owned by this user.
100+
101+
In addition the `--cap-drop=ALL` passed to docker restricts process capabilities and adheres to the principle of least privilege. See https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities for more information.

Dockerfile

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,45 @@ RUN mvn clean package
1010
FROM iotacafe/java:oracle8u181.1.webupd8.1-1@sha256:21b0fb1e5b5be7cd239a742238f346e076a46dc0003670cd50f079780288773f
1111

1212
RUN apt-get update && apt-get install -y --no-install-recommends \
13-
jq curl socat \
13+
socat \
1414
&& rm -rf /var/lib/apt/lists/*
1515

1616
COPY --from=local_stage_build /iri/target/iri*.jar /iri/target/
1717
COPY docker/entrypoint.sh /
1818

19-
# Java related options. Defaults set as below
20-
ENV JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+DisableAttachMechanism -XX:InitiatingHeapOccupancyPercent=60 -XX:G1MaxNewSizePercent=75 -XX:MaxGCPauseMillis=10000 -XX:+UseG1GC"
21-
ENV JAVA_MIN_MEMORY 2G
22-
ENV JAVA_MAX_MEMORY 4G
23-
24-
# Additional custom variables. See DOCKER.md for details
25-
ENV DOCKER_IRI_JAR_PATH "/iri/target/iri*.jar"
26-
ENV DOCKER_IRI_REMOTE_LIMIT_API "interruptAttachToTangle, attachToTangle, addNeighbors, removeNeighbors, getNeighbors"
27-
28-
# Setting this to 1 will have socat exposing 14266 and pointing it on
29-
# localhost. See /entrypoint.sh
30-
# !!! DO NOT DOCKER EXPOSE (-p) 14266 as the remote api settings
31-
# will not be applied on that port !!!
32-
# You also have to maintain $DOCKER_IRI_MONITORING_API_PORT_DESTINATION
33-
# based on the actual API port exposed via IRI
34-
ENV DOCKER_IRI_MONITORING_API_PORT_ENABLE 0
35-
ENV DOCKER_IRI_MONITORING_API_PORT_DESTINATION 14265
19+
# Default environment variables configuration. See DOCKER.md for details.
20+
# Override these variables if required (e.g. docker run -e JAVA_OPTIONS="myoptions" ...)
21+
# `JAVA_OPTIONS` Java related options
22+
# `JAVA_MIN_MEMORY` and `JAVA_MAX_MEMORY` Settings for -Xms and -Xmx respectively.
23+
# See https://docs.oracle.com/cd/E21764_01/web.1111/e13814/jvm_tuning.htm#PERFM161
24+
# `DOCKER_IRI_JAR_PATH` Path where the IRI jar file is located.
25+
# `DOCKER_IRI_JAR_FILE` IRI jar file.
26+
# `DOCKER_IRI_REMOTE_LIMIT_API` Sets the --remote-limit-api options.
27+
# (Deprecation warning, see https://github.com/iotaledger/iri/issues/1500)
28+
# `DOCKER_IRI_MONITORING_API_PORT_ENABLE` When using a docker bridged network setting this to 1 will have
29+
# socat exposing 14266 and pointing it on localhost. See /entrypoint.sh
30+
# Do not enable this option when running IRI's container on host network.
31+
# !!! DO NOT DOCKER EXPOSE (-p) 14266 as the remote api settings will
32+
# not be applied on that port !!!
33+
# You also have to maintain $DOCKER_IRI_MONITORING_API_PORT_DESTINATION
34+
# based on the actual API port exposed via IRI
35+
# `DOCKER_IRI_MONITORING_API_PORT_DESTINATION` Set this to the actual IRI API port. This is used to map port 14266.
36+
# `DOCKER_IRI_REMOTE` When using a docker bridged network set this to true. Using host network
37+
# you may choose to set it to false to make sure the API port listens on
38+
# localhost only. If you want to bind your API (--api-host) to a specific interface
39+
# you will have to set this option to false.
40+
# `DOCKER_JAVA_NET_PREFER_IPV4_STACK` If set to true will allow usage of IPv4 only. Set to false to be able to use IPv6.
41+
# See https://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html
42+
ENV JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+DisableAttachMechanism -XX:InitiatingHeapOccupancyPercent=60 -XX:G1MaxNewSizePercent=75 -XX:MaxGCPauseMillis=10000 -XX:+UseG1GC" \
43+
JAVA_MIN_MEMORY=2G \
44+
JAVA_MAX_MEMORY=4G \
45+
DOCKER_IRI_JAR_PATH="/iri/target" \
46+
DOCKER_IRI_JAR_FILE="iri*.jar" \
47+
DOCKER_IRI_REMOTE_LIMIT_API="interruptAttachToTangle, attachToTangle, addNeighbors, removeNeighbors, getNeighbors" \
48+
DOCKER_IRI_MONITORING_API_PORT_ENABLE=0 \
49+
DOCKER_IRI_MONITORING_API_PORT_DESTINATION=14265 \
50+
DOCKER_IRI_REMOTE=true \
51+
DOCKER_JAVA_NET_PREFER_IPV4_STACK=true
3652

3753
WORKDIR /iri/data
3854
ENTRYPOINT [ "/entrypoint.sh" ]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The IOTA network is an independent peer-to-peer network with a first-user, frien
2727
- As a 'friend-to-friend' network, you have the privilege of joining new users into the network through your node
2828
by adding them to your approved neighbors list — ensuring that you both broadcast to them and also receive their broadcasts.
2929

30-
You can **find neighbors** on the #nodesharing channel of our [[Discord server]](https://discord.gg/7Gu2mG5).
30+
You can **find neighbors** on the #nodesharing channel of our [[Discord server]](https://discord.iota.org/).
3131

3232
Everyone will be welcoming and very happy to help you get connected.
3333
If you want to get tokens for your testcase, please just ask in one of the communication channels.

changelog.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
1.8.1
2+
3+
- Feature: Improved CW Calculation (#1451)
4+
- Feature: Automatically request trunk and branch transactions when receiving a tx needed to solidify a milestone (#1545)
5+
- Change: removes tip solidifier code (#1547)
6+
- Fix: Read from the db in order to find the existence of spent-addresses (#1540)
7+
- Fix: adds recently requested txs set to TransactionRequester (#1543)
8+
- Fix: prevents certain HTTP API calls getting executed while the not is not synced (#1533)
9+
- Fix: Rewrites request queue logic (#1530)
10+
- Fix: Up jackson-databind version to 2.9.9.1 (#1534)
11+
- Change: Fixed pmd test errors (#1526)
12+
- Change: Docker network option (#1496)
13+
- Fix: Changed TX requester removal log to Debug (#1515)
14+
- Change: Update undertow and jackson (#1511)
15+
- Fix: fixes self init. conn. being removed from reconnect pool too early (#1506)
16+
117
1.8.0
218

319
- Feature: new networking infrastructure, new network rules, and batched BCT curl (#1393)

docker/entrypoint.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ if [ "${DOCKER_IRI_MONITORING_API_PORT_ENABLE}" == "1" ]; then
55
nohup socat -lm TCP-LISTEN:14266,fork TCP:127.0.0.1:${DOCKER_IRI_MONITORING_API_PORT_DESTINATION} &
66
fi
77

8+
IRI_JAR_FILE=$(find "$DOCKER_IRI_JAR_PATH" -type f -name "$DOCKER_IRI_JAR_FILE" -print -quit)
9+
if [[ "${IRI_JAR_FILE}x" == "x" ]]
10+
then
11+
>&2 echo "ERROR: File '$DOCKER_IRI_JAR_FILE' not found in path '$DOCKER_IRI_JAR_PATH'"
12+
exit 1
13+
fi
14+
815
exec java \
916
$JAVA_OPTIONS \
1017
-Xms$JAVA_MIN_MEMORY \
1118
-Xmx$JAVA_MAX_MEMORY \
12-
-Djava.net.preferIPv4Stack=true \
13-
-jar $DOCKER_IRI_JAR_PATH \
14-
--remote true --remote-limit-api "$DOCKER_IRI_REMOTE_LIMIT_API" \
19+
-Djava.net.preferIPv4Stack="$DOCKER_JAVA_NET_PREFER_IPV4_STACK" \
20+
-jar "$IRI_JAR_FILE" \
21+
--remote "$DOCKER_IRI_REMOTE" --remote-limit-api "$DOCKER_IRI_REMOTE_LIMIT_API" \
1522
"$@"

0 commit comments

Comments
 (0)