Position: Home page » Ethereum » Ethereum command line create account

Ethereum command line create account

Publish: 2021-05-06 15:17:30
1.

In Ethereum, all kinds of transfer and other transaction operations need to be completed by accounts. In the transaction platform, such as currency exchange transaction platform, each transaction needs to have a transaction initiation account and a transaction receiving account. Each account corresponds to an address, and the account name is the label of the address. Use a wallet to manage accounts. A wallet can contain multiple accounts. Of course, you can also create multiple wallets

2. Well, there are two ways
3. To create a Genesis configuration file:
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
4. How many account addresses can an Ethereum node have at most
A: generally, there is only one account address, otherwise there will be an error! blockchain itself is unique. If there are multiple account addresses on one node, it violates the fundamental principle of blockchain!
5. The Internet has just begun, intelligent life coming
6. You can only dig it. If you can't, you can only buy it by auction house. It's a little less than 10 in 2 hours. Where did you dig it? You can go to Huanxing mountain and xilisus. The output is still good. You can also find the transformation master's Alchemy to transform AOJIN ingot, which can be critical hit.
7. When the mobile phone is lost, it can prevent others from using or swiping the lock screen password. The system allows users to remotely lock on the website. After locking, the security of the mobile phone is greatly improved, and it enters the lost mode to automatically take photos! Remote location and so on! But now the technology of online unlocking is also very strong, often tens of dollars in half an hour!
8. When using ifconfig eth0 up in Linux to display insufficient permissions, the following methods can be adopted:
before executing the command, switch to root user and then execute the command. The method of switching to root:
whether logging in to Ubuntu in graphical mode or command line mode, We will find that the default user is user
but when we need to perform some operations with root permissions (such as repairing system files), we often need to use sudo authorization
at this time, we can switch to the root user and simply execute sudo Su
note: for security reasons, the root user of Ubuntu does not have a fixed password by default, Its password is randomly generated and dynamically changed
and seems to change every five minutes, so Su (switch user) is not allowed, because we don't know the password of root
the default root user has no fixed password and is locked, If you want to set a password for root
just execute the command sudo passwd root and follow the prompts step by step
in this way, you can switch to the root user by entering the root password as mentioned in (1)
note: after setting the password for root, you can still switch to the root user by sudo Su
attachment: in the graphic mode, the system - & gt; System management - & gt; Users and groups can also set a password for root
Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750