加密狗空投教程254 — 如何在 Massa 网络上安装22.XX节点

一、什么是MassaMassa 是Layer 1网络,旨在通过自主智能合约和其他创新解决方案解决著名的三难困境,从而颠覆区块链行业。该项目背后的团队从 2017 年开始默默建设,直到去年才公开发布 Massa 测试网。Massa 协议背后的公司 Massa Labs 由 Sébastien Fore

image-1684467922360

一、什么是Massa

Massa 是Layer 1网络,旨在通过自主智能合约和其他创新解决方案解决著名的三难困境,从而颠覆区块链行业。该项目背后的团队从 2017 年开始默默建设,直到去年才公开发布 Massa 测试网。

Massa 协议背后的公司 Massa Labs 由 Sébastien Forestier、Damir Vodenicarevic 和 Adrien Laversanne-Finot 这三位朋友于 2020 年创立。Forestier在人工智能方面有专长,是公司的CEO;Vodenicarevic 是一名理论物理学家,领导开发和技术团队;而 Laversanne-Finot 拥有人工智能方面的经验并领导公司的战略。

2020 年 2 月,Massa Labs 发表了一篇题为Blockclique:通过多线程块图中的事务分片扩展区块链的技术论文,详细介绍了区块链如何在不牺牲安全性或去中心化的情况下进行扩展。

2021 年 11 月,该公司筹集了 580 万美元用于私人种子轮融资,有 100 多个个人和实体参与。

该项目每月发布新的版本,测试网将一直运行到主网上线,目前开发到第19版,该团队的目标是在2023 年上半年推出。

本教程主要介绍如何在 Massa Network 上运行节点并加入激励测试网,获得奖励和收益。

二、往期节点挖矿教程

加密狗空投教程179 – Massa Network 3月节点挖矿教程(20.XX)

加密狗空投教程146 – Massa Network节点挖矿教程

三、教程前

建议使用云主机+SSH工具挖矿,配置如下

CPU:4vCore

内存:8 GB

SDD:60GB

操作系统:Ubuntu 20.04

这种方法需要你租用VPS或者机场作为云主机,云主机请切换成Ubuntu系统;

SSH工具:小白用户建议使用Xshell或者Finalshell

官方指令:

https://docs.massa.net/en/latest/testnet/install.html

四、如何连接到 VPS

MacOs:如果你用的是这个操作系统,你只需要用自己的设备与 SSH 连接;

Windows:如果你是Win,有很多工具可以用,比如putty 、MobaXterm、Xshell

1、下载一个应用(本教程以putty为例,小白用户建议使用Xshell或Finalshell)

2、复制云服务器IP链接

image-1684468127063

3、点击“接受”,输入云服务器的用户名和密码

注意:要粘贴你已经复制的任何命令,只需右键单击要粘贴命令即可

image-1684468140740

4、再次输入密码,并输入新密码。

以上就是云服务器+SSH组合的步骤,下文所有步骤都在SSH工具中进行(小白用户建议使用Xshell或Finalshell)

五、挖矿前准备

记得对照图片填,有时我可能会写错代码;记得Root服务器。

1、更新升级服务器
sudo apt update && sudo apt upgrade -y

image-1684468169370

image-1684468176716

apt-get install libclang-dev

按 Y ,回车

2、安装 Screen
sudo apt install screen

按Y, 回车

3、使用以下命令安装所需的库:
sudo apt install pkg- config curl git build-essential libssl-dev

image-1684468457726

按Y,回车

4、安装 RUST:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

image-1684468489227

如果安装在一分钟后没有开始(如上图所示),请重新输入相同的命令,它应该可以继续运行

source $HOME/.cargo/env
5、安装nightly:
rustup toolchain install nightly

image-1684468532847

如果安装在一分钟后没有开始(如上图所示),请重新输入相同的命令,它应该可以工作

image-1684468547696

6、将nightly设置为默认值:
rustup default nightly

六、安装节点

1、节点配置:
sudo nano massa/massa-node/config/config.toml

image-1684469981335

在窗口中粘贴以下信息:

