# 安装最新的erlang包源,不执行这一步,无法安装最新版本的erlang
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
sudo dpkg -i erlang-solutions_2.0_all.deb
# 安装
sudo apt update
sudo apt install erlang
# 验证安装结果
Erlang
# root@ip-127-0-0-1:/home/ubuntu# erl
# Erlang/OTP 24 [erts-12.3.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit]
#
# Eshell V12.3.1 (abort with ^G)
# 1> # 退出输入 contrl + g
# User switch command
# --> q # 输入 q
Elixir
# root@ip-172-31-16-35:/home/ubuntu# iex
# Erlang/OTP 24 [erts-12.3.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit]
#
# Interactive Elixir (1.13.0) - press Ctrl+C to exit (type h() ENTER for help)
# iex(1)> # 退出输入 contrl + c
# BREAK: (a)bort (A)bort with dump (c)ontinue (p)roc info (i)nfo
# (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution
# a # 输入 a
安装最新的LTS版本
nodejs 的每个大版本号都有相对应的源,比如这里的 16.x.x版本的源是https://deb.nodesource.com/setup_16.x
# 导入16.x.x的源
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install nodejs
# 验证安装结果
nodejs -v
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 安装提示,选择1(默认为1)
# 1) Proceed with installation (default)
# 2) Customize installation
# 3) Cancel installation
1 # 直接回车也可
#
# 更新环境变量
source $HOME/.cargo/env
source ~/.profile
sudo apt install libtool
apt install inotify-tools
apt install gcc
sudo apt install make
sudo apt install automake
sudo apt install g++
wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2
# 解压
tar -xjvf gmp-6.2.1.tar.bz2
# 编译并安装
cd gmp-6.2.1
./configure
make
make check
sudo make install
sudo apt install postgresql
git clone https://github.com/blockscout/blockscout.git
cd blockscout
mix do deps.get
mix do local.rebar --force
mix do deps.compile
mix do compile
export ETHEREUM_JSONRPC_VARIANT=geth
export COIN=DFAX
export COIN_NAME=DFAX
export PORT=14000 # 浏览器端口
export NETWORK=DFAX
export SUBNETWORK=DFAX MAINNET
export ETHEREUM_JSONRPC_HTTP_URL=http://127.0.0.1:8545 # 链RPC endpoint
export ETHEREUM_JSONRPC_TRACE_URL=http://127.0.0.1:8545
export NETWORK_ICON=/home/ubuntu/ic_launcher_round.png
export LOGO=/home/ubuntu/ic_launcher_round.png
export DATABASE_URL=postgresql://postgres:<postgres password>@<postgresql endpoint>/blockscout?ssl=false
export DISABLE_EXCHANGE_RATES=true
mix do ecto.drop, ecto.create, ecto.migrate
cd apps/block_scout_web/assets
npm install && node_modules/webpack/bin/webpack.js --mode production
cd ..
mix phx.digest
生成https证书
cd apps/block_scout_web/
mix phx.gen.cert blockscout blockscout.local
配置 host文件
vi /etc/hosts
# 追加一下内容
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 blockscout blockscout.local
localhost.localdomain localhost4 localhost4.localdomain4 blockscout blockscout.local
切换到 blockscout 目录下执行
mix phx.server