Skip to content

Commit

Permalink
Merge pull request #144 from rsksmart/update-java-version
Browse files Browse the repository at this point in the history
Updating minimum supported Java version
  • Loading branch information
owans authored Nov 6, 2024
2 parents dc85424 + 72e4660 commit ea547b1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/03-node-operators/04-setup/02-installation/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you already have docker installed. See how to [Install the RSKj node using Do
:::tip[For Mac M1 / M2 (Apple Chips) using x86 based software]

- Ensure you have `Rosetta` installed. This is typically pre-installed on recent macOS versions.
- Download an x86 JDK build, such as [Azul Zulu 11 (x86)](https://www.azul.com/downloads/?version=java-11-lts&os=macos&package=jdk), to ensure compatibility with x86 based software.
- Download an x86 JDK build, such as [Azul Zulu 17 (x86)](https://www.azul.com/downloads/?version=java-17-lts&os=macos&package=jdk#zulu), to ensure compatibility with x86 based software.

:::

Expand Down
24 changes: 15 additions & 9 deletions docs/03-node-operators/04-setup/02-installation/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ description: "Install RSKj using Java."
To setup a Rootstock node using Java, you need to:

- Ensure your system meets the [minimum requirements](/node-operators/setup/requirements/) for installing the Rootstock node.
- Install [Java 8 JDK](https://www.java.com/download/).
- Install [Java 17 JDK](https://www.java.com/download/).

:::warning[Important]

Starting with v6.4.0, the minimum supported Java LTS version is Java 17. Previous Java versions will no longer be supported.

:::

:::tip[For Mac M1 / M2 (Apple Chips) using x86 based software]

- Ensure you have `Rosetta` installed. This is typically pre-installed on recent macOS versions.
- Download an x86 JDK build, such as [Azul Zulu 11 (x86)](https://www.azul.com/downloads/?version=java-11-lts&os=macos&package=jdk), to ensure compatibility with x86 based software.
- Download an x86 JDK build, such as [Azul Zulu 17 (x86)](https://www.azul.com/downloads/?version=java-17-lts&os=macos&package=jdk#zulu), to ensure compatibility with x86 based software.

:::

Expand All @@ -35,16 +41,16 @@ cd ~/rskj-node-jar
```
3. **Move the JAR**: Move or copy the just downloaded jar file to your directory.
```jsx
mv ~/Downloads/rskj-core-6.3.1-ARROWHEAD-all.jar SHA256SUMS.asc /Users/{user}/rskj-node-jar/
mv ~/Downloads/rskj-core-6.4.0-ARROWHEAD-all.jar SHA256SUMS.asc /Users/{user}/rskj-node-jar/
```

### Configuration
<!-- ### Configuration
1. **Create Config Directory**: Create another directory inside `~/rskj-node-jar/config`
```jsx
mkdir config
```
2. **Download Config File**: Get `node.conf` from [here](https://github.com/rsksmart/rif-relay/blob/main/docker/node.conf).
3. **Move Config File**: Move the `node.conf` file to the `config` directory.
3. **Move Config File**: Move the `node.conf` file to the `config` directory. -->

### Run the Node

Expand All @@ -63,7 +69,7 @@ mv ~/Downloads/rskj-core-6.3.1-ARROWHEAD-all.jar SHA256SUMS.asc /Users/{user}/rs

:::tip[Tip]

Replace `<PATH-TO-THE-RSKJ-JAR>` with the actual path to your JAR file. For example, `C:/RskjCode/rskj-core-6.3.1-ARROWHEAD-all.jar`.
Replace `<PATH-TO-THE-RSKJ-JAR>` with the actual path to your JAR file. For example, `C:/RskjCode/rskj-core-6.4.0-ARROWHEAD-all.jar`.
:::

## Using Import Sync
Expand Down Expand Up @@ -130,7 +136,7 @@ After starting the node, if there's no output, this means it's running correctly
Output:

```shell
{"jsonrpc":"2.0","id":67,"result":"RskJ/6.3.1/Mac OS X/Java1.8/ARROWHEAD-202f1c5"}
{"jsonrpc":"2.0","id":67,"result":"RskJ/6.4.0/Mac OS X/Java21/ARROWHEAD-e016b25"}
```

2. To check the block number:
Expand All @@ -150,7 +156,7 @@ Output:

Output:
```jsx
{"jsonrpc":"2.0","id":1,"result":"0x0"}
{"jsonrpc":"2.0","id":1,"result":"0x3710"}
```

:::success[Success]
Expand All @@ -176,5 +182,5 @@ To change networks on the RSKj node, use the following commands:
```

:::tip[Tip]
Replace `<PATH-TO-THE-RSKJ-FATJAR>` with the actual path to your jar file. For example: `C:/RskjCode/rskj-core-6.3.1-ARROWHEAD-all.jar`.
Replace `<PATH-TO-THE-RSKJ-FATJAR>` with the actual path to your jar file. For example: `C:/RskjCode/rskj-core-6.4.0-ARROWHEAD-all.jar`.
:::
10 changes: 5 additions & 5 deletions docs/03-node-operators/04-setup/02-installation/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ Choose `mainnet` and press `Enter` to continue

## Install via Direct Downloads

You can also download the RSKj Ubuntu Package for the latest RSKj release `ARROWHEAD 6.0.0` and install it with the `dpkg` command. Follow this [download link](https://launchpad.net/~rsksmart/+archive/ubuntu/rskj/+packages) to download the matching package for your ubuntu system.
You can also download the RSKj Ubuntu Package for the latest RSKj release `ARROWHEAD 6.4.0` and install it with the `dpkg` command. Follow this [download link](https://launchpad.net/~rsksmart/+archive/ubuntu/rskj/+packages) to download the matching package for your ubuntu system.

```shell
# first install openjdk-8-jre or oracle-java8-installer
sudo apt-get install openjdk-8-jre
# first install openjdk-17-jre or oracle-java17-installer
sudo apt-get install openjdk-17-jre

# download the RSKj pacakge and find the file rskj_2.0.1~yourUbuntuVersionName_amd64.deb
# download the RSKj package and find the file rskj-6.4.0~UBUNTU_VERSION_NAME_amd64.deb

# run this command in the same directory as the deb file above
dpkg -i rskj_2.0.1~yourUbuntuVersionName_amd64.deb
dpkg -i rskj-6.4.0~UBUNTU_VERSION_NAME_amd64.deb
```

We recommend that you check that the SHA256 hash of the downloaded package file matches, prior to installation:
Expand Down
11 changes: 9 additions & 2 deletions docs/03-node-operators/04-setup/04-node-runner/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ First of all, you will need to install:
|Dependency | Details|
|------------- |-------------|
|[Git for Linux](https://git-scm.com/download/linux)| Download this Git command line tool|
|[Java 8 JDK](http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html) | Follow the steps to install Java. To check if installation went correctly, check the version with command: `java-version`. Then, as admin, modify `/etc/enviroment` adding `JAVA_HOME="/usr/lib/jvm/java-8-oracle"`|
|[Java 17 JDK](https://docs.oracle.com/en/java/javase/17/install/installation-jdk-linux-platforms.html) | Follow the steps to install Java. To check if installation went correctly, check the version with command: `java-version`. Then, as admin, modify `/etc/enviroment` adding the correct `JAVA_HOME`|

Recommended IDEs:
- [IntelliJ IDEA Community](https://www.jetbrains.com/idea/download/#section=linux)
- [Visual Studio Code](https://code.visualstudio.com/)


:::warning[Important]

Starting with v6.4.0, the minimum supported Java LTS version is Java 17. Previous Java versions will no longer be supported.

:::

## Get the source code

Using the installed command-line tool Git, you need to retrieve (or clone) the RSKj Github source code from [here](https://github.com/rsksmart/rskj).
Expand All @@ -30,7 +37,7 @@ Run these commands in the terminal:
```shell
git clone --recursive https://github.com/rsksmart/rskj.git
cd rskj
git checkout tags/ARROWHEAD-6.0.0 -b ARROWHEAD-6.0.0
git checkout tags/ARROWHEAD-6.4.0 -b ARROWHEAD-6.4.0
```

*Note:* It is better to download the code into a short path.
Expand Down
6 changes: 3 additions & 3 deletions docs/03-node-operators/04-setup/04-node-runner/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ First of all, you will need to install:
|Dependency | Details|
|------------- |-------------|
|[Git for Mac](https://git-scm.com/download/mac)| Download this Git command line tool|
|[Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) | Follow the steps to install Java. To check if installation went correctly, check the version with command: `java -version`.|
|[Java 17 JDK](https://docs.oracle.com/en/java/javase/17/install/installation-jdk-linux-platforms.html) | Follow the steps to install Java. To check if installation went correctly, check the version with command: `java -version`.|

Recommended IDEs:
- [IntelliJ IDEA Community](https://www.jetbrains.com/idea/download/#section=linux)
Expand All @@ -42,7 +42,7 @@ Run these commands on Git command line:
```shell
git clone --recursive https://github.com/rsksmart/rskj.git
cd rskj
git checkout tags/ARROWHEAD-6.0.0 -b ARROWHEAD-6.0.0
git checkout tags/ARROWHEAD-6.4.0 -b ARROWHEAD-6.4.0
```

*Note:* It is better to download the code into a short path.
Expand Down Expand Up @@ -90,7 +90,7 @@ Then set the options as shown below:
- Main Class: `co.rsk.Start`
- Working directory: `/path-to-code/rskJ`
- Use classpath of module: `rskj-core_main`
- JRE need to be set as: `Default (1.8 - SDK of 'rsk-core_main' module)`
- JRE need to be set as: `Default (17 - SDK of 'rsk-core_main' module)`

#### Running the node

Expand Down
2 changes: 1 addition & 1 deletion docs/03-node-operators/04-setup/04-node-runner/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Then set the options as shown below:
- Main Class: `co.rsk.Start`
- Working directory: `/path/to/code/rskJ`
- Use classpath of module: `rskj-core_main`
- JRE need to be set as: `Default (1.8 - SDK of 'rsk-core_main' module)`
- JRE need to be set as: `Default (17 - SDK of 'rsk-core_main' module)`

:::info[Info]
- If it isn't configured the default JDK, you have to set it in: *File -> Project Structure*.
Expand Down
36 changes: 23 additions & 13 deletions docs/03-node-operators/04-setup/reproducible-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ This is a deterministic build process used to build Rootstock node JAR file. It

It's highly recommended to follow the steps by yourself to avoid contamination of the process.

:::warning[Important]

Starting with v6.4.0, the minimum supported Java LTS version is Java 17. Previous Java versions will no longer be supported. The following example for Linux OS is showing instructions for v6.3.1, and thus uses jdk 8, this must be replaced by jdk 17 for v6.4.0 and up.

:::

## Install Docker

Depending on your OS, you can install Docker following the official Docker guide:
Expand Down Expand Up @@ -44,9 +50,9 @@ Create a ```Dockerfile``` to setup the build environment.
apt-get clean
gpg --keyserver https://secchannel.rsk.co/release.asc --recv-keys 1A92D8942171AFA951A857365DECF4415E3B8FA4
gpg --finger 1A92D8942171AFA951A857365DECF4415E3B8FA4
git clone --single-branch --depth 1 --branch ARROWHEAD-6.3.1 https://github.com/rsksmart/rskj.git /code/rskj
git clone --single-branch --depth 1 --branch ARROWHEAD-6.4.0 https://github.com/rsksmart/rskj.git /code/rskj
git clone https://github.com/rsksmart/reproducible-builds
CP /Users/{$USER}/reproducible-builds/rskj/6.3.1-arrowhead/Dockerfile /Users/{$USER}/code/rskj
CP /Users/{$USER}/reproducible-builds/rskj/6.4.0-arrowhead/Dockerfile /Users/{$USER}/code/rskj
WORKDIR /code/rskj
gpg --verify SHA256SUMS.asc
sha256sum --check SHA256SUMS.asc
Expand All @@ -63,9 +69,9 @@ Create a ```Dockerfile``` to setup the build environment.
brew cleanup
gpg --keyserver https://secchannel.rsk.co/release.asc --recv-keys 1A92D8942171AFA951A857365DECF4415E3B8FA4
gpg --finger 1A92D8942171AFA951A857365DECF4415E3B8FA4
git clone --single-branch --depth 1 --branch ARROWHEAD-6.3.1 https://github.com/rsksmart/rskj.git ./code/rskj
git clone --single-branch --depth 1 --branch ARROWHEAD-6.4.0 https://github.com/rsksmart/rskj.git ./code/rskj
git clone https://github.com/rsksmart/reproducible-builds
CP /Users/{$USER}/reproducible-builds/rskj/6.3.1-arrowhead/Dockerfile /Users/{$USER}/code/rskj
CP /Users/{$USER}/reproducible-builds/rskj/6.4.0-arrowhead/Dockerfile /Users/{$USER}/code/rskj
cd /code/rskj
gpg --verify SHA256SUMS.asc
sha256sum --check SHA256SUMS.asc
Expand All @@ -85,8 +91,12 @@ BUILD SUCCESSFUL in 55s
14 actionable tasks: 13 executed, 1 up-to-date
```

:::tip[command not found: sha256sum]

If you get the error: zsh: command not found: sha256sum
> Run the command `brew install coreutils`

Run the command `brew install coreutils`
:::

If you are not familiar with Docker or the ```Dockerfile``` format: what this does is use the Ubuntu 16.04 base image and install ```git```, ```curl```, ```gnupg-curl``` and ```openjdk-8-jdk```, required for building the Rootstock node.

Expand All @@ -96,12 +106,12 @@ If you are not familiar with Docker or the ```Dockerfile``` format: what this do
To create a reproducible build, run the command below in the same directory:

```bash
docker build -t rskj/6.3.1-arrowhead .
docker build -t rskj/6.4.0-arrowhead .
```

:::danger[Error]

if you run into any problems, ensure you're running the commands on the right folder and also ensure docker daemon is running is updated to the recent version.
if you run into any problems, ensure you're running the commands on the right folder and also ensure docker daemon is running is updated to the recent version. See how to [Setup node on Docker](/node-operators/setup/installation/docker/)

:::

Expand All @@ -117,7 +127,7 @@ This may take several minutes to complete. What is done is:
The last step of the build prints the `sha256sum` of the files, to obtain `SHA-256` checksums, run the following command in the same directory as shown above:

```bash
docker run --rm rskj/6.3.1-arrowhead sh -c 'sha256sum * | grep -v javadoc.jar'
docker run --rm rskj/6.4.0-arrowhead sh -c 'sha256sum * | grep -v javadoc.jar'
```

## Check Results
Expand All @@ -127,11 +137,11 @@ After running the build process, a JAR file will be created in ```/rskj/rskj-cor
You can check the SHA256 sum of the result file and compare it to the one published by Rootstock for that version.

```bash
27f088e5c7535974203bc77711a1e9bbaa258cd7e5d69cd368d8ca5529b38115 rskj-core-6.3.1-ARROWHEAD-all.jar
101e35cbaef4c3997432e561417f208f93e5121c52be506bcf2bf22357855bb8 rskj-core-6.3.1-ARROWHEAD-sources.jar
9e29606d4bd71dd0458ec3eaa61ab4003d6aecad4bf5a5a40cc32d8d6535de75 rskj-core-6.3.1-ARROWHEAD.jar
bb31e2e2b14f9a15f6c7ca2595a7817860334f38f5d7c6e146306275834b7564 rskj-core-6.3.1-ARROWHEAD.module
ad539153c8bb8d09307c4a77c9a8af062531241f6a5155c2cd21f0892da27b18 rskj-core-6.3.1-ARROWHEAD.pom
269c6416759ff8979e6bc6a6b1ae96ab95705f1c397df06b160a9f2070a373ce rskj-core-6.4.0-ARROWHEAD-all.jar
cb4ecbcf4654d97177389f5505764e3cc9ef5b5f87f7aca2956151c71416d315 rskj-core-6.4.0-ARROWHEAD-sources.jar
bbc0fc1bb7e865c9e11eb78317db32592c9b7dfd8a6818890729af5827a66237 rskj-core-6.4.0-ARROWHEAD.jar
fabf8af48c167d42d290e9fa44f80b76b96cd403b56c4c87f8df23fd0ea3c9f0 rskj-core-6.4.0-ARROWHEAD.module
6dbc8153d510d4e910759e2e76cf40f9c0635185f66aa612dac4b2c8a60d0c63 rskj-core-6.4.0-ARROWHEAD.pom
```

For SHA256 sum of older versions check the [releases page](https://github.com/rsksmart/rskj/releases).
Expand Down

0 comments on commit ea547b1

Please sign in to comment.