Start Up

Embedding Chainflip into the mainframe.
To start the chainflip-node, run the following command.
sudo systemctl start chainflip-node
To check on the service, we use status.
systemctl status chainflip-node
At this point, you will need to wait for your node to catch up with the latest block. You can find the latest block on our Block Explorer.
If you try to start your engine now it will crash. Wait for your node to sync before proceeding.
To view the live logs for the validator software, check on them via tail. You can quit at anytime using ctrl/control + c
Check the Node:
tail -f /var/log/chainflip-node.log
At the start, you should see that your node is synchronising to the network, something like this:
⚙️ Syncing 105.0 bps, target=#10997, best: #10557 (0x97d4…f396), finalized: #10245 (0xb6b01551),1.4kiB/s ⬆ 1.2kiB/s
After the node is fully synced you will see something like this:
💤 Idle (15 peers), best: #3578 (0xcf9a…d842), finalized #3576 (0x6a0e03fe),27.0kiB/s ⬆ 25.5kiB/s
✨ Imported #3579 (0xa931…c03e)
Once the node has finished syncing, we can start up the engine.
To start the chainflip-engine, we issue another command.
sudo systemctl start chainflip-engine
To check on the service, we use status.
systemctl status chainflip-engine
Finally, tell both the services to start again after a reboot:
sudo systemctl enable chainflip-node
sudo systemctl enable chainflip-engine
Anytime you make changes to your config file, don't forget to run systemctl restart chainflip-engine
Check the engine logs:
tail -f /var/log/chainflip-engine.log
You should see some output that looks like this:
Starting chainflip-engine v0.5.0 (CI Build: "https://github.com/chainflip-io/chainflip-backend/tree/e4afc6f6cd81fc10d5ef2530e2bd073b2f33281c")
██████╗██╗ ██╗ █████╗ ██╗███╗ ██╗███████╗██╗ ██╗██████╗
██╔════╝██║ ██║██╔══██╗██║████╗ ██║██╔════╝██║ ██║██╔══██╗
██║ ███████║███████║██║██╔██╗ ██║█████╗ ██║ ██║██████╔╝
██║ ██╔══██║██╔══██║██║██║╚██╗██║██╔══╝ ██║ ██║██╔═══╝
╚██████╗██║ ██║██║ ██║██║██║ ╚████║██║ ███████╗██║██║
╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚══════╝╚═╝╚═╝
{"tag":"","msg":"Starting","level":"info","ts":"2022-11-08T14:56:51.426353849+00:00","bind-address":"127.0.0.1:5555","component":"health-check"}
{"tag":"","msg":"Your Chainflip account cFJQy58CJKJhNCBnV89qQhcQYQSgC6cg8dGWiTJb8xqWsMyQ3 is not staked. WAITING for account to be staked at block: 2997","level":"warn","ts":"2022-11-08T14:56:51.429253379+00:00","component":"StateChainConnector"}
{"tag":"","msg":"Your Chainflip account cFJQy58CJKJhNCBnV89qQhcQYQSgC6cg8dGWiTJb8xqWsMyQ3 is not staked. WAITING for account to be staked at block: 2998","level":"warn","ts":"2022-11-08T14:56:55.009871371+00:00","component":"StateChainConnector"}
Starting chainflip-engine v0.5.0 (CI Build: "https://github.com/chainflip-io/chainflip-backend/tree/e4afc6f6cd81fc10d5ef2530e2bd073b2f33281c")
In the next section, you'll learn how to stake your node. After you do so the warnings should stop and the output will look something like this:
{"tag":"","msg":"Processing SC block 3591 with block hash: 0xe3ba3f20dc6d6d5956a88e5fcae06cdbb5c9cbf486a8db50cc5a1403bb4f0446","level":"debug","ts":"2022-11-08T15:56:13.652392888+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3592 with block hash: 0x34155ced75831f45b17af9a792e057eabe148428b450ece4408f546342343669","level":"debug","ts":"2022-11-08T15:56:19.052722257+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3593 with block hash: 0x50fdbb6ad0657f0d818e783330d697186d649e793046c7f67f8120559243b5d6","level":"debug","ts":"2022-11-08T15:56:25.782233200+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3594 with block hash: 0xb878309015b27f7b8bc19c67ff5774841d44d9ed4ce189ebd5df32d0a90e5ae5","level":"debug","ts":"2022-11-08T15:56:31.181866542+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3595 with block hash: 0xa047c1f10f595cd73148aa4866a40edb3da87ddd13ae03351c19a8d677cb99ec","level":"debug","ts":"2022-11-08T15:56:37.890330488+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3596 with block hash: 0xaecccf0842c7253bbbc736baa86cebc07d5e6dc6b5b95e73d1ace73e5552fcfd","level":"debug","ts":"2022-11-08T15:56:43.274036666+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3597 with block hash: 0xc4218c16ed3f6745433ec4b50dde94cb3b1a917ee8ddc35f17dc4e956380a787","level":"debug","ts":"2022-11-08T15:56:50.015185019+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3598 with block hash: 0x3a79dc208b48276e7b734da0c8702f817d1a435476d09cbd972f09d3e5786851","level":"debug","ts":"2022-11-08T15:56:55.406457068+00:00","component":"SCObserver"} {"tag":"","msg":"Processing SC block 3599 with block hash: 0x49a53aa5f42190e5dc38d2e44d96235c656eec4101edd7fb26869466635216c3","level":"debug","ts":"2022-11-08T15:57:00.797006133+00:00","component":"SCObserver"}
If the engine starts crashing and reporting errors, don't panic. Your node might be catching up and syncing blocks from the network. Give it some time and it should recover and start working. In the meantime you can head to the next section and start with the staking process.
logrotate is a tool which will split up your log file based on the day that the log messages were generated. It is packaged with most Linux distributions, but if you don't have it, you should be able to get it with an apt install logrotate.
Check whether you have logrotate already installed by running:
logrotate
If you have it installed you'll get output that looks like this:
logrotate 3.14.0 - Copyright (C) 1995-2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU General Public License
Usage: logrotate [-dfv?] [-d|--debug] [-f|--force] [-m|--mail=command]
[-s|--state=statefile] [-v|--verbose] [-l|--log=logfile] [--version]
[-?|--help] [--usage] [OPTION...] <configfile>
First, we need to make a config file for logrotate.
sudo nano /etc/logrotate.d/chainflip
Then we need to add our configuration options to this file:
/var/log/chainflip-*.log {
rotate 7
daily
dateext
dateformat -%Y-%m-%d
missingok
notifempty
copytruncate
nocompress
}
Press "Ctrl + o" to save and then "Ctrl + x" to quit the editor. Then run the following two commands to give the root user ownership of the file:
sudo chmod 644 /etc/logrotate.d/chainflip
sudo chown root.root /etc/logrotate.d/chainflip
That's it! Your log files should now be split daily into different files, which will make submitting them to the team a lot simpler.