Install cardano-node
#
Điều kiện tiên quyếtKiểm tra Bản phát hành cardano-node mới nhất và thiết lập nền tảng của bạn:
Bạn sẽ cần:
- Máy chủ x86 ( AMD hoặc Intel ) , Phiên bản Máy ảo hoặc AWS có ít nhất 2 core, 12GB RAM và ít nhất 100 GB dung lượng đĩa trống;
- Phiên bản gần đây của Linux, không phải Windows hoặc MacOS - điều này sẽ giúp chúng tôi cô lập mọi vấn đề phát sinh.
- Đảm bảo rằng bạn đang sử dụng mạng không có tường lửa. Đặc biệt, chúng tôi sẽ sử dụng cổng TCP/IP 3000 và 3001 theo mặc định để thiết lập kết nối với các nút khác, vì vậy điều này sẽ cần phải mở.
#
Cài đặt phần phụ thuộcChúng tôi cần các gói và công cụ sau trên hệ thống Linux của mình để tải xuống mã nguồn và xây dựng nó:
- the version control system
git
, - the
gcc
C-compiler, - C++ support for
gcc
, - developer libraries for the arbitrary precision library
gmp
, - developer libraries for the compression library
zlib
, - developer libraries for
systemd
, - developer libraries for
ncurses
, ncurses
compatibility libraries,- the Haskell build tool
cabal
, - the GHC Haskell compiler.
Nếu chúng tôi đang sử dụng phiên bản AWS chạy Amazon Linux AMI 2 ( xem hướng dẫn AWS để biết cách khởi động và chạy phiên bản đó ) hoặc một hệ thống dựa trên CentOS / RHEL khác, chúng tôi có thể cài đặt các phần phụ thuộc này như sau:
Đối với Debian / Ubuntu, hãy sử dụng cách sau để thay thế:
Nếu bạn đang sử dụng phiên bản Linux khác, bạn sẽ cần sử dụng trình quản lý gói phù hợp với nền tảng của mình thay vì yum
hoặc apt-get
và tên của các gói bạn cần cài đặt có thể khác nhau.
#
Download, unpack, install and update Cabal:xác thực .local/bin là đường dẫn trong PATH
nếu .local/bin không có trong PATH, Bạn cần làm theo trong file .bashrc
Điều hướng đến thư mục chính của bạn:
Bạn mở file .bashrc với lệnh nano để editor
đi xuống dòng cuối cùng
Chạy lại file .bashrc
Update cabal
Trên đây hướng dẫn cài đặt phiên bản Cabal 3.2.0.0
. Bạn có thể kiểm tra phiên bản bằng cách gõ
#
Download and install GHC:Cho hệ thống Debian/Ubuntu:
Cho hệ thống CentOS/RHEL:
Alternatively, the ghcup tool can be used to install and set several versions of GHC:
<VERSION>
here could be for example 8.10.2
You can check that your default GHC version has been properly set:
#
Install Libsodium#
Download the source code for cardano-nodeThis creates the folder cardano-node
and downloads the latest source code.
After the download has finished, we can check its content by
We change our working directory to the downloaded source code folder:
For reproducible builds, we should check out a specific release, a specific "tag". For the Shelley Testnet, we will use tag 1.24.2
, which we can check out as follows:
#
Build and install the nodeNow we build and install the node with cabal
, which will take a few minutes the first time you do a build. Later builds will be much faster, because everything that does not change will be cached.
Now we can copy the executables files to the .local/bin directory
#
If you need to update to a newer version follow the steps below:This is a good time to backup your current binaries (in case you have to revert to an earlier version). Something like this will work:
Now copy your newly built binaries to the appropriate directory, with:
note
It might be necessary to delete the db
-folder (the database-folder) before running an updated version of the node.