You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.
@keppel What are these function. I get these when i do this.
var connect = require('lotion')
let GCI = '91d61db1dce394931297b59d584eb723b8009c40d72bb8ec8aeccf4a9ba008b1'
async function send(){
return (await connect(GCI))
}
send().then(function(state){
var txs = async function(){
let result = await send ({ nonce: 0 }).then(function(data){
console.log(data);
})
}();
})
So I can access blockchain
tendermint rpc (this actually works)
GCI (I can access through gci but not familiar on how to call the function to txs on blockchain, readme is not updated on this)
The connect() method actually returns a few methods (getState() and send()) itself which you can utilise:
let{ connect }=require('lotion')asyncmain()=>{// Create lightclient via lotion's connect() methodletlc=awaitconnect(null,{ genesis, nodes })// Get the current state via the lightclient's getState() methodletcurrentState=await(lc.getState())console.log(currentState)// Send a transaction via the send() methodlettx={'key': 'your_tx_object_here'}letresponse=awaitlc.send(tx)console.log(response)}main()
@ameeuw I am getting this error
(node:40737) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Data must be a string or a buffer
(node:40737) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
No description provided.
The text was updated successfully, but these errors were encountered: