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
- Download: https://www.jetbrains.com/idea/download/
- Follow the instructions on the download page.
Any OS: IntelliJ Plugins and License
- Contact staff to obtain a license for JetBrains IntelliJ IDEA
- Install plugins, see IntelliJ IDEA
GitLab
- Login to https://gitlab.com using your email address and the invitation links sent from GitLab.
- 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
- 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
- Download from http://maven.apache.org/download.cgi
- Follow the instructions from http://maven.apache.org/install.html
Linux
sdk install maven
OpenSSH
Windows
By default, the SSH key manager, SSH Agent Service, will not be running in Windows.
-
In Powershell as Administrator, enable the service with:
Set-Service ssh-agent -Status Running -StartupType Automatic
-
Confirm that the SSH Agent Service is running and is started on boot:
Get-Service ssh-agent Get-Service ssh-agent | Select StartType
- 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
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
- Open Git Bash and generate SSH keys using
ssh-keygen
(Use at least 2048 bits RSA or 384 bit ECDSA) - 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
Confirm that it has been added with
ssh-add -L
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.
- Download
rustup
from https://rustup.rs/ - Run it and follow the instructions
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.
- Follow the Install Docker guide.
Configure access to Nexus npm and maven repositories
- Follow the Setup Nexus guide.
Production access (full-time only)
- Create a new branch for updating server-config and 'Create a merge request' when prompted.
-
Navigate to:
- Windows:
cd C:\Users\*username*\src\secata\server-config
- Linux:
cd ~/src/secata/server-config
- Windows:
-
Check out the branch created in step 1:
git fetch git checkout BRANCH_NAME
-
Prepare a password for postgres using the below generator.
Postgress hashed password -
Add the following changes in the server-config repository:
- Add your initials to the
postgres_users
list inplaybooks/database/group_vars/all.yml
- Add the generated postgres password to the "postgres_passwords" list
- Add your initials to the
users
list inplaybooks/serversetup/group_vars/all.yml
- Copy your SSH public key to
playbooks/serversetup/files/keys/YOUR_INITIALS.key.pub
- Mark the merge request as ready and assign
@ebopartisia
as reviewer.
- Add your initials to the