[logging]
    # Logging level. High log levels might impact performance. 0: ERROR, 1: WARN, 2: INFO, 3: DEBUG, 4: TRACE
    level = 2[api]
    # max number of future periods considered during requests
    draw_lookahead_period_count = 10
    # port on which the node API listens for admin and node management requests. Dangerous if publicly exposed. Bind to "[::1]:port" for IPv6
    bind_private = "127.0.0.1:33034"
    # port on which the node API listens for public requests. Can be exposed to the Internet. Bind to "[::]:port" for IPv6
    bind_public = "0.0.0.0:33035"
    # port on which the node API(V2) listens for HTTP requests and WebSockets subscriptions. Can be exposed to the Internet. Bind to "[::]:port" for IPv6
    bind_api = "0.0.0.0:33036"
    # max number of arguments per RPC call
    max_arguments = 128
    # path to the openrpc specification file used in `rpc.discover` method
    openrpc_spec_path = "base_config/openrpc.json"
    # maximum size in bytes of a request
    max_request_body_size = 52428800
    # maximum size in bytes of a response
    max_response_body_size = 52428800
    # maximum number of incoming connections allowed
    max_connections = 100
    # maximum number of subscriptions per connection
    max_subscriptions_per_connection = 1024
    # max length for logging for requests and responses. Logs bigger than this limit will be truncated
    max_log_length = 4096
    # host filtering
    allow_hosts = []
    # whether batch requests are supported by this server or not
    batch_requests_supported = true
    # the interval at which `Ping` frames are submitted in milliseconds
    ping_interval = 60000
    # whether to enable HTTP.
    enable_http = true
    # whether to enable WS.
    enable_ws = false
    # whether to broadcast for blocks, endorsements and operations
    enable_broadcast = false[grpc]
    # whether to enable gRPC
    enabled = false
    # whether to add HTTP 1 layer
    accept_http1 = false
    # whether to enable CORS. works only if `accept_http1` is true
    enable_cors = false
    # whether to enable gRPC health service
    enable_health = true
    # whether to enable gRPC reflection(introspection)
    enable_reflection = true
    # bind for the Massa gRPC API
    bind = "0.0.0.0:33037"
    # which compression encodings does the server accept for requests
    accept_compressed = "Gzip"
    # which compression encodings might the server use for responses
    send_compressed = "Gzip"
    # limits the maximum size of a decoded message. Defaults to 50MB
    max_decoding_message_size = 52428800
    # limits the maximum size of an encoded message. Defaults to 50MB
    max_encoding_message_size = 52428800
    # limits the maximum size of streaming channel
    max_channel_size = 128
    # set a timeout on for all request handlers in seconds. Defaults to 60s
    timeout = 60
    # sets the maximum frame size to use for HTTP2(must be within 16,384 and 16,777,215). Defaults to 16MB
    max_frame_size = 16777215
    # set the concurrency limit applied to on requests inbound per connection. Defaults to 32
    concurrency_limit_per_connection = 32
    # sets the SETTINGS_MAX_CONCURRENT_STREAMS spec option for HTTP2 connections
    max_concurrent_streams = 1024
    # set the value of `TCP_NODELAY` option for accepted connections. Enabled by default
    tcp_nodelay = true
    # max number of future periods considered during requests
    draw_lookahead_period_count = 10
    # The maximum number of block IDs that can be included in a single request
    max_block_ids_per_request = 50
    # max number of operation ids that can be included in a single request
    max_operation_ids_per_request = 250[execution]
    # max number of generated events kept in RAM
    max_final_events = 10000
    # maximum length of the read-only execution requests queue
    readonly_queue_length = 10
    # by how many milliseconds shoud the execution lag behind real time
    # higher values increase speculative execution lag but improve performance
    cursor_delay = 2000
    # duration of the statistics time window in milliseconds
    stats_time_window_duration = 60000
    # maximum allowed gas for read only executions
    max_read_only_gas = 100_000_000
    # gas cost for ABIs
    abi_gas_costs_file = "base_config/gas_costs/abi_gas_costs.json"
    # gas cost for wasm operator
    wasm_gas_costs_file = "base_config/gas_costs/wasm_gas_costs.json"
    # path to the initial vesting file
    initial_vesting_path = "base_config/initial_vesting.json"
    # path to the hard drive cache storage
    hd_cache_path = "storage/cache/rocks_db"
    # maximum number of entries we want to keep in the LRU cache
    # in the worst case scenario this is equivalent to 2Gb
    lru_cache_size = 200
    # maximum number of entries we want to keep in the HD cache
    # in the worst case scenario this is equivalent to 20Gb
    hd_cache_size = 2000
    # amount of entries removed when `hd_cache_size` is reached
    snip_amount = 10
    # slot execution outputs channel capacity
    broadcast_slot_execution_output_channel_capacity = 5000[ledger]
    # path to the initial ledger
    initial_ledger_path = "base_config/initial_ledger.json"
    # path to the disk ledger db directory
    disk_ledger_path = "storage/ledger/rocks_db"
    # length of the changes history. Higher values allow bootstrapping nodes with slower connections
    final_history_length = 100[consensus]
    # max number of previously discarded blocks kept in RAM
    max_discarded_blocks = 100
    # if a block is at least future_block_processing_max_periods periods in the future, it is just discarded
    future_block_processing_max_periods = 100
    # max number of blocks in the future kept in RAM
    max_future_processing_blocks = 400
    # max number of blocks waiting for dependencies
    max_dependency_blocks = 2048
    # number of final periods that must be kept at all times (increase to more resilience to short network disconnections, high values will increase RAM usage.)
    force_keep_final_periods = 10# max milliseconds to wait while sending an event before dropping it
    max_send_wait = 0
    # useless blocks are pruned every block_db_prune_interval ms
    block_db_prune_interval = 5000# considered timespan for stats info
    stats_timespan = 60000
    # max number of item returned per query
    max_item_return_count = 100# blocks headers channel capacity
    broadcast_blocks_headers_channel_capacity = 128
    # blocks channel capacity
    broadcast_blocks_channel_capacity = 128
    # filled blocks channel capacity
    broadcast_filled_blocks_channel_capacity = 128[protocol]
    # port on which to listen for protocol communication. You may need to change this to "0.0.0.0:port" if IPv6 is disabled system-wide.
    bind = "[::]:31244"
    # timeout for connection establishment
    connect_timeout = 3000
    # path to the node key (not the staking key)
    keypair_file = "config/node_privkey.key"
    # path to the initial peers file
    initial_peers_file = "base_config/initial_peers.json"
    # Limit of read/write number of bytes per second with a peer (Should be a 10 multiple)
    read_write_limit_bytes_per_second = 2_000_000_000
    # timeout after which without answer a hanshake is ended
    message_timeout = 5000
    # timeout after whick we consider a node does not have the block we asked for
    ask_block_timeout = 10000
    # max cache size for which blocks our node knows about
    max_known_blocks_size = 1024
    # max cache size for which blocks a foreign node knows about
    max_node_known_blocks_size = 1024
    # max cache size for which blocks a foreign node asked for
    max_node_wanted_blocks_size = 1024
    # max number of blocks we can ask simultaneously per node
    max_simultaneous_ask_blocks_per_node = 128
    # max milliseconds to wait while sending an event before dropping it
    max_send_wait = 0
    # max cache size for which operations your node knows about
    max_known_ops_size = 2000000
    # max cache size for which operations a foreign node knows about
    max_node_known_ops_size = 200000
    # max cache size for which endorsements our node knows about
    max_known_endorsements_size = 2048
    # max cache size for which endorsements a foreign node knows about
    max_node_known_endorsements_size = 2048
    # maximum number of batches in the memory buffer.
    # dismiss the new batches if overflow
    operation_batch_buffer_capacity = 10024
    # immediately announce ops if overflow
    operation_announcement_buffer_capacity = 2000
    # start processing batches in the buffer each `operation_batch_proc_period` in millisecond
    operation_batch_proc_period = 500
    # all operations asked are prune each `operation_asked_pruning_period` millisecond
    asked_operations_pruning_period = 100000
    # interval at which operations are announced in batches.
    operation_announcement_interval = 300
    # max number of operation per message, same as network param but can be smaller
    max_operations_per_message = 1024
    # Number of millis seconds between each try out connections
    try_connection_timer = 5000
    # Number of millis seconds that create a timeout for out connections
    timeout_connection = 1000
    # time threshold after which operation are not propagated
    max_operations_propagation_time = 32000
    # time threshold after which endorsement are not propagated
    max_endorsements_propagation_time = 48000
    # number of thread tester
    thread_tester_count = 5
    # Peer default category limits
    default_category_info = { target_out_connections = 10, max_in_connections_per_ip = 2, max_in_connections_pre_handshake = 100, max_in_connections_post_handshake = 15}
    # Peer categories limits
    [protocol.peers_categories]
    Bootstrap = { target_out_connections = 1, max_in_connections_per_ip = 1, max_in_connections_pre_handshake = 8, max_in_connections_post_handshake = 1}[network][bootstrap]
    # list of bootstrap (ip, node id)
    bootstrap_list = [
        ["149.202.86.103:31245", "N12UbyLJDS7zimGWf3LTHe8hYY67RdLke1iDRZqJbQQLHQSKPW8j"],
        ["149.202.89.125:31245", "N12vxrYTQzS5TRzxLfFNYxn6PyEsphKWkdqx2mVfEuvJ9sPF43uq"],
        ["158.69.120.215:31245", "N12rPDBmpnpnbECeAKDjbmeR19dYjAUwyLzsa8wmYJnkXLCNF28E"],
        ["158.69.23.120:31245", "N1XxexKa3XNzvmakNmPawqFrE9Z2NFhfq1AhvV1Qx4zXq5p1Bp9"],
        ["198.27.74.5:31245", "N1qxuqNnx9kyAMYxUfsYiv2gQd5viiBX126SzzexEdbbWd2vQKu"],
        ["198.27.74.52:31245", "N1hdgsVsd4zkNp8cF1rdqqG6JPRQasAmx12QgJaJHBHFU1fRHEH"],
        ["54.36.174.177:31245", "N1gEdBVEbRFbBxBtrjcTDDK9JPbJFDay27uiJRE3vmbFAFDKNh7"],
        ["51.75.60.228:31245", "N13Ykon8Zo73PTKMruLViMMtE2rEG646JQ4sCcee2DnopmVM3P5"],
        ["[2001:41d0:1004:67::]:31245", "N12UbyLJDS7zimGWf3LTHe8hYY67RdLke1iDRZqJbQQLHQSKPW8j"],
        ["[2001:41d0:a:7f7d::]:31245", "N12vxrYTQzS5TRzxLfFNYxn6PyEsphKWkdqx2mVfEuvJ9sPF43uq"],
        ["[2001:41d0:602:db1::]:31245", "N1gEdBVEbRFbBxBtrjcTDDK9JPbJFDay27uiJRE3vmbFAFDKNh7"],
        ["[2001:41d0:602:21e4::]:31245", "N13Ykon8Zo73PTKMruLViMMtE2rEG646JQ4sCcee2DnopmVM3P5"],
    ]
    # force the bootstrap protocol to use: "IPv4", "IPv6", or "Both". Defaults to using both protocols.
    bootstrap_protocol = "Both"
    # path to the bootstrap whitelist file. This whitelist define IPs that can bootstrap on your node.
    bootstrap_whitelist_path = "base_config/bootstrap_whitelist.json"
    # path to the bootstrap blacklist file. This whitelist define IPs that will not be able to bootstrap on your node. This list is optional.
    bootstrap_blacklist_path = "base_config/bootstrap_blacklist.json"
    # [optional] port on which to listen for incoming bootstrap requests. You may need to change this to "0.0.0.0:port" if IPv6 is disabled system-wide.
    bind = "[::]:31245"
    # timeout to establish a bootstrap connection
    connect_timeout = 15000
    # timeout for providing the bootstrap to a connection
    bootstrap_timeout = 1200000
    # delay in milliseconds to wait between consecutive bootstrap attempts
    retry_delay = 60000
    # if ping is too high bootstrap will be interrupted after max_ping milliseconds
    max_ping = 10000
    # timeout for incoming message readout
    read_timeout = 100000
    # timeout for message sending
    write_timeout = 100000
    # timeout for incoming error message readout
    read_error_timeout = 200
    # timeout for message error sending
    write_error_timeout = 200
    # max allowed difference between client and servers clocks in ms
    max_clock_delta = 5000
    # [server] data is cached for cache duration milliseconds
    cache_duration = 15000
    # max number of simulataneous bootstraps for server
    max_simultaneous_bootstraps = 2
    # max size of recently bootstrapped IP cache
    ip_list_max_size = 10000
    # refuse consecutive bootstrap attempts from a given IP when the interval between them is lower than per_ip_min_interval milliseconds
    per_ip_min_interval = 180000
    # read-write limitation for a connection in bytes per seconds (about the bootstrap specifically)
    max_bytes_read_write = 20_000_000.0[pool]
    # max number of operations kept per thread
    max_pool_size_per_thread = 25000
    # if an operation is too much in the future it will be ignored
    max_operation_future_validity_start_periods = 100
    # max number of endorsements kept
    max_endorsement_count = 10000
    # max number of items returned per query
    max_item_return_count = 100
    # endorsements channel capacity
    broadcast_endorsements_channel_capacity = 2000
    # operations channel capacity
    broadcast_operations_channel_capacity = 5000[selector]
    # path to the initial roll distribution
    initial_rolls_path = "base_config/initial_rolls.json"[factory]
    # initial delay in milliseconds to wait before starting production to avoid double staking on node restart
    initial_delay = 100
    # path to your staking wallet
    staking_wallet_path = "config/staking_wallet.dat"

