1. 테스트 이더리움 환경(NET) 선정


Mainnet : geth attach

Rinkeby : geth --rinkeby attach

Ropsten : geth --testnet attach


2. 테스트 이더리움 연결 및 Sync

# rinkeby 이더리움 데이터 Sync

geth --rinkeby   


# rinkeby 이더리움 연결

geth --rinkeby attach


# 데이터 싱크 상태 확인 

eth.syncing



3. 계정 생성


# 계정 확인

eth.accounts


# 신규 계정 생성

personal.NewAccount("xxxxxx");


# 잔고 확인

eth.getBalance(eth.accounts[0])


# 이더 확보

http://plus.google.com 에서 위에 생성된 주소 post후 URL 주소확인

https://www.rinkeby.io/#faucet 에서 생성된 URL 주소 입력후 이더 요청


https://rinkeby.etherscan.io/  : 트랜잭션 상태 확인



4. ens 등록 및 검색


위에 내용을 정리해서 설명 하자면...


# ens 관련 api 유틸 load

loadScript('./ensutils-testnet.js');


# 사용할 계정 unlock

web3.personal.unlockAccount(web3.personal.listAccounts[0]);


# 사용할 이름이 등록 되어 있는지 확인

new Date(testRegistrar.expiryTimes(web3.sha3('ether_test1')).toNumber() * 1000);

==> 날짜가 최근 날짜가 안 나오면 사용이 가능 ( 1970년... )

# 해당 이름을 등록 (해당 이름을 사용자와 맵핑)
testRegistrar.register(web3.sha3('ether_test1'), eth.accounts[0], {from: eth.accounts[0]});

# 사용할 이름을 public resolver 등록
ens.setResolver(namehash('ether_test1.test'), publicResolver.address, {from: eth.accounts[0]});

# 이름과 사용자 account를 조회 할수 있도록 resolver 등록

publicResolver.setAddr(namehash('ether_test1.test'), eth.accounts[0], {from: eth.accounts[0]});


# 해당 이름을 조회하여 사용자 계정 확인

getAddr('ether_test1.test');

resolverContract.at(ens.resolver(namehash('ether_test1.test'))).addr(namehash('ether_test1.test'))

'blockchain > ethereum' 카테고리의 다른 글

solidity data type  (0) 2018.12.30
solidity solc 설치  (0) 2018.12.30
ethereum 인프라 활용  (0) 2018.12.27
geth 기본 명령어  (0) 2018.12.27
블럭체인 웹호출  (0) 2018.12.14

+ Recent posts