小黑游戏最新手机游戏下载平台

手游资讯 单机资讯 最近更新 热门排行
您现在的位置:首页 > 手机软件 > 生活应用 > Parity钱包V1.9.2
Parity钱包V1.9.2
79.8%
7.74%

Parity钱包V1.9.2

  • 软件介绍
  • 软件截图
  • 相关下载

作为比特币的竞争对手,成立于2014年的加密货币以太坊(Ethereum)在全球市场日益升温,总价值超过280亿美元。但在全球火爆的背后安全问题也日益突显,17年7月以太坊钱包Parity被黑客攻击窃取了15.3万以太坊(约合3200万美元)之后,今天再次被曝光存在安全漏洞,导致价值数亿美元的以太坊被冻结。在此之后Parity钱包进行了升级。

Parity钱包官方简介

原以太坊基金会部分成员,开发的钱包。功能强大,也是一个全节点 钱包。

Parity钱包下载地址

Windows:Windowsparity_1.9.2_installer.exe

Mac:Macosparity_1.9.2_macos.pkg

Parity钱包特色

优势:

安全度高,不需要经过第三方发起交易

劣势:

对网络要求高,需要连接节点才能发起交易

Parity钱包安装使用教程

一、Parity钱包下载安装

之前的教程中我们讲解了Mist钱包、MetaMask、myetherwallet钱包,这篇教程中,我们系统介绍一下Parity钱包的使用。

Parity钱包下载安装https://parity.io。

如官方所示,ThefastestandmostsecurewayofinteractingwiththeEthereumblockchainParity是最快最安全的钱包。

打开官方,我们看到有三种安装方式,第一种,直接下载安装,第二种,Brew安装,第三种,Docker安装。

在我们案例中,我们通过Brew来进行安装。

1、GettingHomebrew

/usr/bin/ruby-e"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"

2、AddingParitytoyourlistofHomebrew‘kegs’

打开终端,输入下面的命令,按enter。

brewtapparitytech/paritytech

3、InstallingParity

稳定版

brewinstallparity--stable

最新版

brewinstallparity

最新开发版

brewinstallparity--master

更新最新版本

brewupdate&&brewupgradeparity

and

brewreinstallparity

4、查看安装版本

liyuechun:~yuechunli$parity--version

Parity

versionParity/v1.8.2-beta-1b6588c-20171025/x86_64-macos/rustc1.21.0

Copyright2015,2016,2017ParityTechnologies(UK)Ltd

LicenseGPLv3+:GNUGPLversion3orlater.

Thisisfreesoftware:youarefreetochangeandredistributeit.

ThereisNOWARRANTY,totheextentpermittedbylaw.

ByWood/Paronyan/Kotewicz/Drwi?ga/Volf

Habermeier/Czaban/Greeff/Gotchac/Redmann

liyuechun:~yuechunli$

二、设置chainspec

PoAchain需要设置一个创世区块。

{

"name":"DemoPoA",

"engine":{

"authorityRound":{

"params":{

"stepDuration":"5",

"validators":{

"list":[

]

}}}},

"params":{

"gasLimitBoundDivisor":"0x0400",

"maximumExtraDataSize":"0x20",

"minGasLimit":"0x1388",

"networkID":"0x2323"

},

"genesis":{

"seal":{

"authorityRound":{

"step":"0x0",

"signature":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

}},

"difficulty":"0x20000",

"gasLimit":"0x5B8D80"

},

"accounts":{

"0x0000000000000000000000000000000000000001":{

"balance":"1",

"builtin":{

"name":"ecrecover",

"pricing":{

"linear":{

"base":3000,

"word":0

}}}},

"0x0000000000000000000000000000000000000002":{

"balance":"1",

"builtin":{

"name":"sha256",

"pricing":{

"linear":{

"base":60,

"word":12

}}}},

"0x0000000000000000000000000000000000000003":{

"balance":"1",

"builtin":{

"name":"ripemd160",

"pricing":{

"linear":{

"base":600,

"word":120

}}}},

"0x0000000000000000000000000000000000000004":{

"balance":"1",

"builtin":{

"name":"identity",

"pricing":{

"linear":{

"base":15,

"word":3

}}}}}}

stepDuration设定成5秒产生一个区块。

validators设定Authority的地方,目前先空著,后面创建account之后再回来填入。

