반응형
var Web3 = require("web3");
var web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:8545"));


web3.eth.personal.unlockAccount("0x05f3f9d0e28d82e5b27042fa6edf0c8f7179ad89", "1234567890", 1000).then(console.log);

web3.eth.sendTransaction({
from: "0x05f3f9d0e28d82e5b27042fa6edf0c8f7179ad89",
gas: "100000",
to: "0xe4759cc75f01ca5faeec5a9380e60aab873919eb",
value: "20000",
data: ""
}).then(console.log);



이렇게 하면 된다...


gas는 꼭 100000으로 해라...안되면 숫자를 더 올려라


위에걸로 안되면...


var Web3 = require("web3");
var web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:8545"));


var pl=web3.personal.unlockAccount("0x896bd1d7cb42d71583d5fc50bf950c59eae67000", "1234567890", 1000);

var rs=web3.eth.sendTransaction({
from: "0x896bd1d7cb42d71583d5fc50bf950c59eae67000",
gas: "100000",
to: "0xd5f5170878a35d9cee9822f62217bdae0021347b",
value: "10000",
data: ""
});

console.log(rs);


이렇게 해라...


이더를 전송하면 트랜잭션아이디를 알려준다...txid라는 것이다...


그놈을 이용해 트랜잭션을 확인할 수 있다...


var Web3 = require("web3");
var web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:8545"));

var tx=web3.eth.getTransaction('0x2c2d06c1fec126cb9184d4801a5e048abe7eae4b5bccea85bdd90a7af3f40b6b');

var jsonTx=JSON.stringify(tx);
console.log(jsonTx);


이렇게하면 된다....

반응형

+ Recent posts