以太坊源码学习(六)geth源码debug以及遇到的问题记录 1.debug使用的idea是golang 参考https://blog.csdn.net/KeenCryp/article/details/811035662.win7环境执行debug时遇到的问题cc1.exe: sorry, unimplemented: 64-bit mode not compiled in参考https://blog.csdn.net/mecho/ar...
以太坊源码学习(五)提交交易之交易池 /internet/ethapi/api.go// submitTransaction is a helper function that submits tx to txPool and logs a message.func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (common....
以太坊源码学习(三)交易 internal/ethapi/api.go// SendTransaction will create a transaction from the given arguments and// tries to sign it with the key associated with args.To. If the given passwd isn't// able to decryp...
以太坊源码学习(二)geth启动 geth命令cmd/main/main.gofunc main() { if err := app.Run(os.Args); err != nil { // app是三方包,用于接收客户端命令 fmt.Fprintln(os.Stderr, err) os.Exit(1) }}func init() { // init方法先于main方法执行...
以太坊源码学习(一)区块结构 区块结构type Block struct { header *Header //区块头 uncles []*Header //防止攻击的 transactions Transactions //交易列表 // caches hash atomic.Value size atomic.Value // Td is us...
solidity学习笔记(十八)动态、固定字节数组以及string之间的转化 1.固定大小的数组之间的转化pragma solidity ^0.4.6;contract TestCharge{ bytes2 public b = 0x6c11; // bytes 大小使用bytes32的32决定 function bLength() returns(uint){ return b.length; } funct...
solidity学习笔记(十七)可变数组push pragma solidity ^0.4.6;contract TestPush{ bytes public name = new bytes(2); // 会增加长度 function pushName(byte b) public{ name.push(b); }}
solidity学习笔记(十六)可变长度字节数据 长度和内容都可以修改pragma solidity ^0.4.6;contract TestCreateBytes{ bytes public b = new bytes(1); function getLength() constant returns(uint){ return b.length; } function ...
solidity学习笔记(十五)特殊字符或者汉字字节大小 pragma solidity ^0.4.6;contract TestTeShu{ string public name="@!$F"; string public name2 = "小吴";//0x40212446 function getBytes() returns(bytes){ return bytes(name); } ...
solidity学习笔记(十四)string转化bytes pragma solidity ^0.4.6;contract TestString2Bytes{ string public _name="xiaowu"; function getLength() returns(uint){ return bytes(_name).length; } function setFirstBy...
solidity学习笔记(十二)固定长度字节数组 一个字节八位pragma solidity ^0.4.6;contract TestFixBytes{ // 一个字节 八位 固定大小数组内容和长度都不可修改 bytes9 a = 0x6c111122ab9;// bytes1 b = 0x69;//105 function test1() constant returns(bool){ r...
solidity学习笔记(十二)固定长度字节数组 一个字节八位pragma solidity ^0.4.6;contract TestFixBytes{ // 一个字节 八位 固定大小数组内容和长度都不可修改 bytes9 a = 0x6c111122ab9;// bytes1 b = 0x69;//105 function test1() constant returns(bool){ r...
solidity学习笔记(十一)string string使用“”或者‘’表示,是可变长度的字节数组一个汉字对应三个字节数据或者字符对应一个字节不能通过length获取长度或者修改,需要先转化为数组再做修改pragma solidity ^0.4.6;contract TestString{ string _name; function TestString() { _name = "xiao...
solidity学习笔记(十)sender转账 transfer转账余额不足,会异常sender转账余额不足返回false使用send要检查转账结果,深度限制1024所以使用tansfer更安全pragma solidity ^0.4.6;contract TestSender{ function deposit() payable returns(bool) { // 消息发送人的地址 ...
solidity学习笔记(十)sender转账 transfer转账余额不足,会异常sender转账余额不足返回false使用send要检查转账结果,深度限制1024所以使用tansfer更安全pragma solidity ^0.4.6;contract TestSender{ function deposit() payable returns(bool) { // 消息发送人的地址 ...
solidity学习笔记(九)transfer转账 转账方法需要申明payabletransfer转账pragma solidity ^0.4.6;contract TestTransaction{ function deposit() payable { address acc = 0x15Ee9687310EF47b59F2e6060d3b7AD90e6a09E5; acc.transfer(...
solidity学习笔记(八)钱包地址余额查看 address.balancepragma solidity ^0.4.6;contract TestBalance{ function getBalance(address addr) constant returns(uint){ return addr.balance; } function getCurrentBalance() co...
solidity学习笔记(七)地址支持的运算符 支持<= ,<,==,>=,>pragma solidity ^0.4.6;contract TestYunSun{ address address1=0x692a70d2e424a56d2c6c27aa97d1a86395877b3a; address address2=0x692a70d2e424a56d2c6c27aa97d1a86395877b...