Etherium test network construction

in #etherium6 years ago (edited)

###1. Types of Etherium Test Net
***Summary
Etherium TestNet can not be developed on the main net when you use Etherity DAPP to learn the usage before connecting to the actual Ethernet mainnet or to use the solidity language.
####1-1. Ropsten
It is the basic test net of Etherium and most similar to the environment of Etherium Mainnet.
Generally, it is widely used as smart contract development environment to make etherium DAPP.
Supports both geth and parity clients.

In February 2017, a "Spam Attack" occurred, which caused slow synchronization and the client was taking up a lot of disk space, causing a temporary suspension to resolve this "Spam Attack" issue.

It will be available again in March 2017, but the "Spam Attack" issue has not yet been fully resolved, so stability is lost.
The agreement algorithm uses "POW".
It was started in November 2016 and the name "Ropsten" was taken from Stockholm subway station.
Ethers that can be used in "Ropsten" can be mined or received from the faucet.

faucet is a site where you can get a test eider.
faucets list
https://faucet.metamask.io/
http://faucet.ropsten.be:3001
https://faucet.bitfwd.xyz/

####1-2 Kovan
It started in March 2017 and is named after a subway station in Singapore.
The supply of the eider is controlled by the trusted party.
Strong against "Spam Attack".
Only support parity without geth support.
Because POA is used, it does not reflect current environment of mainium.
Ether digging is not supported.
Ether must be requested on forcet.
This problem occurs to solve the "spam attack" problem of the existing Ropsten test net.
Supports quick redistribution for short test times and repeated tests.
Overall maintenance costs are low.

####1-3 Rinkeby

Distributed by Etherium Team.
Use the "Clique PoA" agreement protocol.
Beginning in April 2017.
Takes its name from the subway station in Singapore.
Strong against "Spam Attack" attacks.
Ether can not be mined.
Ether must be requested on forcet.
=> https://faucet.rinkeby.io/
Supported by geth only

###2. Etherium test network construction
####2-1. geth Start
- mkdir eth_data
- geth --networkid "123" --datadir "eth_data" --olympic console

위의 명령어를 입력 하면 콘솔 모드로 테스트 네트워크를 실행 하게 된다.

geth
--networkid : Network identifier
-- datadir : Directory where work files will be saved
-- olympic : Option to use the Olympic protocol to facilitate mining on test networks
-- console : Options to start in console mode

####2-2. 계좌 생성 하기
Create an account to remit the Ether or execute the contract.

  • The account you created is kept inside geth, so it can not be used by other nodes.

personal.newAccount("etestuser1")

  • ether_testuser1 : Account name to create for testing

After executing the command like above, the address of the account created by string is created.
This address will be used for remittance and other purposes.
"0xecab5aab260535f2752fa29a68e693db280d8bc"

Create another account for the transfer test.
personal.newAccount("etestuser2")

"0xefbc03b3a999037fd3a227c65ee8727c0067e451"

Enter the following command to verify the account created.

  • eth.accounts
    The result is a list of accounts created as shown below.

Immediately after initial start in etherium, the block number is zero.
Let's check it with the following command.
eth.blockNumber

To check the balance of the account, use the following command.
eth.getBalance(eth.accounts[0])
eth.getBalance(eth.accounts[1])

Since we have created a new account, the balance is "0".

####2-3. Send money(Ether) to the account you created.
At this time, the newly created account can not transfer money because Ether is "0".
Etherium, however, can be compensated for by generating blocks at intervals of several tens of seconds without transaction through mining.
Start mining first and digest the ether.
The mining can begin with the following command:
miner.start ()

...

Stop the mining at the proper time and check the account.
Stop mining with the command below.
(While the digging is in progress, you can not see the prompt because you can not see the command, just type it and press the enter key.)
miner.stop ()

Account verification

It says that the account information contains "27000000000000000000".
Let's not be surprised that there are so many eider.
The unit is called the wei unit, not the ether.
wei is multiplied by 1/10 ^ 18 to be the unit of ether.

So let's see how much Ether is.
"27000000000000000000 * (1/10 ^ 18) = 27"

####2-3. send Ether
To transfer the Ethernet, use the eth.sendTransaction command.
The usage is as follows.
eth.sendTransaction ({from: send account, to: receive account, web3.toWei (send amount, send unit)}}

Now type:
eth.accounts [1], value: web3.toWei (1, & quot; ether & quot;)}

When you enter the command, the message "Passphrase:" appears and you are prompted.
Enter the name of the account you want to send here.
I will enter "etestuser1" here.
The name you enter when creating your account is used like a password.
I do not know if it should be a password, but ...

I'll check my account again.
eth.getBalance (eth.accounts [0])
eth.getBalance (eth.accounts [1])

I did the remittance but it was not remittance.
There is no change in the amount of money sent to or received from the account.

It was like drinking alcohol but not drunk driving. It seems like.
Haha ... do not be surprised.

Currently, only remittance requests are made and it is said that the remittance is processed through mining to be confirmed.

Then, before sending money, there is a command to see the current undecided transaction.
Let's try it.
eth.pendingTransactions

Now, let's try to complete the remittance through mining.
To complete the remittance, you have to mine.

The mining order has been used once.
" miner.start () "

After mining, use " miner.stop " to stop mining.

Since we are not for mining but for testing, let's just do what is necessary and stop.
Because it's important for us to take the next step.

Now that the extraction is complete, let's look at the remittance details.
Now it seems increasingly proficient to try using the eth.getBalance command.
Eth.getBalance (eth.accounts [0])
Eth.getBalance (eth.accounts[1])

There was an increase in eth in eth. accounts [0] (etestuser 1).
Oh .. I sent money but Ether has increased.
The magic is ... Ha ha.

We did some more mining, and the " 1 Ether " remittance did increase the Ether.
But in eth. accounts [1], there is an increase of " 1 " Ether.

Finally, let me check and finish any outstanding transactions with the command below.
Eth.pendingTransaction

It turns out to be " null. "
They say there are no outstanding transactions.

So far, we have briefly looked at the Etherium test network, implemented it, and completed the remittance.

It feels like it's getting too long.

In the future, we will need to make the chapter shorter.
I hope that this data will help me understand this situation in the future.

I hope our lives will be happier and more enjoyable.

Sort:  

Congratulations @dodododo! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Do not miss the last post from @steemitboard:

Carnival Challenge - Collect badge and win 5 STEEM
Vote for @Steemitboard as a witness and get one more award and increased upvotes!

Congratulations @dodododo! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!