Ethereum Light client with React – Ko – Medium

Ethereum Light client with React  #react #ethereum #reactjs

  • { ssl_fc }frontend wwws mode http bind :443 ssl crt /etc/haproxy/certs/You Cert.pem timeout client 1h tcp-request inspect-delay 500ms tcp-request content accept if HTTP default_backend privatenetwork_backend acl is_privatenetwork hdr_end(host) -i Your domain use_backend privatenetwork_backend if is_privatenetworkbackend privatenetwork_backend mode http option forwardfor option http-server-close option forceclose no option httpclose balance roundrobin option…
  • web3 is official Javascript library for ethereum.npm install –save eth-lightwalletnpm install –save hooked-web3-providernpm install –save web3# Or you may do just npm installA bit of hackIn your Javascript file,// step 1: import web3, eth-lightwallet, and hooked-web3-providerimport Web3 from ‘web3’import lightwallet from ‘eth-lightwallet’import HookedWeb3Provider from ‘hooked-web3-provider’// step 2: you may need to…
  • It’s a bit troublesome though because every time I add new module, I need to do “npm install” at eth-lightwallet directory.Now you are ready to create UIFirst step is creating keystore or wallet with keystore.
  • # I pick the name wallet because in the original document, the term keystore is used both medhod name and generated wallet with keystore and bit confusing.let wallet# get pwDerivedKey password, (err, pwDerivedKey) = { if (err){ console.log(“err 1:”, err) } # goto step.2Step 2 is generate address.
  • # step.2: add new 3 connect to our node (rpc server) with hooked-web3-provider# step.3: prepare providervar web3Provider = new HookedWeb3Provider({ host: “https://your rpc server”, transaction_signer: wallet});const web3 = new Web3(web3Provider);Here you need hooked-web3-provider.

Light client is an ethereum client which keeps only keys. You can check accurate definition here. Traditionally in blockchain world, everyone keep same databases. That’s why we can trust entire…
Continue reading “Ethereum Light client with React – Ko – Medium”