moonbeam本地节点启动以及简单交互

启动节点有两种方式:
(1). Getting Started with Docker
(2). Getting Started with the Binary File

本文使用第二种方式:Getting Started with the Binary File

Setting Up a Node

Getting Started with the Binary File

一、clone Moonbeam 代码仓库

git clone -b tutorial-v7 https://github.com/PureStake/moonbeam
cd moonbeam

二、安装Substrate及其必备先决条件(包括rust)

curl https://getsubstrate.io -sSf | bash -s -- --fast

三、构建节点

cargo build --release

初始构建需要一段时间,大约需要30分钟,具体取决于不同的硬件。

四、在开发者模式下运行节点

./target/release/moonbeam --dev

Connecting Polkadot JS Apps to a Local Moonbeam Node

提供的两种RPC endpoints:

  • HTTP: http://127.0.0.1:9933
  • WS: ws://127.0.0.1:9944

通过Polkadot JS Apps连接到节点:https://polkadot.js.org/apps/#/explorer

点击左上角打开目录,再点击Development子目录,选择“Local Node” 选项,设置为:ws://127.0.0.1:9944,点击上面的Switch选项,成功连接到本地的独立Moonbeam节点。

连接成功之后,可以查看独立Moonbeam节点的生产区块的情况。
在这里插入图片描述

Querying Account State

随着Moonbase Alpha v3的发布,Moonbeam可支持在单一账户的模式下运行,该模式为以太坊样式的H160,并且已被Polkadot JS Apps支持。要检查地址的余额,只需在“帐户”选项卡中导入帐户即可。你可以在统一帐户部分找到更多信息。

不过,你也可以利用Moonbeam完整的以太坊RPC功能,使用 MetaMask 同样可以查询账户的余额。除此之外,你还可以利用其他的开发工具,如RemixTruffle 等等。

Using MetaMask

Using Remix

Using Truffle

Send a Transaction

Deploy a Contract

相关内容:
https://github.com/PureStake/moonbeam

https://docs.moonbeam.network/getting-started/local-node/setting-up-a-node/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值