generated from cotes2020/chirpy-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: Geth 기본 명령어 | ||
date: 2024-12-13 20:42:00 +/-TTTT | ||
categories: [Security, Blockchain] | ||
tags: [security, blockchain, geth] | ||
math: true | ||
--- | ||
|
||
## Ethereum 실행하기 | ||
|
||
```shell | ||
% geth --datadir {경로} console | ||
``` | ||
|
||
## Geth에서 자주 쓰이는 명령어 | ||
|
||
### 계좌 정보 | ||
|
||
모든 계좌 확인하기 | ||
``` | ||
> eth.accounts | ||
``` | ||
|
||
특정 계좌 확인하기 | ||
``` | ||
> eth.accounts[숫자] | ||
``` | ||
|
||
잔고 확인하기 | ||
``` | ||
> eth.getBalance(eth.accounts[숫자]) | ||
``` | ||
|
||
### 계좌 잠금을 풀 때 | ||
|
||
``` | ||
> personal.unlockAccount(eth.accounts[숫자]) | ||
> personal.unlockAccount(eth.accounts[숫자], "기존 비밀번호") | ||
``` | ||
|
||
### 채굴 | ||
|
||
``` | ||
> miner.start() | ||
> miner.stop() | ||
``` | ||
|
||
채굴 전엔 잔액이 0이었으나, 채굴 후엔 아래 사진과 같이 잔액이 늘어난 것을 확인할 수 있음. | ||
|
||
![img](/assets/img/2024-12-13-geth-command/0.png){: w="500" }{: .shadow } | ||
|
||
- 0번째 계좌만 잔액이 늘어난 이유는 기본 계좌가 0번 계좌로 설정되어 있기 때문임. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Solidity 설치하기 | ||
date: 2024-12-13 19:19:00 +/-TTTT | ||
categories: [Security, Blockchain] | ||
tags: [security, blockchain, solidity, ethereum] | ||
math: true | ||
--- | ||
|
||
## Solidity Compiler 설치하기 | ||
|
||
npm을 이용하여 설치해보자. | ||
|
||
```shell | ||
% sudo npm install -g solc | ||
``` | ||
|
||
## 프로그래밍 예제 | ||
|
||
> VSC에서 `hello.sol` 파일을 만들고 프로그래밍 해보자. | ||
``` | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity 0.8.28; | ||
contract hello{ | ||
string message = "Hello world!"; | ||
function showMsg() public view returns (string memory){ | ||
return message; | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.