Comments (3)
@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.
from lotion.
@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)
from lotion.
The connect()
method actually returns a few methods (getState()
and send()
) itself which you can utilise:
let { connect } = require('lotion')
async main() => {
// Create lightclient via lotion's connect() method
let lc = await connect(null, { genesis, nodes })
// Get the current state via the lightclient's getState() method
let currentState = await(lc.getState())
console.log(currentState)
// Send a transaction via the send() method
let tx = {'key': 'your_tx_object_here'}
let response = await lc.send(tx)
console.log(response)
}
main()
I hope this helps.
from lotion.
Related Issues (20)
- Malformed JSON while it's not HOT 1
- Light client unique ID?
- `lotion state <GCI>` times out
- lotion install error HOT 4
- IBC configuration?
- Block times
- UnhandledPromiseRejectionWarning (Node 8.10.0) HOT 1
- app.use((state, tx)) still returns initial state
- transactionHandler is invoked twice
- Android app for blockchain messenger
- Block info missing HOT 1
- opts.keyPath and opts.genesisPath
- Project Status HOT 2
- UnhandledPromiseRejectionWarning: Error: invalid wire type 7 at offset 88 HOT 2
- Error when launching server HOT 2
- TypeError: app.listen is not a function HOT 2
- How to run lotion with multiple peers?
- Trouble installing on m1 HOT 2
- Can there be an better explanation with the new way of doing things with axios?
- Current status
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lotion.