πŸ’»Installation

Server preparation

apt update && apt upgrade -y
apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip chrony libleveldb-dev liblz4-tool -y

Install GO

ver="1.21.3" && \
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" && \
sudo rm -rf /usr/local/go && \
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" && \
rm "go$ver.linux-amd64.tar.gz" && \
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile && \
source $HOME/.bash_profile && \
go version

Install ethkey, which we will need later to extract the private key

git clone https://github.com/autonity/autonity.git autonity1
cd autonity1
make all
mv build/bin/ethkey /usr/local/bin

ethkey --version
#ethkey version 1.0.2-alpha-8be1825c-20241209

Node installation

Install Autonity Utility (aut)

# for ubuntu 20.04
cd
apt install python3-pip && \
apt install python3.8-venv && \
pip install pipx

# for ubuntu 22.04
cd
apt install python3-pip && \
apt install python3.10-venv && \
pip install pipx

# for new installation
pipx install autonity-cli
mv /root/.local/bin/aut /usr/local/bin/aut

aut --version
#aut, version 1.0.0

# for update
pipx upgrade autonity-cli

Installing Autonity node

cd
git clone https://github.com/autonity/autonity && cd autonity
git checkout tags/v1.1.2 -b v1.1.2
make autonity

mv $HOME/autonity/build/bin/autonity /usr/local/bin/
autonity version
#Version: 1.1.2

Create a directory autonity-chaindata to store autonity working data and create the keys we need

cd
mkdir -p $HOME/autonity-chaindata/autonity
# generate nodekey
autonity genAutonityKeys $HOME/autonity-chaindata/autonity/nodekey --writeaddress

mkdir -p $HOME/.autonity/keystore
# generate oracle.key
aut account new -k $HOME/.autonity/keystore/oracle.key

# generate tresure.key
aut account new -k $HOME/.autonity/keystore/tresure.key

Now we add our tresure key to .autrc

nano $HOME/.autrc

# the line is added
keyfile=/root/.autonity/keystore/tresure.key

Create a service file

As this launch is for the genesis of Mainnet there is no need to include a network specific flag. Optionally, if you wish to be explicit you can set --networkid 65000000, whilst removing any --bakerloo or --piccadilly flag

tee <<EOF >/dev/null /etc/systemd/system/autonity.service
[Unit]
Description=autonity node
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=$(which autonity) --datadir $HOME/autonity-chaindata --syncmode full --http --http.addr 0.0.0.0 --http.api aut,eth,net,txpool,web3,admin --http.vhosts \*  --ws     --ws.addr 127.0.0.1 --ws.api aut,eth,net,txpool,web3,admin --autonitykeys $HOME/autonity-chaindata/autonity/nodekey --nat extip:$(curl 2ip.ru)
Restart=on-failure
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable autonity
systemctl restart autonity && journalctl -u autonity -f -o cat

Last updated