Ethereum stateroot
Publish: 2021-05-19 04:25:50
1. At the top of Ethereum is DAPP. It exchanges with the smart contract layer through Web3. JS. All smart contracts run on EVM (Ethereum virtual machine) and use RPC calls. Below EVM and RPC are the four core contents of Ethereum, including: blockchain, consensus algorithm, mining and network layer. Except DAPP, all other parts are in the Ethereum client. The most popular Ethereum client is geth (go Ethereum)
2. How to run Ethereum source code go Ethereum
install MIPS based Linux header file
$CD $prjroot / kernel
$tar - xjvf linux-2.6.38. Tar. Bz2
$CD linux-2.6.38
create an include folder under the specified path to store related header files< br />$ mkdir -p $TARGET_ Prefix / include
ensures that the Linux source code is clean
$make mrproper
generates the required header file< br />$ make ARCH=mips headers_ check
$ make ARCH=mips INSTALL_ HDR_ PATH=dest headers_ Install
all the files in dest folder to the specified include folder< br />$ cp -rv dest/include/* $TARGET_ Prefix / include
delete dest folder at last
$RM - RF dest
$LS - L $target_ PREFIX/include
install MIPS based Linux header file
$CD $prjroot / kernel
$tar - xjvf linux-2.6.38. Tar. Bz2
$CD linux-2.6.38
create an include folder under the specified path to store related header files< br />$ mkdir -p $TARGET_ Prefix / include
ensures that the Linux source code is clean
$make mrproper
generates the required header file< br />$ make ARCH=mips headers_ check
$ make ARCH=mips INSTALL_ HDR_ PATH=dest headers_ Install
all the files in dest folder to the specified include folder< br />$ cp -rv dest/include/* $TARGET_ Prefix / include
delete dest folder at last
$RM - RF dest
$LS - L $target_ PREFIX/include
3.
How to use the Linux system mining, to use the service of the HA Yu miner, only need two steps, you can mine on the Linux system
-
open the website, input the mobile phone number, select how many CPUs you want to use for mining, the default is to use 50% of the CPU for mining, click to generate your exclusive command and
in two steps, you can mine on Linux system, the money you dig only needs to go to the website of hayu miner, enter your mobile phone number to withdraw< br />
4. Build / env.sh go run build / ci.go install. / CMD / geth
make: * * [geth] error 1
there is no such directory, or the directory has insufficient permissions
make: * * [geth] error 1
there is no such directory, or the directory has insufficient permissions
5. t you," the matron said, "
6. 用ifconfig -a查看显示的是eth1,但是在/etc/system/network-scripts/目录下面显示的是eth0,所以才会导致这个问题的出现,解决方法就是在目录中将eth0重命名为eth1,如果是虚拟机还要修改网卡地址.
[root@centos network-scripts]# ifconfig -a
eth1 Link encap:Ethernet HWaddr 08:00:27:5C:4A:F6
inet addr:2.2.2.177 Bcast:2.2.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe5c:4af6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:72479 errors:0 dropped:0 overruns:0 frame:0
TX packets:36533 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5311979 (5.0 MiB) TX bytes:26144482 (24.9 MiB)
[root@centos network-scripts]# cp -a ifcfg-eth0 ifcfg-eth1
[root@centos network-scripts]# vim /etc/udev/rules.d/70-persistent-net.rules --查看网卡地址
[root@centos network-scripts]# rm -rf ifcfg-eth0 --如果是虚拟机还要修改网卡的地址
[root@centos ~]# /etc/init.d/network restart --重启成功了
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth1: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
[ OK ]
[root@centos ~]#
[root@centos network-scripts]# ifconfig -a
eth1 Link encap:Ethernet HWaddr 08:00:27:5C:4A:F6
inet addr:2.2.2.177 Bcast:2.2.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe5c:4af6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:72479 errors:0 dropped:0 overruns:0 frame:0
TX packets:36533 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5311979 (5.0 MiB) TX bytes:26144482 (24.9 MiB)
[root@centos network-scripts]# cp -a ifcfg-eth0 ifcfg-eth1
[root@centos network-scripts]# vim /etc/udev/rules.d/70-persistent-net.rules --查看网卡地址
[root@centos network-scripts]# rm -rf ifcfg-eth0 --如果是虚拟机还要修改网卡的地址
[root@centos ~]# /etc/init.d/network restart --重启成功了
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth1: Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
[ OK ]
[root@centos ~]#
7. [ root@centos1 ~]#Ifconfig
- bash: ifconfig: command not found
first, habitually input echo $path (check the current path environment variable, which has the same function as DOS path command, and note that the commands in Linux system are case sensitive), The results are as follows:
[ root@centos1 ~]#Echo $path
/ usr / local / SBIN / usr / local / bin / usr / SBIN / usr / bin / root / bin
from the results shown above, the path / usr / SBIN to place the system management program already exists, which is the path to place the external command. Directly use ls to view the / usr / SBIN / directory, and you don't see ifconfig. What's the matter< br />
[ root@centos1 ~]#Ls / usr / SBIN /
I still don't give up and I can't find ifconfig with find command< br />
[ root@centos1 ~]# find / -name " ifconfig"
at this time, I have the bottom of my mind. I should replace ifconfig with a command. Check on the network, sure enough, IP command has been used instead of ifconfig command. The common parameters of IP command are listed below< The code is as follows:
IP [option] operation object {link | addr | route...} & lt/ p> & lt; p># The network interface information is shown in the IP link show, and the network interface information is shown in the network interface information < br /
35; IP link set eth0 UPI 35; opening the network card
35; IP link set eth0 down # IP link set eth0 down # closing the network card < br / # IP link set eth0 promise on # opening the mixed mode of the network card < br /
35; IP link set eth0 Up0 upupi 35; opening the mixed mode of the network card < mixed mode of the network card is opening the mixed mode of the mixed mode of the network card < br / < br /
# IP link set set set set set set the IP link set set eth0 to be set as the network interface to be described in the network card, which is the network interface interface interface and the next one of the network card, which is defined in the network card, which is defined in the network interface interface H0 MTU 1400 ﹥ set the maximum transmission unit of network card
﹥ IP addr show ﹥ display IP information of network card
﹥ IP addr add 192.168.0.1/24 dev eth0 ﹥ set eth0 IP address 192.168.0.1
﹥ IP addr del 192.168.0.1/24 dev eth0 ﹥ delete eth0 IP address & lt/ p> & lt; p># IP route list # view routing information
# IP route add 192.168.4.0/24 via 192.168.0.254 dev eth0 # set the gateway of 192.168.4.0 network segment to 192.168.0.254, Data goes through eth0 interface
# IP route add default via 192.168.0.254 dev eth0 # setting default gateway to 192.168.0.254
# IP route del 192.168.4.0/24 # deleting gateway of 192.168.4.0 network segment
# IP route del default # deleting default route
after entering IP addr command, it is found that enp2s0 network card (this enp2s0 is my network card) has no IP address< br />
[ root@centos1 ~]#IP addr
since there is no IP address, go directly to the / etc / sysconfig / network scripts directory to see the configuration file name of the IP information of the network card< br />
[ root@centos1 ~]# ls /etc/sysconfig/network-scripts/
ifcfg-enp2s0 ifdown-eth ifdown-post ifdown-Team ifup-aliases ifup-ipv6 ifup-post ifup-Team init.ipv6-global
ifcfg-lo ifdown-ippp ifdown-ppp ifdown-TeamPort ifup-bnep ifup-isdn ifup-ppp ifup-TeamPort network-functions
ifdown ifdown-ipv6 ifdown-routes ifdown-tunn el ifup-eth ifup-plip ifup-routes ifup-tunnel network-functions-ipv6
ifdown-bnep ifdown-isdn ifdown-sit ifup ifup-ippp ifup-plusb ifup-sit ifup-wireless
[ root@centos1 ~]#
from the results, the name of the configuration file used to save the IP information of the network card has changed from ifcfg-eth0 to ifcfg-enp2s0. Well, since you gave him such a name, I'll use it first. Cat ifcfg-enp2s0
first[ root@centos1 ~]#Cat / etc / sysconfig / network scripts / ifcfg-enp2s0
code
the code is as follows:
hwaddr = 00: e0:69:01:6a:96
type = Ethernet
bootproto = DHCP
defraute = yes
peerdns = yes
peeroutes = yes
IPv4_ FAILURE_ FATAL=no
IPV6INIT=yes
IPV6_ AUTOCONF=yes
IPV6_ DEFROUTE=yes
IPV6_ PEERDNS=yes
IPV6_ PEERROUTES=yes
IPV6_ FAILURE_ Fat = no
name = enp2s0
UUID = 5b0a7d76-1602-4e19-aee6-29f57618ca01
onboot = no
from the above configuration, we can see that although bootproto = DHCP, onboot = No. here, use VI to change onboot = no to onboot = yes, and then restart CentOS< br />
[ root@centos1 ~]#Shutdown - R
after the restart, enter the account number and password to enter the command prompt operator and continue to view the network card information with IP addr. The results are as follows:
[ root@centos1 ~]# ip add
1: lo: < LOOPBACK,UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_ lft forever preferred_ lft forever
inet6 ::1/128 scope host
valid_ lft forever preferred_ lft forever
2: enp2s0: < BROADCAST,MULTICAST,UP,LOWER_ UP> mtu 1500 qdisc pfifo_ fast state UP qlen 1000
link/ether 00:e0:69:01:6a:96 brd ff:ff:ff:ff:ff:ff
inet 172.8.1.200/24 brd 172.8.1.255 scope global enp2s0
valid_ lft forever preferred_ lft forever
inet6 fe80::2e0:69ff:fe01:6a96/64 scope link
valid_ lft forever preferred_ lft forever
[ root@centos1 ~]#
from the above results, we can see that the IP address assigned through DHCP is 172.8.1.200. Although it is a testing machine, we should configure a fixed IP for this machine for the convenience of remote connection in the future
open ifcfg-enp2s0 with VI, input the following parameters, and then annotate bootproto = DHCP with #
code
the code is as follows:
ipaddr0 = 172.8.1.211
prefix 0 = 24
gateway 0 = 172.8.1.1
dns1 = 172.8.1.1
the complete parameters are as follows, OK, the network is configured.
- bash: ifconfig: command not found
first, habitually input echo $path (check the current path environment variable, which has the same function as DOS path command, and note that the commands in Linux system are case sensitive), The results are as follows:
[ root@centos1 ~]#Echo $path
/ usr / local / SBIN / usr / local / bin / usr / SBIN / usr / bin / root / bin
from the results shown above, the path / usr / SBIN to place the system management program already exists, which is the path to place the external command. Directly use ls to view the / usr / SBIN / directory, and you don't see ifconfig. What's the matter< br />
[ root@centos1 ~]#Ls / usr / SBIN /
I still don't give up and I can't find ifconfig with find command< br />
[ root@centos1 ~]# find / -name " ifconfig"
at this time, I have the bottom of my mind. I should replace ifconfig with a command. Check on the network, sure enough, IP command has been used instead of ifconfig command. The common parameters of IP command are listed below< The code is as follows:
IP [option] operation object {link | addr | route...} & lt/ p> & lt; p># The network interface information is shown in the IP link show, and the network interface information is shown in the network interface information < br /
35; IP link set eth0 UPI 35; opening the network card
35; IP link set eth0 down # IP link set eth0 down # closing the network card < br / # IP link set eth0 promise on # opening the mixed mode of the network card < br /
35; IP link set eth0 Up0 upupi 35; opening the mixed mode of the network card < mixed mode of the network card is opening the mixed mode of the mixed mode of the network card < br / < br /
# IP link set set set set set set the IP link set set eth0 to be set as the network interface to be described in the network card, which is the network interface interface interface and the next one of the network card, which is defined in the network card, which is defined in the network interface interface H0 MTU 1400 ﹥ set the maximum transmission unit of network card
﹥ IP addr show ﹥ display IP information of network card
﹥ IP addr add 192.168.0.1/24 dev eth0 ﹥ set eth0 IP address 192.168.0.1
﹥ IP addr del 192.168.0.1/24 dev eth0 ﹥ delete eth0 IP address & lt/ p> & lt; p># IP route list # view routing information
# IP route add 192.168.4.0/24 via 192.168.0.254 dev eth0 # set the gateway of 192.168.4.0 network segment to 192.168.0.254, Data goes through eth0 interface
# IP route add default via 192.168.0.254 dev eth0 # setting default gateway to 192.168.0.254
# IP route del 192.168.4.0/24 # deleting gateway of 192.168.4.0 network segment
# IP route del default # deleting default route
after entering IP addr command, it is found that enp2s0 network card (this enp2s0 is my network card) has no IP address< br />
[ root@centos1 ~]#IP addr
since there is no IP address, go directly to the / etc / sysconfig / network scripts directory to see the configuration file name of the IP information of the network card< br />
[ root@centos1 ~]# ls /etc/sysconfig/network-scripts/
ifcfg-enp2s0 ifdown-eth ifdown-post ifdown-Team ifup-aliases ifup-ipv6 ifup-post ifup-Team init.ipv6-global
ifcfg-lo ifdown-ippp ifdown-ppp ifdown-TeamPort ifup-bnep ifup-isdn ifup-ppp ifup-TeamPort network-functions
ifdown ifdown-ipv6 ifdown-routes ifdown-tunn el ifup-eth ifup-plip ifup-routes ifup-tunnel network-functions-ipv6
ifdown-bnep ifdown-isdn ifdown-sit ifup ifup-ippp ifup-plusb ifup-sit ifup-wireless
[ root@centos1 ~]#
from the results, the name of the configuration file used to save the IP information of the network card has changed from ifcfg-eth0 to ifcfg-enp2s0. Well, since you gave him such a name, I'll use it first. Cat ifcfg-enp2s0
first[ root@centos1 ~]#Cat / etc / sysconfig / network scripts / ifcfg-enp2s0
code
the code is as follows:
hwaddr = 00: e0:69:01:6a:96
type = Ethernet
bootproto = DHCP
defraute = yes
peerdns = yes
peeroutes = yes
IPv4_ FAILURE_ FATAL=no
IPV6INIT=yes
IPV6_ AUTOCONF=yes
IPV6_ DEFROUTE=yes
IPV6_ PEERDNS=yes
IPV6_ PEERROUTES=yes
IPV6_ FAILURE_ Fat = no
name = enp2s0
UUID = 5b0a7d76-1602-4e19-aee6-29f57618ca01
onboot = no
from the above configuration, we can see that although bootproto = DHCP, onboot = No. here, use VI to change onboot = no to onboot = yes, and then restart CentOS< br />
[ root@centos1 ~]#Shutdown - R
after the restart, enter the account number and password to enter the command prompt operator and continue to view the network card information with IP addr. The results are as follows:
[ root@centos1 ~]# ip add
1: lo: < LOOPBACK,UP,LOWER_ UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_ lft forever preferred_ lft forever
inet6 ::1/128 scope host
valid_ lft forever preferred_ lft forever
2: enp2s0: < BROADCAST,MULTICAST,UP,LOWER_ UP> mtu 1500 qdisc pfifo_ fast state UP qlen 1000
link/ether 00:e0:69:01:6a:96 brd ff:ff:ff:ff:ff:ff
inet 172.8.1.200/24 brd 172.8.1.255 scope global enp2s0
valid_ lft forever preferred_ lft forever
inet6 fe80::2e0:69ff:fe01:6a96/64 scope link
valid_ lft forever preferred_ lft forever
[ root@centos1 ~]#
from the above results, we can see that the IP address assigned through DHCP is 172.8.1.200. Although it is a testing machine, we should configure a fixed IP for this machine for the convenience of remote connection in the future
open ifcfg-enp2s0 with VI, input the following parameters, and then annotate bootproto = DHCP with #
code
the code is as follows:
ipaddr0 = 172.8.1.211
prefix 0 = 24
gateway 0 = 172.8.1.1
dns1 = 172.8.1.1
the complete parameters are as follows, OK, the network is configured.
8. Route add - net 192.168.2.0 netmask 255.255.255.0 ethx
add a route 2 network segment, and the ethx in the back goes to that device, which is the network card
add a route 2 network segment, and the ethx in the back goes to that device, which is the network card
Hot content