These are chat archives for ethereum/tutorials

8th
May 2018
sivachethala
@sivachethala
May 08 2018 04:28
Hi, I want to build tokean sale website using ethereum.
Do we have any reference source code/website
Please share me.
sivachethala
@sivachethala
May 08 2018 04:37
Anubhav Gupta
@array-addu
May 08 2018 11:47

Can anyone confirm me if this is the right way to add a block everytime send() method is called and then read the data on that block using getTransaction() method.

const web3 = new Web3(provider);
let myContract;
abiDecoder.addABI(JSON.parse(interface));
const addTransaction = async () => {
const accounts = await web3.eth.getAccounts();
myContract = await new web3.eth.Contract(JSON.parse(interface));
myContract.options.address = 'contract_address';
let setInstance = await myContract.methods.setname('abhishek').send({from: accounts[0],gas: 1000000});
console.log('setInstance',setInstance.transactionHash);
let viewData = await web3.eth.getTransaction(setInstance.transactionHash);
console.log('viewdata: ',viewData.input);
const decodedData = abiDecoder.decodeMethod(viewData.input);
console.log('decodedData',decodedData);
}
addTransaction();