const Web3 = require("web3");
const web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/f76f49a440bf4303ab6d2c1aa21c7537"));const toAddress = "0x7a0e3AB3c9626018850c06A099981F0B1f183D95";
const privateKey = "0xA209084D071D63F598EB5C3A1B315CE8BDFED7906FF6D071CDADAB34244AAA69";
/*
web3.eth.accounts.signTransaction({
              to: toAddress,
              value: "300000000000000000",
              chainId: 3,
              gas: 21000
          }, privateKey, function (err, result) {
                        if (err) {
                                          console.error(err);
                                          return;
                                      }
                        console.log('rawTransaction ${result.rawTransaction}');
                        web3.eth.sendSignedTransaction(result.rawTransaction).on('receipt', console.log);
                    });
*/
web3.eth.getBalance("0x7a0e3AB3c9626018850c06A099981F0B1f183D95", "latest", function(err, result) {
                 console.log(result);
}); 

 

 

root@a0521f460f7b:~/npm# nodejs 1.js
You can improve web3's peformance when running Node.js versions older than 10.5.0 by installing the (deprecated) scrypt package in your project
5886845086420000000

 

'이더리움' 카테고리의 다른 글

rinkeby.io facebook으로 테스트 이더 받기  (0) 2019.10.25
erc20 token balance 조회  (0) 2019.10.24
이더스캔 크롤링 json 저장  (0) 2018.12.06
이더스캔API erc20token 트렌젝션 조회  (0) 2018.11.30
입금주소 생성  (0) 2018.11.30
블로그 이미지

iesay

,