Notice: It is recommended to install the Carrier daemon on Ubuntu Linux version 22.04 or later, and bind it to a public IP address.
The Carrier daemon has dependencies on the following runtime components:
- Java Virtual Machine (JVM) >= Java 11
- sodium (libsodium) >= 1.0.16
To install these dependencies, please run the following commands:
$ sudo apt install openjdk-11-jre-headless libsodium23Please ensure that JDK-11 has been installed on your building machine before building the Carrier deamon debian package.
Use the following command to carry out the whole building process:
$ git clone git@github.com:elastos/Elastos.Carrier.Java.git Carrier.Java
$ cd Carrier.Java
$ ./mvnw -Dmaven.test.skip=trueOnce the build process finishes, the debian package will be generated under the directory launcher/target
with the name like carrier-launcher--.deb
After the build process completes, a Debian package will be generated in the launcher/targetdirectory with a name following the format carrier-launcher--.deb. Please note that <version> and <timestamp> will vary depending on the specific version of the package being built.
After uploading the Debian Package to the target VPS server, run the following command to install the Carrier Service:
$ sudo dpkg -i *carrier-launcher-<version>-<timestamp>.deb*The data cached under /var/lib/carrier is organized into the following structure:
/var/lib/carrier/key: Contains a randomly generated private key/var/lib/carrier/id: Contains the node ID/var/lib/carrier/dht4.cache: Contains the routing table information for IPv4 addresses/var/lib/carrier/dht6.cache: Contains the routing table information for IPv6 addresses if IPv6 is enabled/var/lib/carrier/node.db: Contains the information about Value and PeerInfo
Once the Carrier Service has been installed as a service, it is necessary to open the designated port for usage (the default is 39001):
$ sudo ufw allow 39001/udpTo check if the port is accessible, use the following command. Additionally, you can review the log file for more detailed information on the current running status:
$ sudo ufw status verbose
$ tail -f /var/log/carrier/carrier.logWe would also recommend using the 'systemctl' command to check the status of the Carrier daemon service or to start/stop the service:
$ systemctl status carrier
$ sudo systemctl start carrier
$ sudo systemctl stop carrierTo officially launch the Carrier Service and improve the health of the Carrier network, the service config file should be updated to reference the following configuration file:
{
"ipv4": true,
"ipv6": false,
"address4": "your-ipv4-address",
"address6": "your-ipv6-address",
"port": 39001,
"dataDir": "/var/lib/carrier",
"bootstraps": [
// carrier-node1
{
"id": "HZXXs9LTfNQjrDKvvexRhuMk8TTJhYCfrHwaj3jUzuhZ",
"address": "155.138.245.211",
"port": 39001
},
// carrier-node2
{
"id": "6o6LkHgLyD5sYyW9iN5LNRYnUoX29jiYauQ5cDjhCpWQ",
"address": "45.32.138.246",
"port": 39001
},
// carrier-node3
{
"id": "8grFdb2f6LLJajHwARvXC95y73WXEanNS1rbBAZYbC5L",
"address": "140.82.57.197",
"port": 39001
},
// carrier-node4
{
"id": "4A6UDpARbKBJZmW5s6CmGDgeNmTxWFoGUi2Z5C4z7E41",
"address": "107.191.62.45",
"port": 39001
}
]
}