1

I have used web3js by using it in the form of node(npm). But I don't know how to extract some data generated from nodes.

Does anyone know this web3js so the results can be changed to json form? Because I need this so that the data generated can be entered into the variable, so that I can then process the variable into the program.

Like let's say I use the web3-eth-accounts package as follows (use node with cmd) :

var Accounts = require('web3-eth-accounts')
var accounts = new Accounts('https://rinkeby.infura.io/')
accounts.create()

Example result from node : enter image description here

Well, for the above does anyone know to be converted into json form?

  • The question is not related to Ethereum or web3js, it is javascript coding question. – Aquila Oct 8 '18 at 22:01
0
var Accounts = require('web3-eth-accounts')
var accounts = new Accounts('https://rinkeby.infura.io/')
var account = accounts.create()

console.log(account.address, account.privateKey)
| improve this answer | |
  • Wow thank you for your info, that means a lot to me. – Raka Widhi Antoro Oct 9 '18 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.