将上面的文件保存到桌面的一个文件中,保存为demo-spec.json。

三、设置两个节点

在我们这篇文章中,我们在同一台电脑设置两个节点,跟我们讲解以太坊私网建立(2)–同一台电脑/不同电脑运行多个节点时,如果在同一台电脑设置两个节点,需要将rpcport和port设置为不同的值,否则就会发生冲突,POAchain中也是一样,需要将一些参数设置为不同的值。

-d:指定存储资料与账号的目录

--dport:指定Parity的networkport,可用来让其他node连接

--jsonrpc-port:这是JSONRPCport,使用web3.js时会需要

ui-port:Parity提供的Web-basedUIport

可以用下列指令启动Paritynode。

parity--chaindemo-spec.json-dparity0--port30300--ui-port8180--jsonrpc-port8540--jsonrpc-apisweb3,eth,net,personal,parity,parity_set,traces,rpc,parity_accounts

除了打一长串的指令外,Parity也提供更为简洁的config档案设定方式,使用--config即可引用配置文件。

node0使用如下配置文件node0.toml:

[parity]

chain="demo-spec.json"

base_path="parity0"

[network]

port=30300

[rpc]

port=8540

apis=["web3","eth","net","personal","parity","parity_set","traces","rpc","parity_accounts"]

[ui]

port=8180

[websockets]

port=8456

node1使用如下配置文件node1.toml:

[parity]

chain="demo-spec.json"

base_path="parity1"

[network]

port=30301

[rpc]

port=8541

apis=["web3","eth","net","personal","parity","parity_set","traces","rpc","parity_accounts"]

[ui]

port=8181

[websockets]

port=8457

四、设置账号(Account)

我们总共需要设置三个账号,两个Authority和一个user账号。

第一步:首先启动node0:parity--confignode0.toml

打开网页http://localhost:8180,按照步骤创建一个用户账号。

新增Authorityaccount,使用Restore功能,为了示范一致性,我们使用node0当作passphrase。

到目前为止我们已经完成node0的账号设置。

Authorityaccount:0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e

Useraccount:0x0064B0999c0142eE99aB0ceC054BAb53fe0a3EcC

第二步:设置node1的账号,启动parity--confignode1.toml。步骤相同,连接到http://localhost:8181,passphrase使用node1。

这样就完成了node1的账号设置。

Authorityaccount:0x00F9B30838ca40c8A53c672840acbDec6fCDb180

第三步:将Authorityaccount写入demo-spec.json文件

"validators":{

"list":[

"0x00F9B30838ca40c8A53c672840acbDec6fCDb180",

"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"

]

}

再将useraccount加入accounts,並给一些balance,后续可以使用。

"0x0064B0999c0142eE99aB0ceC054BAb53fe0a3EcC":{

"balance":"10000000000000000000000"

}

完成后的demo-spec.json如下:

{

"name":"DemoPoA",

"engine":{

"authorityRound":{

"params":{

"stepDuration":"5",

"validators":{

"list":[

"0x00F9B30838ca40c8A53c672840acbDec6fCDb180",

"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"

]

}}}},

"params":{

"gasLimitBoundDivisor":"0x0400",

"maximumExtraDataSize":"0x20",

"minGasLimit":"0x1388",

"networkID":"0x2323"

},

"genesis":{

"seal":{

"authorityRound":{

"step":"0x0",

"signature":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

}},

"difficulty":"0x20000",

"gasLimit":"0x5B8D80"

},

"accounts":{

"0x0000000000000000000000000000000000000001":{

"balance":"1",

"builtin":{

"name":"ecrecover",

"pricing":{

"linear":{

"base":3000,

"word":0

}}}},

"0x0000000000000000000000000000000000000002":{

"balance":"1",

"builtin":{

"name":"sha256",

"pricing":{

"linear":{

"base":60,

"word":12

}}}},

"0x0000000000000000000000000000000000000003":{

"balance":"1",

"builtin":{

"name":"ripemd160",

"pricing":{

"linear":{

"base":600,

"word":120

}}}},

"0x0064B0999c0142eE99aB0ceC054BAb53fe0a3EcC":{

"balance":"10000000000000000000000"

},

"0x0000000000000000000000000000000000000004":{

"balance":"1",

"builtin":{

"name":"identity",

"pricing":{

"linear":{

"base":15,

"word":3

}}}}}}

五、启动Authoritynode

