Skip to content

New Developer

While setting up your machine, you should familiarize yourself with the guidelines in this guide.

Update your computer

Make sure that your operating system is up to date. If you are using Windows, make sure it is Windows 11 as it is required later on.

Change your Nexus password

Login to https://nexus.secata.com/

  • Log in with Nexus username (email, created by PFF).
  • When logging in for the first time use password the default password.
  • Remember to change the password.

IntelliJ

Windows

  winget install -i JetBrains.IntelliJIDEA.Ultimate

Use the defaults in the installer with the following differences:

Installation Options

  • Update PATH Variable (restart needed)
    • Add "bin" folder to the PATH
  • Update Context Menu
    • Add "Open Folder as Project"
  • Create Associations
    • .java
    • .pom

Linux

Any OS: IntelliJ Plugins and License

  • Contact staff to obtain a license for JetBrains IntelliJ IDEA
  • Install plugins, see IntelliJ IDEA

GitLab

  1. Login to https://gitlab.com using your email address and the invitation links sent from GitLab.
  2. Generate a personal access token from Gitlab with the api scope: https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token
  3. Add a GITLAB_PRIVATE_TOKEN user environment variable.

Windows

Type in the search bar "enviroment" (eller miljøvariabler), select the top popup. Now select 'Environment Variables'. Under user variables select 'New...' and add the token.

Linux

The token can be added by adding to .bashrc the following line export GITLAB_PRIVATE_TOKEN="token"

OpenJDK

Windows

winget install EclipseAdoptium.Temurin.17.JDK

Linux

sudo apt-get install openjdk-17-jdk openjdk-17-source openjdk-17-doc

SDKMan

Windows

Not needed on Windows.

Linux

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

NodeJS LTS

Windows

winget install OpenJS.NodeJS.LTS

Linux

See: https://github.com/nvm-sh/nvm#installing-and-updating

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
nvm install --lts

Apache Maven

Windows

Linux

sdk install maven

OpenSSH

Windows

By default, the SSH key manager, SSH Agent Service, will not be running in Windows.

  1. In Powershell as Administrator, enable the service with:

    Set-Service ssh-agent -Status Running -StartupType Automatic
    

  2. Confirm that the SSH Agent Service is running and is started on boot:

    Get-Service ssh-agent
    Get-Service ssh-agent | Select StartType
    

  3. You should see "Running" and "Automatic". Otherwise you should to go to "Services" and configure "OpenSSH Authentication Agent" to automatic. Restart the computer, and check if it is running now.

Linux

Not needed on Linux.

Git

Windows

winget install -i --id Git.Git
Use the defaults in the installer with the following differences:

Select Components

  • Windows Explorer integration
    • Open Git Bash here
  • Check daily for Git for Windows updates
  • Add a Git Bash Profile to Windows Terminal

Adjusting the name of the initial branch in new repositories

  • Override the default branch name for new repositories

    main
    

Choosing the SSH executable

  • Use external OpenSSH (Very important!!)

Open a new Powershell as Administrator and run

[System.Environment]::SetEnvironmentVariable('CARGO_NET_GIT_FETCH_WITH_CLI','true',[System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable('SSH_ASKPASS','C:\Program Files\Git\mingw64\bin\git-askpass.exe',[System.EnvironmentVariableTarget]::User)
[System.Environment]::SetEnvironmentVariable('SSH_ASKPASS_REQUIRE','force',[System.EnvironmentVariableTarget]::User)

Long paths

Due to the use of very long path names in some repositories, you might encounter problems with Git on Windows.

The issue should be fixed by enabling the core.longpaths setting.

Open Git Bash and run:

git config --global core.longpaths true

Further discussion can be seen here.

At this point your ~/.gitconfig should contain the following

[core]
    longpaths = true

Linux

sudo apt-get install git

SSH Keys

  1. Open Git Bash and generate SSH keys using ssh-keygen (Use at least 2048 bits RSA or 384 bit ECDSA)
  2. Add the SSH public key to your Gitlab user.

Protect your private key with a good password.

Add SSH key to agent

Open git bash and run

ssh-add
This should add your ssh key to the ssh agent.

Confirm that it has been added with

ssh-add -L
Your public key should be in the output list.

Pull settings

mkdir -p ~/src
cd ~/src
git clone git@gitlab.com:secata/intellij-settings.git
cd intellij-settings/
./sync.sh

Install jq

jq is a command-line JSON processor that we use for scripting.

Windows

Open PowerShell as admin and run

winget install --id jqlang.jq --source winget

Log out and in for the environment variables to be set.

Linux

sudo apt-get install jq

Pull repositories

  • Add folder <user>\bin to the PATH in the user environment variables
  • Restart Git Bash
  • In Git Bash run: update.bash

TypeScript

When developing in TypeScript some external programs can be required.

  • Install Watchman (required by relay) by following this installation guide
    • Note that the latest prebuilt Windows binary may be quite far down the list of releases.
  • Make sure the following command returns the version that was downloaded: watchman -v

C++ Tooling

We need the C++ tooling for RUST.

Windows

Find the version number of the latest Windows SDK here.

Open Powershell and run

winget install Microsoft.VisualStudio.2022.BuildTools
winget install Microsoft.WindowsSDK.<version number>

Check manually the needed optionals are installed, by opening Visual Studio Installer and clicking "Modify".

Check that "Desktop development with C++" is marked and these optional are marked.

  • MSVC x64/x86 build tools
  • Windows 11 SDK
  • C++ CMake tools for Windows
  • Testing tools core features - Build Tools
  • C++ AddressSanitizer

Linux

Install build essential

sudo apt install build-essential

RUST

RUST is needed for smart contract development.

Run the following commands.

rustup target add wasm32-unknown-unknown
cargo install cargo-binutils
rustup component add llvm-tools-preview
cargo install rustfilt

Partisia-contract

Install our tool for compiling, inspecting and creating smart contracts.

Go to the repository and follow the instructions in the README.

Docker

Docker is needed to run a local blockchain and more.

Configure access to Nexus npm and maven repositories

Production access (full-time only)

  1. Create a new branch for updating server-config and 'Create a merge request' when prompted.
  2. Navigate to:

    • Windows: cd C:\Users\*username*\src\secata\server-config
    • Linux: cd ~/src/secata/server-config
  3. Check out the branch created in step 1:

    git fetch
    git checkout BRANCH_NAME
    
  4. Prepare a password for postgres using the below generator.

    Postgress hashed password
    
    
  5. Add the following changes in the server-config repository:

    1. Add your initials to the postgres_users list in playbooks/database/group_vars/all.yml
    2. Add the generated postgres password to the "postgres_passwords" list
    3. Add your initials to the users list in playbooks/serversetup/group_vars/all.yml
    4. Copy your SSH public key to playbooks/serversetup/files/keys/YOUR_INITIALS.key.pub
    5. Mark the merge request as ready and assign @ebopartisia as reviewer.