ethereumjs/ethereumjs-blockchain-2-test】的更多相关文章

https://github.com/ethereumjs/ethereumjs-vm/blob/master/docs/index.md vm.runBlockchain Processes blocks and adds them to the blockchain 处理区块并将其添加到区块链中 Parameters输入参数 blockchain Blockchain A blockchain that to process 一个处理的区块链 cb Function the callback…
根据代码发现还要了解的模块有: ethereumjs/merkle-patricia-tree -对应数据存储的数据结构 ethereumjs-blockchain —— 区块链 ethereumjs-block ——区块 levelup —— 数据库ethereumjs-account ——账户状态 在本博客的ethereumjs分类中可见他们的学习文档 其实这就是怎么自己使用各个模块来生成一个类似geth客户端的以太坊虚拟机,然后进行各类区块链操作.然后上面的每个模块对应的就是实现这个虚拟机…
https://github.com/ethereumjs/ethereumjs-block/blob/master/docs/index.md 详细的调用代码可见本博客的ethereumjs/ethereumjs-block-3-tests 1.Block区块 Creates a new block object创建一个区块对象 Parameters输入参数 data (Array | Buffer | Object) 相关数据 opts Array Options 选项 opts.chain…
https://github.com/ethereumjs/ethereumjs-blockchain/tree/master/test 'use strict' const test = require('tape') const Blockchain = require('..') const Block = require('ethereumjs-block') const Common = require('ethereumjs-common') const async = requir…
https://github.com/ethereumjs/ethereumjs-blockchain SYNOPSIS概要 A module to store and interact with blocks 存储区块和与区块进行交互的模块 INSTALL安装 npm install ethereumjs-blockchain EXAMPLE The following is an example to iterate through an existing Geth DB (needs le…
ethereumjs/ethereumjs-util Most of the string manipulation methods are provided by ethjs-util 更多的字符串处理方法可以看ethjs-util addHexPrefix index.js:563-569 Adds "0x" to a given String if it does not already start with "0x" 在没有"0x"前缀的…
Utilities for handling Ethereum keys ethereumjs-wallet A lightweight wallet implementation. At the moment it supports key creation and conversion between various formats. 轻量级钱包实现.目前,它支持各种格式之间的key的创建和转换 It is complemented by the following packages: et…
https://github.com/ethereumjs/ethereumjs-tx A simple module for creating, manipulating and signing ethereum transactions 安装: npm install ethereumjs-tx --save example: const EthereumTx = require('ethereumjs-tx') const privateKey = Buffer.from('e331b6d…
https://github.com/ethereumjs/ethereumjs-icap ethereumjs-icap 安装: npm install ethereumjs-icap --save Utilities for handling ICAP addresses. It works in Node.js as well as in the browser via browserify. When minified for a browser, it should be less t…
为了了解ethereumjs/ethereumjs-block-3-代码的使用需要了解的一个模块 https://github.com/ethereumjs/ethereumjs-common Common Ethereum resources (successor for ethereum/common library)公共以太坊资源(以太坊/公共库后续) SYNOPSIS概要 ETHEREUMJS-COMMON Resources common to all Ethereum impleme…
https://github.com/ethereumjs/ethereumjs-common/blob/master/docs/index.md 该API的调用的详细例子可见ethereumjs/ethereumjs-common-3-test Common Common class to access chain and hardfork parameters 访问链和硬分叉参数的Common类 Parameters输入参数 chain (String | Number | Dictiona…
https://github.com/ethereumjs/browser-builds ethereumjs - Browser Builds This repository contains browser builds of the following ethereumjs libraries: 这个存储库包含以下ethereumjs库的浏览器构建(其实就是将下面的ethereumjs库构造成浏览器能够使用的js文件形式) ethereumjs-vm ethereumjs-tx ether…
https://github.com/ethereumjs/ethereumjs-vm/blob/master/docs/stateManager.md StateManager 要与本博客的ethereumjs/ethereumjs-account-1-简介和API结合学习,然后你就能够发现StateManager其实就是得到账户中的值.账户 = 账户地址address + 账户状态(有nonce,balance,stateRoot,codeHash).下面的方法得到或处理的就是账户中对应的这…
之前可以先了解一下另一个模块,看本博客的ethereumjs/ethereumjs-common部分内容 通过tests测试文件能够帮助更好了解API的使用 ethereumjs-block/tests/header.js const tape = require('tape') const Common = require('ethereumjs-common') const utils = require('ethereumjs-util') const rlp = utils.rlp co…
https://github.com/ethereumjs/ethereumjs-block Encoding, decoding and validation of Ethereum's Block schema 以太坊区块模式的编码.解码和验证 SYNOPSIS概要 Implements schema and functions related to Ethereum's block. 实现与以太坊区块相关的模式和函数 INSTALL安装 npm install ethereumjs-blo…
https://github.com/ethereumjs/ethereumjs-vm 其实这就是怎么自己使用该模块来生成一个类似geth客户端的以太坊虚拟机,然后进行各类区块链操作 SYNOPSIS概要 Implements Ethereum's VM in Javascript.用Javascript实现以太坊虚拟机 Fork Support分支支持 Starting with the v2.5.0 release we now support both Byzantium and Cons…
https://github.com/ethereumjs/merkle-patricia-tree SYNOPSIS概要 This is an implementation of the modified merkle patricia tree as specified in the Ethereum's yellow paper. 这是以太坊黄皮书上指定的改良后的merkle patricia树的实现. The modified Merkle Patricia tree (trie) pr…
https://github.com/ethereumjs/ethereumjs-account Encoding, decoding and validation of Ethereum's Account schema 以太坊账户概要的编码.解码和验证 账户 = 账户address + 账户状态 这个库处理的是账户状态,然后将账户address作为key,账户状态作为value,添加到state前缀树中,即生成了一个账户 SYNOPSIS概要 This library eases the h…
1.运行文件 var Buffer = require('safe-buffer').Buffer // use for Node.js <4.5.0 var VM = require('./index.js') // create a new VM instance var vm = new VM({chain : 'rinkeby'})//设置连接的为Rinkeby链 console.log(vm); 2.分析返回的vm对象: VM { opts: { chain: 'rinkeby' },…
ethereumjs-account/test/index.js const Account = require('../index.js') const tape = require('tape') tape('empty constructor', function (tester) { var it = tester.test it('should work', function (t) { var account = new Account() //创建一个空账户 t.equal(acc…
查看test能够让你更好滴了解其API文档的使用 ethereumjs-common/tests/chains.js const tape = require('tape') const Common = require('../index.js') tape('[Common]: Initialization / Chain params', function (t) { t.test('Should initialize with chain provided', function (st)…
SecureTrie src/secure.js:10-15 Extends Trie 扩展前缀树 You can create a secure Trie where the keys are automatically hashed using SHA3 by using require('merkle-patricia-tree/secure'). It has the same methods and constructor as Trie. 你可以通过使用require('merkle…
一 .什么是区块链? 区块链(Blockchain)是由节点参与的分布式数据库系统[1],它的特点是不可更改,不可伪造,也可以将其理解为账簿系统(ledger).它是比特币的一个重要概念,完整比特币区块链的副本,记录了其代币(token)的每一笔交易.通过这些信息,我们可以找到每一个地址,在历史上任何一点所拥有的价值. 区块链是由一串使用密码学方法产生的数据块组成的,每一个区块都包含了上一个区块的哈希值(hash),从创始区块(genesis block)开始连接到当前区块,形成块链.每一个区块…
BitCoin 比特币, 参考: BlockChain 区块链, 参考: 参考…
/* 以前只是听说过BlockChain,没怎么了解过,最近导师在搞Blockchain,让我配一下Open BlockChain的环境,于是就硬着头皮配了一下,还挺顺利的. 由于没接触过BlockChain,配置有什么问题还请各位大神指正*/ 环境:Ubuntu14.04 x64 一.准备工作: 1.Git Client Ubuntu自带git client 所以省略此步骤 2.Go环境配置 参考:http://xianglong.me/article/ubuntu-install-golan…
编者按:著名投资人 Fred Wilson 的同事 Joel Monegro 近日参加了纽约比特币 workshop HackBit聚会,其间他们讨论了比特币式的思维方式对未来十年世界的影响,而这种影响正在促成新的互联网世界结构的涌现.前不久,我们也报道了 Fred Wilson 的想法“Color a Bitcoin”,我们可以用比特币的优势去改造原有的所有行业.现在,Joel Monegro 等人又尝试把把比特币的思维方式推向极致.我们先来欣赏一下 Fred Wilson 的评论: 比特币的…
# -*- coding: utf-8 -*- ''' Created on 2018年3月11日 @author: Jason niu ''' import hashlib #该模块实现了诸多安全哈希和消息摘要算法的通用接口,包括 FIPS 安全哈希算法: SHA1.SHA224. SHA256.SHA384.RSA的 MD5 等等算法 import uuid #通用唯一标识符 ( Universally Unique Identifier ), 对于所有的UUID它可以保证在空间和时间上的唯…
[概念] 做服务的时候main里面不能单独有东西,都得包起来. Identifier expected是因为没有main函数 雾草,task3还要加proxy, add再干别的.难受!妈的,什么代理模式设计的要求都没注意到,太粗心了. main函数client里面不能丢,保证基本功能,其他的额外方法丢进proxy. constructor在main方法外面,main调用constructor来形成object https://blog.csdn.net/caohaicheng/article/d…
https://medium.com/@mycoralhealth/learn-to-securely-share-files-on-the-blockchain-with-ipfs-219ee47df54c   If you have any questions about the following tutorial or want to request a future tutorial, join our Telegram chat! Ask us anything! Before re…
「About Blockchain(一)」 --达沃斯年会上的区块链 写在前面:1月23日到26日,在瑞士达沃斯召开了第48届世界经济论坛.这个新闻本没有引起我格外的关注,直到前两天张老师分享给我一篇关于GBBC在达沃斯论坛上的消息,这才让人眼前一亮.张老师一直鼓励我多了解区块链的研究进展,也经常与我分享各大会议上的相关资料.虽说只是兴趣使然,也不是什么必修课,但对区块链的学习着实让我有了很大收获,不管是做项目还是专业课程学习.因此,我还会持续关注区块链的最新动态,顺便在这里整理一些较为基础的理…