blockchain/ethereum

ethereum 인프라 활용

세모데 2018. 12. 27. 19:14

아래 사이트를 통해서 이더리움 인프라를 무료로 사용


1. 가입 

https://infura.io/register


2. 프로젝트 생성후 해당 api를 사용


사용 가능한 이더리움 네트웍

Main Ethereum network: https://mainnet.infura.io/<api-key>

Test Ethereum network (Ropsten): https://ropsten.infura.io/<api-key>

Test Ethereum network (Rinkeby): https://rinkeby.infura.io/<api-key>

Test Ethereum network (INFURAnet): https://infuranet.infura.io/<api-key>



3. api call를 통한 결과 확인


curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber", "params": []}' "https://mainnet.infura.io/v3/<your_api_key>"



web3 = new Web3(new Web3.providers.HttpProvider ("https://mainnet.infura.io/<your_api_key>"));