owned this note
owned this note
Published
Linked with GitHub
# Quick guide to IRC
###### tags: `tutorials` `irc`
## Background
IRC (Internet Relay Chat) is a protocol which allows users to connect to Servers and chat with each other.
Each Server may have one, but usually multiple Channels (i.e. Chat Rooms) which can be joined. Servers often also permit Private Messages (DMs) between users.
Users can connect to Servers using standalone apps, web apps or terminal-based programs. WeeChat, mIRC, Textual & IRSSI are a few popular programs for this.
### Bitcoin
The Bitcoin community has been using IRC as a global messenger for 10 years or more. The bitcoinwiki.org has a [list](https://en.bitcoinwiki.org/wiki/IRC_channels) of some of the most popular bitcoin-themed IRC channels, but even more exist.
### Servers
Historically, many IRC channels, most Bitcoin ones included, used the "Freenode" irc server (irc.freenode.com). However recently Freenode underwent significant [changes](https://en.wikipedia.org/wiki/Libera_Chat#History) and virtually all Freenode channels and users migrated to [Libera Chat](https://libera.chat) (irc.libera.chat).
Whilst mirror channels exist on Freenode, you should ensure that you are trying Libera.chat channels first, as this is where the majority of users are today.
## Differences to Discord, Slack, etc.
IRC is different from contemporary messengers in that, if you leave the chat room, or close down your messaging program, you will **not** be able to read the "backscroll" -- the messages sent while you were away.
Users of IRC have overcome this problem by using programs called "bouncers". These bouncers will be run on a server or other always-on machine and remain connected to the IRC Channels at all times. When your local IRC Client is started it will connect to the bouncer instead, and the bouncer can relay the "backscroll" to your client, so you can read what you missed.
The most popular bouncer is called ZNC.
## Rules and customs
When on IRC don't ask if you can ask a question, just ask it.
Also, you shouldn't expect others in the channel to respond immediately (or at all). If no-one has replied to you after a few hours, and many other people are talking then it's probably OK to ask again. Just remember, nobody on IRC owes you any help, so be nice!
It is customary on IRC to **not** post large walls of text (i.e. error messages etc.), but to instead use pastebins. An example of a pastebin in https://0bin.net, but some IRC channels have their own preferred pastebins which might handle related content better. For example #gentoo Channel prefers you use https://dpaste.org/.
Just check the Channel banner (fixed message at the top) to see what the rules of the channel are before you start participating.
## IRC in 2022
The [Matrix protocol](https://matrix.org/), another open Chat Protocol more recently developed with a very nice list of features, has been operating a service called an IRC "bridge". The bridge essentially means that they (the Matrix Server) will connect (once) to an IRC Server and "bridge" (pass through) messages from Matrix users to IRC users bi-directionally. What this means is that, if we connect to our IRC Server using a Matrix bridge we can get that juicy IRC backscroll without needing to install an IRC bouncer on an always-on machine -- neat!
### Usign a Matrix Client with IRC
One of the most popular Matrix Clients, Element, offers mobile, local and web clients. The easiest to use is probably their [Web Client](https://element.io/get-started).
To start with this Client simply click "Launch Element Web" on the "get started" page linked above:
![](https://i.imgur.com/YSrm5D4.png)
Next, at the bottom of the dialogue click "create account" and create a new account with matrix.org:
![](https://i.imgur.com/Dqm2WTp.png)
You might also get this dialogue, from which you can choose the same "Create account" option:
![](https://i.imgur.com/ZlrfY5i.png =500x)
Once you have created an account and logged in, it's time to connect to a server and join some channels!
### Joining Servers and Channels
Once you are logged in to Element Web Client with your new Matrix.org user, you can start looking for channels on different servers.
You can click "Explore Public rooms":
![](https://i.imgur.com/GGFmQs3.png =500x)
... which will list a few default servers and the rooms associated with them. Note that, since the introduction of Matrix Chat some communities have migrated _again_ away from Libera.chat to Matrix itself, so browsing the "Matrix" (default) Channel list can be a good way to find some communities.
For now, we will click the server list and choose:
**libera.chat**
Matrix
![](https://i.imgur.com/ewtsE3S.png)
Once we have selected the Libera.chat (Matrix bridge) Server, we can filter rooms by searching.
Searching for "bitcoin" will show many bitcoin related channels (but not all of them).
![](https://i.imgur.com/9OjQcGf.png)
## Recommended channels
Some of the highest signal channels relate to development of specific projects. Please note that these channels **are not** generally support channels which have people ready to help you if you are having difficulty running something. They are usually focussed on developers talking about development of the software. If you are in doubt whether a question is "support" or not, you could ask whether asking it would be "off-topic". If it would be off-topic, someone might be helpful-enough to point you where you should go to ask it :)
That said, some of the highest-signal IRC channels are:
| Name | Purpose |
| --- | --- |
| `#bitcoin-core-dev` | Development of Bitcoin Core
| `#bitcoin-core-pr-reviews` | Educational [review](https://bitcoincore.reviews/) of Bitcoin Core PRs
| `#bitcoin-rust` | Discussion of rust-bitcoin, rust-lightning and related crates
| `#lightning-dev` | Lightning network (spec) discussion
| `#bitcoin-core-builds` | Discussion on the Bitcoin Core build system
## Conclusion
IRC is a relatively "old school" way of facilitating open global communication for certain communities. Many of the users of IRC are incredibly knowledgable and it's popular amongst developers.
Like any social network, being kind, polite and helpful will yield the best results.
## IRC-proper
### ZNC
On the server:
```fish
git clone https://github.com/znc/znc.git
cd znc
git fetch --tags
git checkout znc-1.8.2
```
Next install dependencies for [your OS](https://wiki.znc.in/Installation).
```fish
sudo apt install pkg-config automake autoconf
sudo apt install build-essential libssl-dev libperl-dev pkg-config libicu-dev
# swig3.0 was not available on ubuntu 22.10
sudo apt install swig4.0
```
Next we can build znc:
```fish
mkdir build
cd build
cmake ..
make
make install
```
Make a new user [to run znc](https://wiki.znc.in/Running_ZNC_as_a_system_daemon)
```fish
sudo useradd --create-home -d /var/lib/znc --system --shell /sbin/nologin --comment "Account to run ZNC daemon" --user-group znc
```
Make a configuration file:
```fish
sudo -u znc /usr/local/bin/znc --datadir=/var/lib/znc --makeconf
# This will optionally begin a server setup, which for libera chat will look something like this
# See https://libera.chat/guides/connect for connection parameters
[ .. ] Checking for list of available modules...
[ ** ]
[ ** ] -- Global settings --
[ ** ]
[ ?? ] Listen on port (1025 to 65534): 12345
[ ?? ] Listen using SSL (yes/no) [no]: y
[ ?? ] Listen using both IPv4 and IPv6 (yes/no) [yes]: n
[ .. ] Verifying the listener...
[ ** ] Unable to locate pem file: [/var/lib/znc/znc.pem], creating it
[ .. ] Writing Pem file [/var/lib/znc/znc.pem]...
[ ** ] Enabled global modules [webadmin]
[ ** ]
[ ** ] -- Admin user settings --
[ ** ]
[ ?? ] Username (alphanumeric): <your_nick_name
[ ?? ] Enter password:
[ ?? ] Confirm password:
[ ?? ] Nick [<your_nick_name]:
[ ?? ] Alternate nick [<your_nick_name_]:
[ ?? ] Ident [<your_nick_name]:
[ ?? ] Real name (optional):
[ ?? ] Bind host (optional):
[ ** ] Enabled user modules [chansaver, controlpanel]
[ ** ]
[ ?? ] Set up a network? (yes/no) [yes]: yes
[ ** ]
[ ** ] -- Network settings --
[ ** ]
[ ?? ] Name [freenode]: libera
[ ?? ] Server host (host only): irc.eu.libera.chat
[ ?? ] Server uses SSL? (yes/no) [no]: yes
[ ?? ] Server port (1 to 65535) [6697]: 6697
[ ?? ] Server password (probably empty):
[ ?? ] Initial channels: #bitcoin-core-dev
[ ** ] Enabled network modules [simple_away]
[ ** ]
[ .. ] Writing config [/var/lib/znc/configs/znc.conf]...
[ ** ]
[ ** ] To connect to this ZNC you need to connect to it as your IRC server
[ ** ] using the port that you supplied. You have to supply your login info
[ ** ] as the IRC server password like this: user/network:pass.
[ ** ]
[ ** ] Try something like this in your IRC client...
[ ** ] /server <znc_server_ip> +12345 <your_nick_name:<pass>
[ ** ]
[ ** ] To manage settings, users and networks, point your web browser to
[ ** ] https://<znc_server_ip>:12345/
[ ** ]
[ ?? ] Launch ZNC now? (yes/no) [yes]: yes
[ .. ] Opening config [/var/lib/znc/configs/znc.conf]...
[ .. ] Loading global module [webadmin]...
[ .. ] Binding to port [+12345] using ipv4...
[ ** ] Loading user [<your_nick_name]
[ ** ] Loading network [libera]
[ .. ] Loading network module [simple_away]...
[ >> ] [/usr/local/lib/znc/simple_away.so]
[ .. ] Adding 1 servers...
[ .. ] Loading user module [chansaver]...
[ .. ] Loading user module [controlpanel]...
[ .. ] Forking into the background...
[ >> ] [pid: 2274155]
[ ** ] ZNC 1.8.2 - https://znc.in
```
Set the config to use a defined PID file:
```fish
sudo mkdir -p /var/lib/znc
sudo chown znc:znc /var/lib/znc
echo "PidFile = /var/run/znc/znc.pid" | sudo su - znc -s /bin/bash -c "tee -a /var/lib/znc/configs/znc.conf"
```
Create a service file to run znc on startup
```fish
sudo touch /etc/systemd/system/znc.service
sudo vim /etc/systemd/system/znc.service
```
Enter program details into znc.service:
```systemd
[Unit]
Description=ZNC, an advanced IRC bouncer
After=network-online.target
[Service]
ExecStart=/usr/bin/znc -f --datadir=/var/lib/znc
User=znc
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
Save and exit.
Reload systemd daemon, stop the running znc and start the service
```fish
sudo -u root pkill znc
sudo systemctl daemon-reload
sudo systemctl start znc
sudo systemctl enable znc
```
You can check the service is running with:
```fish
$ sudo systemctl status znc
● znc.service - ZNC, an advanced IRC bouncer
Loaded: loaded (/etc/systemd/system/znc.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-05-18 12:19:47 BST; 2s ago
Main PID: 2278941 (znc)
Tasks: 3 (limit: 38318)
Memory: 1.4M
CPU: 109ms
CGroup: /system.slice/znc.service
└─2278941 /usr/local/bin/znc -f --datadir=/var/lib/znc
May 18 12:19:47 will-NUC znc[2278941]: Binding to port [+12345] using ipv4...
May 18 12:19:47 will-NUC znc[2278941]: Loading user [your_nick_name]
May 18 12:19:47 will-NUC znc[2278941]: Loading network [libera]
May 18 12:19:47 will-NUC znc[2278941]: Loading network module [simple_away]... [/usr/local/lib/znc/simple_away.so]
May 18 12:19:47 will-NUC znc[2278941]: Adding 1 servers...
May 18 12:19:47 will-NUC znc[2278941]: Loading user module [chansaver]...
May 18 12:19:47 will-NUC znc[2278941]: Loading user module [controlpanel]...
May 18 12:19:47 will-NUC znc[2278941]: Staying open for debugging [pid: 2278941]
May 18 12:19:47 will-NUC znc[2278941]: Writing pid file [/var/run/znc/znc.pid]...
May 18 12:19:47 will-NUC znc[2278941]: ZNC 1.8.2 - https://znc.in
```