2019-08-01 geth + Wagon环境运行ewasm

2022-04-22 17:45:00 浏览数 (1)

参考ewasm/testnet、2018-11-26 ewasm在以太坊私有链测试和2019-07-04 ewasm在以太坊私有链测试(3)

1、代码获取

代码语言:javascript复制
go get github.com/ethereum/go-ethereum
cd $GOROOT/src/github.com/ethereum/go-ethereum
git remote add gballet git@github.com:gballet/go-ethereum.git
git fetch gballet add-ewasm
git checkout add-ewasm

git fetch gballet add-ewasm可能遇到下面的错误:

代码语言:javascript复制
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

修改.gitconfig文件中

代码语言:javascript复制
url = git@github.com:gballet/go-ethereum.git

代码语言:javascript复制
url = https://github.com/gballet/go-ethereum.git

然后继续git fetch gballet add-ewasm

2、代码编译

需要额外拉取代码

代码语言:javascript复制
go get github.com/go-interpreter/wagon
go get github.com/edsrzf/mmap-go
go get github.com/twitchyliquid64/golang-asm
go build ./cmd/geth/...

3、初始化

代码语言:javascript复制
wget https://raw.githubusercontent.com/ewasm/testnet/master/ewasm-testnet-geth-config.json
./geth --datadir ewasm-testnet-data init ewasm-testnet-geth-config.json

继续初始化账户

代码语言:javascript复制
./geth 
--datadir ewasm-testnet-data 
--rpc --rpcapi "web3,net,eth,debug" 
--rpcvhosts="*" --rpcaddr "0.0.0.0" 
--rpccorsdomain "*" 
--nodiscover 
--networkid 66 
--ipcpath geth1.ipc console

personal.newAccount("123")
miner.setEtherbase(eth.accounts[0])
miner.start(1);admin.sleepBlocks(1);miner.stop();

4、通过rpc发布ewasm

参考2019-07-04 ewasm在以太坊私有链测试(3)4、私有链下使用rpc测试部分 注意发布的账户需要更改为这次新创建的账户

0 人点赞