为了启动Authoritynode来产生区块,我们必须设定负责产生block的signer,分別是node0和node1account。

1、第一步,创建一个node.pwds文件,写入node0与node1的password,内容如下:

node0

node1

2、第二步,在node0.toml文件中加入[account]及[mining]设置,如下:

[parity]

chain="demo-spec.json"

base_path="parity0"

[network]

port=30300

[rpc]

port=8540

apis=["web3","eth","net","personal","parity","parity_set","traces","rpc","parity_accounts"]

[ui]

port=8180

[account]

password=["node.pwds"]

[mining]

engine_signer="0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"

reseal_on_txs="none"

3、第三步,在node1.toml文件中加入[account]及[mining]设置,如下:

[parity]

chain="demo-spec.json"

base_path="parity1"

[network]

port=30301

[rpc]

port=8541

apis=["web3","eth","net","personal","parity","parity_set","traces","rpc","parity_accounts"]

[ui]

port=8181

[websockets]

port=8457

[account]

password=["node.pwds"]

[mining]

engine_signer="0x00F9B30838ca40c8A53c672840acbDec6fCDb180"

reseal_on_txs="none"

4、第四步,Step4分別启动两个node

parity--confignode0.toml

parity--confignode1.toml

六、连接两个节点

使用Postman透过JSONRPC来测试。

1、第一步,Post下列JSON数据至http://localhost:8540以取得node0的enode资料

{

"jsonrpc":"2.0",

"method":"parity_enode",

"params":[],

"id":0

}

获取到的数据如下:

{

"jsonrpc":"2.0",

"result":"enode://cfb3af513da3a7a8138450f0dc01fa38cb2ac837744dc645038940287f4dce3f416f0e7e17fd10619a263c360d9324fd2dcd8753c4500fcc54cf84e076b39cd6@192.168.10.101:30300",

"id":0

}

"enode://cfb3af513da3a7a8138450f0dc01fa38cb2ac837744dc645038940287f4dce3f416f0e7e17fd10619a263c360d9324fd2dcd8753c4500fcc54cf84e076b39cd6@192.168.10.101:30300"是node0的标识。下一步中我们将将它加入到node1中以实现两个节点之间的连接。

2、第二步,将node0的enode加入node1,Post下列JSONs数据至node1(http://localhost:8541)

{

"jsonrpc":"2.0",

"method":"parity_addReservedPeer",

"params":["enode://cfb3af513da3a7a8138450f0dc01fa38cb2ac837744dc645038940287f4dce3f416f0e7e17fd10619a263c360d9324fd2dcd8753c4500fcc54cf84e076b39cd6@192.168.10.101:30300"],

"id":0

}

返回的数据如下,result为true,说明连接成功:

{

"jsonrpc":"2.0",

"result":true,

"id":0

}

再切换到node1的终端,会看到下面的数据:

1/25peers13KiBchain11KiBdb0bytesqueue10KiBsyncRPC:0conn,0req/s,24µs

如上图所示,表示连接成功。

七、发送交易

在我们这个案例中,我们一个创建了三个账号,一个用户账号,两个POA账号,刚开始的时候我们为用户账号初始化了10000ETH。如下图所示,账号与账号之间可以相互转账。

八、分享给其他节点

在开发时通常会将node跑在server上,让其他人可以通过JSONRPCport连接上去使用,此时只要在config文件里面加入[interface]设置即可。

假设serverip为192.168.1.5,将node0.toml修改如下:

[parity]

chain="demo-spec.json"

base_path="parity0"

[network]

port=30300

[rpc]

port=8540

apis=["web3","eth","net","personal","parity","parity_set","traces","rpc","parity_accounts"]

interface="192.168.1.5"

[ui]

port=8180

[account]

password=["node.pwds"]

[mining]

engine_signer="0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"

reseal_on_txs="none"

node1.toml修改如下:

[parity]

chain="demo-spec.json"

base_path="parity1"

[network]

port=30301

[rpc]

port=8541

apis=["web3","eth","net","personal","parity","parity_set","traces","rpc","parity_accounts"]

interface="192.168.1.5"

[ui]

port=8181

[websockets]

port=8457

[account]

password=["node.pwds"]

[mining]

engine_signer="0x00F9B30838ca40c8A53c672840acbDec6fCDb180"

reseal_on_txs="none"

相关版本

'); })();