3.3 내 컨트랙트를 블록체인에 배포하기
node console 에서 아래의 명령을 실행하세요!
> Web3 = require('web3')
> web3 = new Web3(new Web3.providers.HttpProvider(""http://localhost:8545""));
> abiDefinition = JSON.parse(compiledCode.contracts[':Voting'].interface)
> VotingContract = web3.eth.contract(abiDefinition)
> byteCode = compiledCode.contracts[':Voting'].bytecode
> deployedContract = VotingContract.new(['Rama','Nick','Jose'],{data: byteCode, from: web3.eth.accounts[0], gas: 4700000})
> deployedContract.address
'0x0396d2b97871144f75ba9a9c8ae12bf6c019f610' <- Your address will be different
-
자막
박민건
2020.2.21 20:58
0