※ 참고 (2026년 기준) Go 1.16 부터 모듈 모드가 기본이라 GO111MODULE=auto 로 끄는 대신 프로젝트 폴더에서 go mod init 모듈이름 으로 go.mod 를 만드는 것이 정석이다.
프로젝트용 폴더 생성
main.go 파일 생성
package main
import "fmt"
func main ( ) {
fmt . Println ( "hello world" )
}
vscode 로 폴더 열기
F5 로 실행 -> Error
dlv 파일이 없어서 생긴 문제 인것 같아서 일단 delve 패키지 install
하지만
go : go .mod file not found in current directory or any parent directory ; see 'go help modules'
터미널에서
go env - w GO111MODULE = auto
F5 로 실행 및 디버깅
그리고 vscode의 환경설정에 아래 코드 추가
"go.toolsManagement.autoUpdate" : true,
in 매개 변수
// 여기서의 in은 ref readonly처럼 작동함 함수 call시에는 in을 쓰거나 말거나 동일
void PrintDate ( in DateTime date )
{
Console . WriteLine ( date ) ;
}
null 관련 연산자
// 오래전
instance = instance == null ? value : instance ;
// 기존
instance = instance ? ? value ;
// 현재
instance ? ? = value ;
Auto Property
// C# 6.0 Auto property
public string Name { get ; set ; } = "Karu" ;
Index 연산
// C# 8.0 인덱스 연산
string str = "Rolling Ress" ;
var last = str [ ^ 1 ] ; // 's'
var sub = str [ 0..4 ] ; // "Roll", 구간은 [0, 4)
※ 참고 (2026년 기준) 2022년 머지(The Merge) 이후 geth 혼자서는 메인넷을 동기화할 수 없고 컨센서스 클라이언트(Lighthouse, Prysm 등)가 함께 있어야 한다. personal API 는 geth 1.14 에서 제거되었다. 또 --http.corsdomain "*" 와 계정 잠금 해제(--unlock)를 같이 쓰면 외부에서 지갑을 쓸 수 있으므로 외부에 열린 서버에서는 절대 쓰지 않는다.
환경
설치
소스를 받아서 빌드하는 방법도 있겠지만 간편하게 시스템을 운영하기 위해 apt를 사용하는 방식으로 설치
sudo apt install ethereum
개발 환경 구성
genesis.json 구성 : 특별히 eiplxxblock 부분은 ethereum이 발전되어 가면서 계속 항목이 추가 되는 것 같다. 만약 이 글을 보고 그 후에 돌리려 하는데 제대로 안 도는 경우 새로 생성된 부분이 있는지 확인이 필요
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"config" : {
"chainId" : 8484,
"homesteadBlock" : 0,
"eip150Block" : 0,
"eip155Block" : 0,
"eip158Block" : 0,
"byzantiumBlock" : 0,
"constantinopleBlock" : 0,
"petersburgBlock" : 0,
"istanbulBlock" : 1000
} ,
"alloc" : { } ,
"coinbase" : "0x0000000000000000000000000000000000000000" ,
"difficulty" : "0x2" ,
"extraData" : "" ,
"gasLimit" : "0x47e7c5" ,
"nonce" : "0x0000000000000042" ,
"mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000" ,
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000" ,
"timestamp" : "0x00"
}
geth 초기화 (최초 블록 생성 genesis.json 사용)
geth -- datadir ethereum init genesis .json
geth -- networkid 8484 \
-- nodiscover \
-- maxpeers 0 \
-- http -- http .corsdomain "*" \
-- http .api web3 , miner , eth , debug , personal , net , admin , clique \
-- allow - insecure - unlock \
-- snapshot = false \
-- unlock 0xbaeea1f241f74a95e33db04a70c3c115868c58b9 \
-- password pword \
-- ethstats bootnode1 : anydragon @ 0.0.0.0 : 8080 \
console 2 >> eth .log
링크