Closed yehia67 closed 5 years ago
How to make lite-server use "Buffer.from"
my code:
ipfs.add([Buffer.from(JSON.stringify(userJson))], function(err, res) { if (err) throw err ipfsHash = res[0].hash console.log(‘creating user on eth for’, username, title, intro, ipfsHash); User.deployed().then(function(contractInstance) { // contractInstance.createUser(web3.fromAscii(username), web3.fromAscii(title), intro, ipfsHash, {gas: 2000000, from: web3.eth.accounts[0]}).then(function(index) { contractInstance.createUser(username, ipfsHash, {gas: 200000, from: web3.eth.accounts[0]}).then(function(success) { if(success) { console.log(‘created user on ethereum!’); } else { console.log(‘error creating user on ethereum’); }
How to make lite-server use "Buffer.from"
my code: