: Z `1 C6 [ Z( l8 k3 r; s
操作系统:centos7( {; k+ D$ s; @' k
参考网址为:https://developers.eos.io/eosio- ... single-node-testnet
step1编译代码
获取git代码
k3 C' E7 y5 |& M/ A2 R
$ ]$ h6 z: X% h/ h; C2 k
gitclonehttps://github.com/EOSIO/eos--recursive
, S9 F* l9 i* |! ]8 X0 [% Z
如果未添加--recursive,则在拉完代码后,运行: o& T8 D% C" B8 Z) o
1 ^' {. p/ l. d2 s
cdeos
gitsubmoduleupdate--init--recursive
切换分支3 B- R$ n, |7 V, c
3 _# L. @3 Q k
cdeos2 r u1 d7 l2 j6 W2 w( f" N0 B
5 N7 z+ N/ ^ \
gitcheckoutv1.0.5- u( O2 S1 a" T/ j9 ~
8 P0 v+ S$ N7 }4 f. V
编译 - r5 X1 v5 p$ N e+ m
- l' d* ]8 V7 v2 k
sudo./eosio_build.sh
3 c& g0 E7 V4 x% h
得到如下结果,则为成功; |; e% n2 Z2 L: ^6 d# x
0 @9 Q/ O. Q* x+ Z9 e! a
(____\(___)(____\\____/(___)" ~. b+ B. M& Y* {/ G& G
8 n+ z: y) ~- U4 i7 ]) ]
|(\/|()||(\/)(|()|
|(__|||||(_____||||||! }0 B4 R) R. I! ^) R) R* ?
3 G3 O% F$ l+ R" ?8 `% Y
|__)||||(_____)||||||1 m T1 K1 F+ r; k- w1 W
|(||||)|||||||6 b7 \# |( V7 V2 l* a3 c% V
|(____/\|(___)|/\____)|___)(___|(___)|/ W2 V( j7 _% @" L! V9 k3 Y
(_______/(_______)\_______)\_______/(_______)
- EOSIOhasbeensuccessfullybuilt.00:08:30
- 4 z. q/ [4 T3 p
- Toverifyyourinstallationrunthefollowingcommands:4 o. m* a' w: p% v" ^4 g* i* f7 b6 Z
- 9 _% t- h; v0 i4 L' \
- /root/opt/mongodb/bin/mongod-f/root/opt/mongodb/mongod.conf&4 c% s( k# `; P, Z5 r
- ( e# e1 }+ h7 y1 M# z0 d$ z
- source/opt/rh/python33/enable/ ]7 ^0 Z2 A! z* A0 U- q7 q% p1 q- F7 G
- * Z& l+ M, M6 ^
- exportPATH=${HOME}/opt/mongodb/bin:$PATH
- 9 Y: ^: @- Q# _3 n& v' k# A
- cd/data/home/admin/eos-private/eos/build;maketest
- Formoreinformation:5 A+ C1 [0 x5 B% q" z
- " E. r* Y2 [1 f3 w" c
- EOSIOwebsite:<a href="https://eos.io" target="_blank">https://eos.io</a> r& f% g5 D A
- * I" P. c$ M1 ]4 n& d
- EOSIOTelegramchannel@https://t.me/EOSProject
- EOSIOresources:<a href="https://eos.io/resources/" target="_blank">https://eos.io/resources/</a>; \: O( V. h8 a+ J2 Q" w0 v
- , `7 B) z! @) A% E1 \7 G- \
- EOSIOStackExchange:<a href="https://eosio.stackexchange.com" target="_blank">https://eosio.stackexchange.com</a>) r# k- [' L2 I6 a
- ) }/ H. a ]! F8 `- D
- EOSIOwiki:<a href="https://github.com/EOSIO/eos/wiki" target="_blank">https://github.com/EOSIO/eos/wiki</a>
. X2 h S [5 L! v) D- K9 b7 ^
启动节点
; p! F5 W6 T- P
[项目路径]/eos/build/programs/nodeos/nodeos5 Z, X* O+ b- B+ B" K- t
你也可以设置全局,随时随地启动
. D7 q, J7 K0 e. k F
cdeos/build$ G) j- D0 C4 E/ M. f, h1 E
sudomakeinstall
step2配置环境(本地单节点)/ b7 e2 h G) d7 y
$ r# l4 R6 B+ u4 ?' ]& ^
配置文件所在位置
~/.local/share/eosio/nodeos/config
配置文件修改内容
; y5 {4 t( a7 B: K! A
#设置可以访问节点的ip,0.0.0.0为所有IP都可以
http-server-address=0.0.0.0:8888( t) W/ c2 X: E N+ E _2 V
/ t; l2 C& P9 M. A0 Z8 W
#设置是否可以生产块+ c/ J/ h& a+ u. u: `5 I0 s
enable-stale-production=true
#设置生产者名称
producer-name=eosio
#是否启动过滤
' T0 c2 V& j& V2 S: V) R
filter-on=*
6 d* F) `" D, s, _3 e
#生产者密钥$ @7 I& O6 h% M, @5 h) z
private-key=["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]; f3 F5 A6 c/ A# y5 {
. `! I9 {. \% i0 |$ @4 {% `5 c1 w
#插件列表
$ v* ]' |; U% y ?% f) E
plugin=eosio::chain_api_plugin, V4 g- o! H5 B6 h0 N f
% ?$ C% [2 Y- c6 S; _
plugin=eosio::chain_plugin3 @0 W+ D* n: H% F/ q- E& I h
plugin=eosio::producer_plugin- p1 w( O! ~0 ?! S
plugin=eosio::http_plugin
plugin=eosio::history_api_plugin
重新启动节点nodeos7 c, e+ y- {7 N; `- I4 J" M
$ K; g8 N6 K0 T4 ?- h
ps-A|grepnodeos
2 K- R* _$ X/ |0 f
kill[pid]/ e3 u# e$ t2 _& Z4 S* @
- O$ N7 B( v7 F
节点配置
创建钱包
% z9 v* G) c* M4 A
cleoswalletcreate-nkgbp
返回钱包密码
$ g8 Y+ b' u/ }
PW5Ki8SMwkxfuvtXWy7fgj9FcGWdWfKQ6kfoq9KGHUvPoUfW6M8fx" Q7 X( {2 k( y, W' C2 u
记下密码,以后解锁要用
2 s2 V3 i4 H$ }
1.打开钱包" C: ]4 Y7 X( L" g
; r% v2 R- ?# W1 S: g1 ^) ~. |
cleoswalletopen-nkgbp8 ]* u5 F/ M2 g) H# J2 ]) f- P
2.解锁钱包; ^ Y0 N9 \2 Y. }
' z8 A5 {7 E: H
cleoswalletunlock-nkgbp
3.生成密钥对
cleoscreatekey0 U% F! Q! v K7 E1 Q2 I
8 h! S v! q- G- E( u: n! u
4.创建eosio.token账号
8 j4 P9 f1 `3 p
cleoscreateaccounteosioeosio.tokenPublicKeyPublicKey
5.密钥导入钱包
% H& ~; F3 Y( C1 {
cleoswalletimportPrivateKey-nkgbp
T1 l$ e* k& \1 L: \, X
6.发布eosio.token合约
! p! C' P" ~/ c
cleossetcontracteosio.token./contracts/eosio.token/
7.创建和发布代币1 o" g0 v) x- \- i) I
* i' S0 p2 t# B
cleospushactioneosio.tokencreate'["eosio","1000000000.0000EOS",0,0,0]'-peosio.token: c3 g! s! ^7 I( q; w! y! e5 [8 `, W8 p
cleospushactioneosio.tokenissue'["eosio","1000000000.0000EOS","issue"]'-peosio$ s' h7 O1 g( P" }. I6 y* N
8.在通过3,4,5创建一个自己的账号测试转账/ t' c3 [1 B4 G& i8 m3 }3 R
9.进行转账7 B: ?8 r( ^' I. D8 ~. y% t1 r
" T' I" _/ Z, r5 ^% |+ U4 ?
cleospushactioneosio.tokentransfer'["eosio","[自己创建的账号]","100.0000EOS","58tsncxlb7nq0"]'-peosio1 V0 Z' I3 d' w7 z
10.查看余额
. e' i/ P7 y2 D% m0 T9 j3 x; K
cleostransfereosio[自己创建的账号]"1.0000EOS""issue"
8 E7 a& V- k/ T% N8 R& }+ W$ d
. b% |8 ^# B" a3 a