这几天正在部署plasma,写一下学习心得。
依旧对两条链是如何接入的感到迷惑(plasma链作为子链,Ganache作为母链)
准备工作
关于部署私链以及智能合约的文档
1.https://blog.youkuaiyun.com/sportshark/article/category/6278182 李赫的专栏
这个博主有好些不错的文章,虽然里面的代码可能有些问题,稍微改一改就ok了
2.https://blog.youkuaiyun.com/ljfphp/article/details/81288961 【以太坊】深入理解智能合约(合约调合约)
3.https://blog.youkuaiyun.com/zxs9999/article/details/79118556 010 以太访可视化私有链ganache
4.https://www.jianshu.com/p/9233c214e205 以太坊开发(二)使用Ganache CLI在私有链上搭建智能合约
为了防止忘记,记录一下我的Ganache私链实践代码存放路径:“F:\Ethereum-Mist\Geth\private_net\test1使用记录.txt”,请忽略此部分
简介、原理
1.深入理解Plasma(一)Plasma 框架
2.深入理解Plasma(2):Plasma 细节剖析
3.深入理解Plasma(3):Plasma MVP
4.深入理解Plasma(四)Plasma Cash
5. https://ethresear.ch/t/minimal-viable-plasma/426 (一个像是论坛的东西)
6.以太坊扩容方案大清单
部署进度
关于plasma-MVP
Github上关于plasma-MVP的源码链接:
1.https://github.com/kyokan/plasma (Go)
windows部署进度:
D:\GoLand\helloworld\src\github.com\kyokan\plasma\contracts>generate.js
–network ganache 提示JScript编译错误,错误码800A03EB
Linux部署进度:
~/go_project/src/github.com/kyokan/plasma/contracts$ truffle test
(node:8463) V8:
/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:3
Invalid asm.js: Invalid member of stdlib Error parsing
/home/xxx/go_project/src/github.com/kyokan/plasma/contracts/contracts/Migrations.sol: > ParsedContract.sol:11:14: ParserError: Expected identifier, got ‘LParen’ constructor() public {
^ Compilation failed. See above.
2.https://github.com/omisego/plasma-mvp#cli-documentation (Python)
辅助参考:ethereum开发环境构建(client端基于python) https://www.cnblogs.com/bigdata2013lee/p/8366684.html
Linux部署进度:
$ make test python -m pytest ImportError
while loading conftest
‘/home/gyz/Desktop/ethereum/plasma-mvp/tests/conftest.py’.// 暂时跳过test,直接编译root chain
$ make root-chain
solc.exceptions.SolcError: ByteUtils.sol:8:1: ParserError: Source file requires different compiler version (current compiler is 0.5.2+commit.1df8f40c.Linux.g++ - note that nightly builds are considered to be strictly less than the released version
系统自带的g++版本过高?
3.https://github.com/FourthState/plasma-mvp-sidechain (侧链代码,GO)
https://github.com/FourthState/plasma-mvp-rootchain (主链代码,GO)
Linux部署进度:rootchain安装完成,sidechain存在问题:
$ go install …/…/app/app.go:16:2: cannot find package
“github.com/cosmos/cosmos-sdk/baseapp” in any of:
// 直接访问对应页面,则提示404。。。
4.https://github.com/ethereum-plasma/plasma (Solidity)
windows部署进度:
D:\Blockchain\Ethereum_project\plasma>truffle.cmd compile
Error parsing
D:\Blockchain\Ethereum_project\plasma\contracts\PlasmaChainManager.sol:
ParsedContract.sol:82:13: ParserError: Literal, identifier or
instruction expected.
if lt(sigV, 27) { sigV := add(sigV, 27) }
^ Compilation failed. See above.
Linux部署进度:
~/Desktop/ethereum/plasma$ truffle compile (node:10011) V8:
/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:3
Invalid asm.js: Invalid member of stdlib
Error parsing /home/gyz/Desktop/ethereum/plasma/contracts/PlasmaChainManager.sol: ParsedContract.sol:82:3: ParserError: Literal, identifier or instruction expected.
if lt(sigV, 27) {
^Compilation failed. See above.
5.https://github.com/wolkdb/go-plasma (待测)
再贴几个文档供日后参考:
关于plasma-cash
1.https://github.com/omisego/plasma-cash
windows系统
(1)安装vcpkg:参考 https://blog.youkuaiyun.com/earbao/article/details/80481794 vcpkg安装指南
(2)sodility环境:此前已经配置好
(3)Ganache:此前也已经配置好
(4)Python3.5+:最新版下载地址 https://www.python.org/downloads/ 目前最新是3.7.2
Linux系统
(1)安装plyvel:参考 https://plyvel.readthedocs.io/en/latest/installation.html
(2)安装LevelDB
似乎是要安装leveldb,暂时停一下
2.https://github.com/loomnetwork/plasma-cash
运行官方测试成功
3.https://github.com/luciditytech/lucidity-plasma-cash
运行官方测试成功
可能没什么用的资料:
1.https://www.learnplasma.org/en/build
2.https://loomx.io/zh/ ,https://github.com/loomnetwork/plasma-cash
其他
一些细碎的东西
1.声明是node可执行文件: #!/usr/bin/env node
2.使用安装一些js模块:npm install 要安装模块的名字
3.node执行js文件时传入参数: node generate.js --network ganache
4.使用truffle编译文件时,建议使用truffle.cmd compile
5.Linux中make用法:在执行 make
之前,需要一个命名为 Makefile 的特殊文件来告诉 make 需要做什么,该怎么做,因此要进入Makefile所在的目录再执行。具体参考:https://www.cnblogs.com/zhoading/p/8523288.html