image-1684470021171

按CTRL + X退出

image-1684470160297

按Y和Enter保存修改

七、运行节点

1、Go to massa node
cd massa/massa-node/

image-1684470218048

2、使用此命令创建一个名为“massa_node”的会话
screen -S massa_node

image-1684470302544

3、节点运行
RUST_BACKTRACE =full cargo run --release -- -p xxxxxxx|& tee logs.txt

将xxxxxx替换为你的密码,例如:

RUST_BACKTRACE =full cargo run --release -- -p jackal|& tee logs.txt

稍等…

image-1684470354805

稍等…

image-1684470368161

稍等…

image-1684470383814

继续下一步

4、从“massa_node”屏幕会话中分离

CTRL+A 然后 D

image-1684470415534

八、客户端安装

CD  $HOME

然后

cd massa/massa-client/

image-1684470446757

1、创建一个名为“massa_client”的会话
screen -S massa_client

image-1684476093537

2、启动客户端:
cargo run --release

等…

image-1684476117381

3、下一个命令:
Exit

4、命令“exit”通常会返回到 massa/massa-client/ 位置,然后:

screen -S massa_client

image-1684476268669

5、将使用以下命令创建钱包:
cargo run -- --wallet wallet.dat

image-1684476288820

image-1684476295530

下一个命令:

