OSK盘古挖矿生态dapp系统开发案例智能合约定制

124 阅读1分钟

区块链是什么?一句话,系统I34-开发I633-搭建53I9,它是一种特殊的(非关系型)分布式数据库,这种数据库只能做插入和查找操作,并且没有管理员。

首先,区块链的主要作用是储存信息。任何需要保存的信息,都可以写入区块链,也可以从里面读取,所以它是数据库。

其次,任何人都可以架设服务器,加入区块链网络,成为一个节点。区块链的世界里面,没有中心节点,每个节点都是平等的,都保存着整个数据库。你可以向任何一个节点,写入/读取数据,因为所有节点最后都会同步,保证区块链一致。

软件安装与配置

2.1. Ubuntu

2.1.1. 安装 geth

安装环境

Ubuntu 17.10

sudo apt upgrade -y

sudo apt install software-properties-common

sudo add-apt-repository -y ppa:ethereum/ethereum

sudo apt update

sudo apt install ethereum

neo@netkiller ~ % geth version

2.1.2. 安装 solc

sudo apt install solc -y

neo@netkiller ~ % solc --version

solc, the solidity compiler commandline interface

Version: 0.4.19+commit.c4cbbb05.Linux.g++

2.2. Windows

访问

下载并安装 Geth for Windows

2.3. Mac OS

brew tap ethereum/ethereum

brew install ethereum

2.4. 编译安装

git clone

sudo apt-get install -y build-essential golang

cd go-ethereum

make geth

mixhash: 与nonce配合用于挖矿,由上一个区块的一部分生成的hash。注意他和nonce的设置需要满足以太坊的Yellow paper, 4.3.4. Block Header Validity, (44)章节所描述的条件。.

nonce: nonce就是一个64位随机数,用于挖矿,注意他和mixhash的设置需要满足以太坊的Yellow paper, 4.3.4. Block Header Validity