Setup
Before you start, make sure you are familiar with Calimero Terminology.
Setup your local node​
Prerequisites​
Clone repository from GitHub.
git clone https://github.com/calimero-network/core.git
or
git clone git@github.com:calimero-network/core.git
Position in the root of the project
cd core
And create a data folder for all configuration files.
mkdir data
Make sure you have Rust installed on your machine. If not, you can install it by following the instructions on the Rust website.
NOTE: Use minimum rust version 1.80.0
CLI Setup​
Setup peer nodes representing the network participants.
Initialize and start your node (separate terminal)​
cargo run -p merod -- --node-name node1 --home data init --server-port 2428 --swarm-port 2528
cargo run -p merod -- --node-name node1 --home data run
Node is now initialized and ready for use.
Docker Setup​
You can also use Docker to setup the nodes. The outcome is the same as using CLI. If you have already used CLI, you can skip this step.
First build the image
docker buildx build -t 'merod' .
Then setup and run the nodes defined in docker-compose.yml
file
docker compose up
Connect to the available node by listing running containers
docker ps
and then attach to the selected container
docker attach core-app_node_run-1
Wait for a few moments and node logs should appear.
SSL/TLS Support​
To be able to access the the node from external source on the same network you will need to install the generated self-signed certificate.
NOTE: Installing the SSL certificate is only necessary if you plan to access the node from an external source on the same network. If you are running the application locally, you do not need to install the certificate.
Steps to Add the Certificate to Your Device​
-
Locate the Certificate:
- Download the certificate from
http://localhost:<server-port>/admin-api/certificate
. - The
<server-port>
is the port number used as an argument in the--server-port
flag in the section Initialize and start your node (separate terminal). - For example:
bash http://localhost:2428/admin-api/certificate
- Download the certificate from
-
Add the Certificate to Trusted Certificates:
-
For Windows:
- Open the
Run
dialog (Win + R) and typemmc
to open the Microsoft Management Console. - Go to
File
->Add/Remove Snap-in...
. - Select
Certificates
and clickAdd
. - Choose
Computer account
, thenNext
andFinish
. - Expand
Certificates (Local Computer)
->Trusted Root Certification Authorities
. - Right-click
Certificates
, thenAll Tasks
->Import...
. - Follow the prompts to import the certificate file.
- Open the
-
For macOS:
- Double-click the certificate file.
- This will open the
Keychain Access
application. - Choose
System
from the list of keychains. - Drag and drop the certificate into the
System
keychain. - Authenticate with your administrator password if prompted.
- Right-click the certificate and select
Get Info
. - Expand the
Trust
section and selectAlways Trust
from theWhen using this certificate
dropdown.
-
For Linux:
- Copy the certificate to
/usr/local/share/ca-certificates/
(or/etc/pki/ca-trust/source/anchors/
depending on your distribution). - Run
sudo update-ca-certificates
(orsudo update-ca-trust extract
for Red Hat-based distributions).
- Copy the certificate to
-
-
Restart Your Browser:
- Close and reopen your web browser to ensure it recognizes the newly added certificate.
Rules for Generating SSL Certificates​
- If a certificate doesn't exist, a new one will be generated based on your current local IP address.
- If a certificate exists for the current IP address, it will be used.
- If a certificate exists but is not configured for the current IP address, a new certificate will be created.
NOTE: Every time a new certificate is generated (e.g., on the first start of the server or when the IP address changes), you will need to add it to your device's trusted certificates.
Congratulations on Setting Up Your Node!​
Your next step is to add an authentication mechanism to your node by adding a decentralized identity.