Extradata in Ethereum
first, you need to create a "Genesis" JSON configuration file, which describes some parameters of the genesis block. The following is the content of the file:
{
& quot; coinbase": & quot;& quot;,< br />" config": {< br />" homesteadBlock": 5
},
" difficulty": & quot; 0x20000",< br />" extraData": & quot; 0x",< br />" gasLimit": & quot; 0x2FEFD8",< br />" mixhash": & quot;& quot;,< br />" nonce": & quot; 0x0",< br />" parentHash": & quot; 000000000000000000000000",< br />" timestamp": & quot; 0x00",< br />" alloc": {< br />"& quot;:< br />{
" balance":& quot;& quot;
}
}
} 1234567891011213141516171819
the above code into a text file and name it genesis.json
Genesis!:
in order not to conflict with the data of the main chain, it is recommended to establish your own private chain data folder. On my computer, I built an ethdbspace as the Ethereum experimental work area on disk e, and created a privchain folder as the data storage folder of my first private chain
here, in order to facilitate management, I put genesis.json under the ethdbspace folder
open the windows command line
type the following command
geth -- dataDir & quot; E:\ EthDBSpace\ PrivChain" init " E:\ EthDBSpace\ genesis.json" 1
– the dataDir option is used to specify the data directory of our private chain. On my computer, it's E: &; EthDBSpace\ Privchain
init is the genesis command, followed by our Genesis configuration file path
after clicking enter, the execution result is as follows
at this time, genesis is complete
create an account:
in order to do experiments on the private chain, we also need to create our own account on the private chain
windows command line, type
geth -- dataDir & quot; E:\ EthDBSpace\ PrivChain" Console1
we have successfully created the world, so when we enter the client for the second time, we do not need to specify the genesis.json file path again, but directly – dataDir to indicate the private link data path
the console command is used to open the command line of geth
after clicking enter, the client will be initialized for a while. After the command prompt appears, it means that you have entered the geth console
type
personal. Newaccount (& #) in the geth command line; Your Password') 1
the personal.newaccount function is used to create an account, in which the parameter is the account password.
after clicking enter, the account creation address will be listed in green below the command, that is, the public key of the account.
we can check the account balance first, In the geth command line, type:
My = eth. Accounts [0]
eth. Getbalance (my) 12
My = eth. Accounts [0]. The purpose of this sentence is to assign the account address we just created to my variable. This can simplify the subsequent account address input. Among them, eth.accounts records the addresses of all accounts on this machine. Since we created an account for the first time, there is only one account on the computer at present. So here we use eth. Accounts [0] to extract the first account address. The eth.getbalance function is used to obtain the account balance, and the parameters are filled in the account address. The my variable here records the address of the first account
I hope my answer can help you
eth0 to awk for processing
where - F & # 39;:|< br />+'
this is a separator defined by awk and then matched with "BCAST & quot;, Take the content of the fourth column
since your command is not universal, you can't output the result here, but you should intercept the broadcast address
Transaction
the behavior of blockchain transaction follows different rule sets
< UL >e to the distributed and unlicensed nature of public blockchain, anyone can sign the transaction and broadcast it to the network
according to different blockchains, traders will be charged a certain transaction fee, which depends on the needs of users rather than the value of assets in the transaction
blockchain transactions do not require any central authority verification. It only needs to use the digital signature algorithm (DSA) corresponding to its blockchain to sign it with the private key
once a transaction is signed, broadcast to the network and mined into a successful block in the network, the transaction cannot be recovered
Ethereum transaction structure
Ethereum transaction data structure: transaction 0.1 eth
{& 39; nonce': 39; 0x00', // Decimal: 0
& 39; gasLimit': 39; 0x5208', // Decimal system: 21000
& 39; gasPrice': 39; 0x3b9aca00', // Decimal system: 10000000000
& 39; to': 39; 39; ,// Sending address
& 39; value': 39; 0x16345785d8a0000',// 100000000000000000 ,10^17
' data': 39; 0x', // Decimal representation of null data; chainId': 1 / / blockchain network ID
}
these data have nothing to do with the transaction content, but have something to do with the execution mode of the transaction. This is because when you send a transaction in Ethereum, you must define some other parameters to tell miners how to handle your transaction. Transaction data structure has two attribute designs & quot; gas": & quot; gasPrice",& quot; gasLimit"
" gasPrice": The unit is Gwei, which is 1 / 1000 eth, indicating the transaction cost
& quot; gasLimit": The maximum gas charge allowed for the transaction
these two values are usually filled in automatically by the wallet provider
in addition, you need to specify which Ethereum network to execute the transaction (chainid): 1 represents the Ethereum main network
ring development, tests are usually carried out locally and on the test network, and transactions are carried out through the test eth issued by the test network to avoid economic losses. After the test, enter the main network transaction
in addition, if you need to submit some other data, you can use & quot; data" And & quot; nonce" Attach as part of a transaction
a nonce (number used only once) is the value used by Ethereum to track transactions, which helps to avoid double spending and replay attacks in the network
Ethereum transaction signature
Ethereum transaction involves ECDSA algorithm. Taking JavaScript code as an example, the popular ethers.js is used to call ECDSA algorithm for transaction signature
you can use the online application composer to deliver signed transactions to Ethereum. This is known as "offline signature.". Offline signatures are particularly useful for applications such as status channels, which are smart contracts that track the balance between two accounts and transfer funds after a signed transaction is submitted. Offline signature is also a common practice in dexes
you can also use online wallet to create signature verification and broadcast through Ethereum account
with Portis, you can sign a transaction to interact with the gas station network (GSN)
< / UL >
the Xueshuo innovation blockchain Technology Workstation of Lianqiao ecation online is the only approved "blockchain Technology Specialty" pilot workstation of "smart learning workshop 2020 Xueshuo innovation workstation" launched by the school planning, construction and development center of the Ministry of ecation of China. Based on providing diversified growth paths for students, the professional station promotes the reform of the training mode of the combination of professional degree research, proction, learning and research, and constructs the applied and compound talent training system
1
prepare to
download a VirtualBox, install it and open it. In addition, if you want to be able to view USB devices from your Mac OS X virtual machine, please download the expansion pack of VirtualBox and go to step 2
2
to create a new virtual machine before running it
with VirtualBox, you can run Mac OS X on windows by creating a virtual machine, which is a program to simulate an ordinary computer. To create a virtual machine, open VirtualBox and click "new" in the upper left corner. Give you the name of the new virtual machine, and then choose the "Mac OS X" operating system type. If your VirtualBox version requires you to choose between 64 bit and 32-bit, be sure to choose 64 bit. Choosing 32 bits will lead to a key "master meditate" error later
I recommend a virtual machine that allocates 4 GB of ram, but the ram can be allocated as low as 2 GB. Here you specify that every time you open Mac OS X, the memory will be used to run the virtual machine. The memory will be returned to your normal computer after VirtualBox is turned on and off
you need to create a new hard disk virtual machine. VirtualBox will ask you what type of disk you want to create: VDI, vdmk, or VHD. VDI is the original format for VirtualBox, while vdmk is the format for VMware. If you are considering making a of VMware, you may want to choose vdmk. Otherwise, just select VDI. I suggest a dynamic expansion disk; The only other option, fixed size storage, will eat up your hard drive
3
new operating system of virtual machine
your virtual machine is now created. But don't stop - you also need to change some settings in your machine to actually work. Your new virtual machine will appear in the left column of the start page of VirtualBox. From the VirtualBox virtual home page, select your Mac OS X virtual machine (click) and open the virtual machine settings. Once the settings are turned on, go to system and clear the enable EFI box. This is one of the most important settings you will need to change so far
4
EFI, which represents the extended firmware interface, is a function to help the operating system boot. Unfortunately, Mac OSX requires a "special" EFI, allowing VirtualBox to use a non working EFI
when you've done that, go to the settings for storage. In the storage tree, you will see the disc icon marked "empty". Click it, and then click "select virtual CD / DVD disk file". In the pop-up window, select niresh. ISO file; The file might be named "OSX Mavericks. ISO"
in this way, when your virtual machine starts for the first time, it will start to niresh
5
install OS X Mavericks
start virtual machine. You will take out the niresh boot screen, there is an option to choose: OSX Mavericks. Press enter on the keyboard. Note 1: if your computer uses an AMD processor, you must enter the boot flag "amd" or "AMD64" (without quotation marks) - you need a flag depending on your specific processor, so test the time of a flag bit. Type the boot flag "amdfx" (also without quotes) if your AMD processor is in its model name "FX". Note 2: VirtualBox may have problems starting Mac OS X, if your computer uses Intel's Haswell processor (that is, if your computer built / bought 2013 or later). If this is the case, you will have to cheat VirtualBox into thinking that your processor is actually an old model. To do this, open a command prompt in windows (make sure your Windows is logged in to the administrator account). You can do this by opening the start menu and entering it into the "command prompt" in the search bar of the start menu. Then, type the following command to the command prompt. CD“C:\ Program files; ORACLE \ VirtualBox virtual "this command will change the focus of the command prompt to the program folder VirtualBox (if you have installed VirtualBox in different places, then change the command regardless of whether you have installed it). Next, type the following command: vboxmanage modifyvm & lt; Virtual machine name & gt-- Cpuidset 00000001 000306a9 00020800 80000201 178bfbff this command is activated, a command line program included in VirtualBox virtual "vboxmanage" allows you to edit the performance of your virtual machine, including its built-in resolution. Replace the "name of the virtual machine" with the name of your virtual machine (without quotes) - you can select the name of the virtual machine in the left pane of the VirtualBox main window. This is the trick that the order should do
6
when you press the "enter" key and wait a few seconds, the virtual machine will automatically start the Mac OS X installation This startup process may take a few minutes.) Finally, you will arrive at the welcome page of the installation program
7
if you continue, you will take out a page and ask you to provide a "destination" for your Mac installation. Oh, no, the page is blank! We have to solve this problem. To do this, start the disk tool (located in the Utilities menu)
Mac OSX can only be installed on a completely clean disk, so you need to use the disk tool to wipe your VirtualBox virtual hard disk. Click the disk tool of VirtualBox virtual hard disk and delete it. Don't worry, nothing will do. It's very important
on the installation summary page for Mac OSX, the VirtualBox virtual hard disk should now be displayed. Click the Customize button in the lower left corner of the summary page. This is really useful with a distribution: niresh lets you install additional drivers in hackintosh and kext files directly from OS X Mavericks
the default selection will enable the virtual machine on Mac OS X to boot without any help. There are only two things you need to change in the process:
Deselect to install the network driver (kext file). This option is selected by default. Usually, it will enable niresh to automatically detect the Ethernet controller of your computer and install the corresponding Ethernet key, so that your Internet will work in Mac OS X immediately. However, this function does not really work in VirtualBox. What it does is break the virtual machine of the Internet
unselect graph - & gt; Graphicsenable = yes. This option is also selected by default. Usually, it allows Mac OS X to work better with your computer's graphics card. However, VirtualBox doesn't support Mac OS X graphics anyway, so this option is basically meaningless for virtual machines. All it does is rece the default screen size of your virtual machine from 1280 × 1024 1024 × 768
once you select the appropriate option from the customize screen, return to the installation summary page and click Install. When the installation is complete, Mac OS X crashes to a black and white screen. This is normal; Mac OS X for has been successfully installed. Now proceed to the next step
boot it up, restart the virtual machine, and eject niresh from the virtual DVD drive. To pop up the CD Icon on niresh, right-click in the lower right corner of the VirtualBox window, and then deselect the niresh file (possibly named "OSX Mavericks. ISO"). Your mouse cursor may be trapped in the virtual machine. Press the "Ctrl" key on the right side of the keyboard to let the mouse escape
after the niresh pops up, restart the virtual machine again. Now, on the startup screen, you'll see the icon for you to install the calf hard drive (also, the screen of your virtual machine may be larger than before)
in a few seconds, the Mavericks will start, and you should eventually lead to the Mac OS X setup screen. Fill it in and retire
above, the first part of the guide is finished. You'll have to wait a few minutes for niresh to finish installing the extra kext files and drivers, but after that, audio and Ethernet should work automatically. But you haven't finished yet! You still need to be able to add your virtual machine, which may still stay at 1280 × 1024 (even 1024 × 768)
note: a common problem with niresh is that it often lags behind the account creation process and jumps directly to the Mac OS X login screen before you can make your own account. If this happens, just log in to Mac OS X with the following credentials: user name: root password: niresh. This will allow you to log in to the Mac OS X account at root. From here, open the system preferences program, go to users and groups, and create your own account We do not recommend that you use the root account permanently because it is not secure.)
to make the screen bigger, although this step is optional, I suggest you do it anyway. Anyway, when you first use a virtual machine, you may notice one thing: your screen resolution is 1280 × 1024 × 768 or if you forget to turn off graphicsenable. Because VirtualBox does not "technically" support Mac OS X, there is no formal way to change this. But here's how you can change it anyway. First, you need to visit org. Chameleon. Boot. Plist to set the file for your virtual machine's Mac OS X bootloader. From finder, you can build it into Mac OS X. but file browser does this. Searcher hides Mavericks in hard drive by default. To unhide them, open finder and click file - & gt; Preferences at the top of Mac OS X, in the sidebar settings menu bar, select hard disk, so the search will display the sidebar of your virtual machine's hard disk
once this is done, access the virtual machine's primary hard drive by searching and go to the folder "extra". Open the file org. Chameleon. Boot. Plist. In & lt; Dictionary & gt; And & lt/ Dictionary & gt; , insert the following line< br />
< Key & gt; Graphic mode & lt/ Key & gt< br />< String> 1920x1080x32 & lt/ String & gt
you can change any resolution of "1920x1080x32", which is most suitable for your monitor. For example, if you want to use 1600x900 resolution, enter "1600x900x32". Once you save it, shut down the virtual machine
next, shut down your virtual machine. Open a command prompt in windows (make sure you are logged in to an administrator account on Windows). You can do this by opening the start menu and entering it into the "command prompt" in the search bar of the start menu. Then, type the following command to the command prompt. CD“C:\ Program files; ORACLE \ VirtualBox virtual "this command will change the focus of the command prompt to the program folder VirtualBox (if you have installed VirtualBox in different places, then change the command regardless of whether you have installed it). Then, type in the command: "customvideomode1" "1920x1080x32" vboxmanage setextradata "the command to start" vboxmanage ", a command line program, including with VirtualBox, allows you to modify the properties of your virtual machine, including its built-in resolution. Replace virtual machine name with virtual machine name - you can find
2
to create a new virtual machine before running it
with VirtualBox, you can run Mac OS X on windows by creating a virtual machine, which is a program to simulate an ordinary computer. To create a virtual machine, open VirtualBox and click "new" in the upper left corner. Give you the name of the new virtual machine, and then choose the "Mac OS X" operating system type. If your VirtualBox version requires you to choose between 64 bit and 32-bit, be sure to choose 64 bit. Choosing 32 bits will lead to a key "master meditate" error later
I recommend a virtual machine that allocates 4 GB of ram, but the ram can be allocated as low as 2 GB. Here you specify that every time you open Mac OS X, the memory will be used to run the virtual machine. The memory will be returned to your normal computer after VirtualBox is turned on and off
you need to create a new hard disk virtual machine. VirtualBox will ask you what type of disk you want to create: VDI, vdmk, or VHD. VDI is the original format for VirtualBox, while vdmk is the format for VMware. If you are considering making a of VMware, you may want to choose vdmk. Otherwise, just select VDI. I suggest a dynamic expansion disk; The only other option, fixed size storage, will eat up your hard drive
3
new operating system of virtual machine
your virtual machine is now created. But don't stop - you also need to change some settings in your machine to actually work. Your new virtual machine will appear in the left column of the start page of VirtualBox. From the VirtualBox virtual home page, select your Mac OS X virtual machine (click) and open the virtual machine settings. Once the settings are turned on, go to system and clear the enable EFI box. This is one of the most important settings you will need to change so far
4
EFI, which represents the extended firmware interface, is a function to help the operating system boot. Unfortunately, Mac OSX requires a "special" EFI, allowing VirtualBox to use a non working EFI
when you've done that, go to the settings for storage. In the storage tree, you will see the disc icon marked "empty". Click it, and then click "select virtual CD / DVD disk file". In the pop-up window, select niresh. ISO file; The file might be named "OSX Mavericks. ISO"
in this way, when your virtual machine starts for the first time, it will start to niresh
5
install OS X Mavericks
start virtual machine. You will take out the niresh boot screen, there is an option to choose: OSX Mavericks. Press enter on the keyboard. Note 1: if your computer uses an AMD processor, you must enter the boot flag "amd" or "AMD64" (without quotation marks) - you need a flag depending on your specific processor, so test the time of a flag bit. Type the boot flag "amdfx" (also without quotes) if your AMD processor is in its model name "FX". Note 2: VirtualBox may have problems starting Mac OS X, if your computer uses Intel's Haswell processor (that is, if your computer built / bought 2013 or later). If this is the case, you will have to cheat VirtualBox into thinking that your processor is actually an old model. To do this, open a command prompt in windows (make sure your Windows is logged in to the administrator account). You can do this by opening the start menu and entering it into the "command prompt" in the search bar of the start menu. Then, type the following command to the command prompt. CD“C:\ Program files; ORACLE \ VirtualBox virtual "this command will change the focus of the command prompt to the program folder VirtualBox (if you have installed VirtualBox in different places, then change the command regardless of whether you have installed it). Next, type the following command: vboxmanage modifyvm & lt; Virtual machine name & gt-- Cpuidset 00000001 000306a9 00020800 80000201 178bfbff this command is activated, a command line program included in VirtualBox virtual "vboxmanage" allows you to edit the performance of your virtual machine, including its built-in resolution. Replace the "name of the virtual machine" with the name of your virtual machine (without quotes) - you can select the name of the virtual machine in the left pane of the VirtualBox main window. This is the trick that the order should do
6
when you press the "enter" key and wait a few seconds, the virtual machine will automatically start the Mac OS X installation This startup process may take a few minutes.) Finally, you will arrive at the welcome page of the installation program
7
if you continue, you will take out a page and ask you to provide a "destination" for your Mac installation. Oh, no, the page is blank! We have to solve this problem. To do this, start the disk tool (located in the Utilities menu)
Mac OSX can only be installed on a completely clean disk, so you need to use the disk tool to wipe your VirtualBox virtual hard disk. Click the disk tool of VirtualBox virtual hard disk and delete it. Don't worry, nothing will do. It's very important
on the installation summary page for Mac OSX, the VirtualBox virtual hard disk should now be displayed. Click the Customize button in the lower left corner of the summary page. This is really useful with a distribution: niresh lets you install additional drivers in hackintosh and kext files directly from OS X Mavericks
the default selection will enable the virtual machine on Mac OS X to boot without any help. There are only two things you need to change in the process:
Deselect to install the network driver (kext file). This option is selected by default. Usually, it will enable niresh to automatically detect the Ethernet controller of your computer and install the corresponding Ethernet key, so that your Internet will work in Mac OS X immediately. However, this function does not really work in VirtualBox. What it does is break the virtual machine of the Internet
unselect graph - & gt; Graphicsenable = yes. This option is also selected by default. Usually, it allows Mac OS X to work better with your computer's graphics card. However, VirtualBox doesn't support Mac OS X graphics anyway, so this option is basically meaningless for virtual machines. All it does is rece the default screen size of your virtual machine from 1280 × 1024 1024 × 768
once you select the appropriate option from the customize screen, return to the installation summary page and click Install. When the installation is complete, Mac OS X crashes to a black and white screen. This is normal; Mac OS X for has been successfully installed. Now proceed to the next step
boot it up, restart the virtual machine, and eject niresh from the virtual DVD drive. To pop up the CD Icon on niresh, right-click in the lower right corner of the VirtualBox window, and then deselect the niresh file (possibly named "OSX Mavericks. ISO"). Your mouse cursor may be trapped in the virtual machine. Press the "Ctrl" key on the right side of the keyboard to let the mouse escape
after the niresh pops up, restart the virtual machine again. Now, on the startup screen, you'll see the icon for you to install the calf hard drive (also, the screen of your virtual machine may be larger than before)
in a few seconds, the Mavericks will start, and you should eventually lead to the Mac OS X setup screen. Fill it in and retire
above, the first part of the guide is finished. You'll have to wait a few minutes for niresh to finish installing the extra kext files and drivers, but after that, audio and Ethernet should work automatically. But you haven't finished yet! You still need to be able to add your virtual machine, which may still stay at 1280 × 1024 (even 1024 × 768)
note: a common problem with niresh is that it often lags behind the account creation process and jumps directly to the Mac OS X login screen before you can make your own account. If this happens, just log in to Mac OS X with the following credentials: user name: root password: niresh. This will allow you to log in to the Mac OS X account at root. From here, open the system preferences program, go to users and groups, and create your own account We do not recommend that you use the root account permanently because it is not secure.)
to make the screen bigger, although this step is optional, I suggest you do it anyway. Anyway, when you first use a virtual machine, you may notice one thing: your screen resolution is 1280 × 1024 × 768 or if you forget to turn off graphicsenable. Because VirtualBox does not "technically" support Mac OS X, there is no formal way to change this. But here's how you can change it anyway. First, you need to visit org. Chameleon. Boot. Plist to set the file for your virtual machine's Mac OS X bootloader. From finder, you can build it into Mac OS X. but file browser does this. Searcher hides Mavericks in hard drive by default. To unhide them, open finder and click file - & gt; Preferences at the top of Mac OS X, in the sidebar settings menu bar, select hard disk, so the search will display the sidebar of your virtual machine's hard disk
once this is done, access the virtual machine's primary hard drive by searching and go to the folder "extra". Open the file org. Chameleon. Boot. Plist. In & lt; Dictionary & gt; And & lt/ Dictionary & gt; , insert the following line< br />
< Key & gt; Graphic mode & lt/ Key & gt< br />< String> 1920x1080x32 & lt/ String & gt
you can change any resolution of "1920x1080x32", which is most suitable for your monitor. For example, if you want to use 1600x900 resolution, enter "1600x900x32". Once you save it, shut down the virtual machine
next, shut down your virtual machine. Open a command prompt in windows (make sure you are logged in to an administrator account on Windows). You can do this by opening the start menu and entering it into the "command prompt" in the search bar of the start menu. Then, type the following command to the command prompt. CD“C:\ Program files; ORACLE \ VirtualBox virtual "this command will change the focus of the command prompt to the program folder VirtualBox (if you have installed VirtualBox in different places, then change the command regardless of whether you have installed it). Then, type in the command: "customvideomode1" "1920x1080x32" vboxmanage setextradata "the command to start" vboxmanage ", a command line program, including with VirtualBox, allows you to modify the properties of your virtual machine, including its built-in resolution. Replace "virtual machine name" with virtual machine name - you can find your virtual machine name in VirtualBox