Exit

注意:如果需要从主页(根目录)访问客户端 Massa,可以使用以下命令访问它:

cd $home
cd massa/massa-client/

然后

screen -S massa_client

然后

cargo run -- --wallet wallet.dat
6、生成一个私钥,并使用以下命令将其添加到我们的钱包中:
wallet_generate_secret_key

image-1684476369160

输入一个新密码,如下所示:

jiamigou

image-1684476390235

重复密码:

jiamigou
7、可以使用以下命令从你钱包中获取信息:
wallet_info

image-1684476421398

将所有信息保存在笔记本中:

image-1684476432892

九、在 discord 上领水

1、单击此链接转到 Massa Labs 官方Discord,进入#testnet-faucet 频道并发送你的钱包地址

image-1684476452394

你的地址下方如果出现一个火箭,说明代币已经转进去了。

2、可以使用此命令检查余额:
cd $home
cd massa/massa-client/
screen -S massa_client
cargo run -- --wallet wallet.dat
wallet_info

image-1684476489725

3、输入密码,比如:
akabane

image-1684476514584

4、输入此命令
node_start_staking xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

将xxxxxxxxxxxxxxxxxxxxx替换为你的的地址,比如:

node_start_staking A18NWW9VrZpAkur3fQAPySn71azhoP5WKQVBD8JeuQhbjC8XCux

