部分兼容以太坊Jrpc API
介绍
Metamask是以太坊钱包,使用广泛。为了方便用户使用Vision,Vision兼容了部分metamask的主要接口。对于Vision新用户来说,可以使用metamask创建Vision的用户。
兼容的接口主要包括转账类、部署合约调用合约类、添加代币及转币类操作。其中部署调用合约使用的ide是remix。
接口:
eth_sendRawTransaction(转账\部署合约\调用非常量合约)
eth_getTransactionReceipt(查看交易结果)
eth_call(调用合约的常量方法)
eth_estimateGas(执行并估算一个交易需要的gas用量,该次交易不会写入区块链)
eth_getBlockByHash(返回具有指定哈希的块)
eth_getBlockByNumber(返回指定编号的块)
eth_getTransactionByHash(返回指定哈希对应的交易)
eth_getLogs(返回指定过滤器中的所有日志)
eth_blockNumber(返回最新的区块号)
eth_gasPrice(返回当前的gas价格,wei,默认值160_000_000_000L)
eth_getTransactionCount(返回指定地址发生的交易数量,在vision网络中返回的是区块高度)
eth_getBalance(返回指定账户的余额)
eth_getTransactionByBlockHashAndIndex(返回指定块内具有指定索引序号的交易)
eth_getBlockTransactionCountByHash(返回指定区块内的交易数量,使用哈希来指定块)
eth_getBlockTransactionCountByNumber(返回指定区块内的交易数量,使用区块编号来指定块)
上述接口参数参照:https://openethereum.github.io/JSONRPC-eth-module
Mainnet Links
- Network name : mainnet
- New RPC URL : https://infragrid.v.network/ethereum/compatible
- Chain ID : 888888
- Currency Symbol (optional) : VS
- Block Explorer URL (optional): https://www.visionscan.org/
Vpioneer Links
- Network name : vpioneer
- New RPC URL : https://vpioneer.infragrid.v.network/ethereum/compatible
- Chain ID : 666666
- Currency Symbol (optional) : VS
- Block Explorer URL (optional): https://www.visionscan.org/
You can use you own fullnode as RPC server. Set the RPC URL to "fullnode ip:7080/ethereum/compatible"
VS转账
操作步骤:
由于metamask账户是20位,转账时要把Vision账户的46替换成0x进行转账

1 点击"发送"

2 填写转账地址、燃料价格及限制(将V网地址的46换成0x)

3 确认转账信息

4 交易确定后,可在活动中查看交易状态
部署合约调用合约实例

1 编译合约后,点击deploy或transact

2 填写燃料价格及限制

3 点击确认后,可在活动中查看部署状态

4 部署成功后在左侧导航栏可见合约方法并调用
添加代币及转币实例

1 以vrc20为例,在资产中点击’添加代币‘,在添加代币页填写合约地址(46换成0x)

2 点击'添加代币'

3 添加成功后,可在资产查看代币余额

4 转币 像转账一样在资产页点击'发送'

5 填写发送的地址、燃料价格及燃料限制并点击'下一步'

6 确认信息

7 在发送目的地重复1-3的操作可查看代币余额
Updated over 2 years ago