image-1684476559055

5、买rolls:
buy_rolls xxxxxxxxxxxxxxxxxxxxxxx 1 0

请将xxxxxxxxxxxxxxxxxxxxx替换为你的地址(此订单将允许购买一rolls)

buy_rolls A18NWW9VrZpAkur3fQAPySn71azhoP5WKQVBD8JeuQhbjC8XCux 1  0

image-1684476589663

6、你可以用这个命令检查
wallet_info

image-1684476617371

7、再次输入这个命令
node_start_staking xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

将 xxxxxxxx 替换成你的钱包地址,比如:

node_start_staking A18NWW9VrZpAkur3fQAPySn71azhoP5WKQVBD8JeuQhbjC8XCux

image-1684476636949

8、你可以用以下命令检查:
wallet_info
9、回到 root

按CTRL+A 然后D

cd $HOME

image-1684476664926

十、验证节点(可选但推荐)

Massa 网络中的节点必须相互建立连接以进行通信、传播块和操作,并保持共识并一起同步。

对于节点 A 建立到节点 B 的连接,节点 B 必须是可路由的。这意味着节点 B 有一个可以从节点 A 访问的公共 IP 地址,并且节点 B 上的 TCP 端口 31244 和 TCP 31245 是打开的,并且节点 B 上的防火墙允许这些端口上的传入连接。一旦这样建立连接后,通过此连接进行的通信是双向的。

1、建议重新启动xshell或返回主页
CD  $HOME

然后

apt install ufw -y
ufw allow ssh 
ufw allow https 
ufw allow http 
ufw allow 31244
ufw allow 31245
ufw enable

然后

cd massa/massa-node/config

继续

nano config.toml
2、你现在有一个新的screen,在上面输入以下信息
[network]
routable_ip = "AAA.BBB.CCC.DDD"

将 “AAA.BBB.CCC.DDD “替换为公共IP地址(VPS的IP地址)。

3、要从Root下用这个命令,检查你的节点的状态
cd $home
cd massa/massa-client/
screen -S massa_client
cargo run -- --wallet wallet.dat
get_status

image-1684476779507

十一、验证MASSA 机器人

上一步做完,说明你已经在 massa 网络上启动了节点,现在我们将在 discord 上反馈,以便它可以链接到我们的 discord 用户。

1、进官方不和谐 并执行下图所示的操作:

image-1684476806642

2、检查私人消息,你将找到在你的节点上输入的命令

image-1684476824080

比如:node_testnet_rewards_program_ownership_proof rDmAJR7wRrPiYVrxmTsRFiKbkhDXCJeYagFTj5AaeD31zooBy 913370747924275211

3、返回Massa客户端
cd massa/massa-client/
screen -S massa_client
cargo run -- --wallet wallet.dat
4、并输入 Massabot 要求输入的命令,比如:
node_testnet_rewards_program_ownership_proof rDmAJR7wRrPiYVrxmTsRFiKbkhDXCJeYagFTj5AaeD31zooBy 913370

image-1684476868615

5、通过私信将此信息发给 Massabot

image-1684476890296

image-1684476896173

6、你可以在massabot回复“ info”查询你的分数

image-1684476910946

7、你也可以回复你的IP地址,他会发给你下面的回复

image-1684476926427

十二、测试网质押奖励计划

如果你觉得挖矿很麻烦,你可以去做官方的质押活动,点此查看官方质押奖励信息。

以上就是今天全部内容,更多信息请关注:

加密狗推特:https://twitter.com/JiamigouCn

电报:https://t.me/JIAMIGOU002

给TA打赏
共{{data.count}}人
人已打赏
评测攻略

加密狗空投教程253 -- Filecoin生态上的FileMarket 主网 Alpha 交互教程(明牌空投)

2023-5-10 16:38:35

评测攻略

加密狗空投教程255 -- 新版水龙头合集

2023-5-19 16:39:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索