Comments (8)
hey @Elvenisboy, great questions!
If I query this information in another peer, I can’t get it, right?
correct, you'll only wanna GET /txs
to interact with a lotion server running locally.
how to let one lotion peer connect another one?
you can specify the locations of other tendermint nodes you want to connect to like this:
let app = lotion({
p2pPort: 46656,
peers: [
'localhost:46657',
'12.22.11.33:46657',
'<ip>:<p2p-port>',
'<other-ip>:<other-p2p-port>'
]
// ... plus your other app options here ...
})
also consider whether a light client might do what you need in this section of the readme!
thanks @Elvenisboy, holla if anything else is confusing.
from lotion.
Aha, thanks for you answer @keppel😁. This is a sad story if I can get txs only in local. In a Blockchain app , we can’t avoid querying txs in database. Such as query somebody’s account balance or develop a Blockchain explorer. So if I wanna to get a complete data, what should I do? 😀😀
from lotion.
you can run a full node locally, connect it to a peer, then querying /txs
should give you the same output on either node!
Such as query somebody’s account balance
you should probably just keep account balances in your state
object, and query /state
to figure out someone's balance! it should be pretty rare that you need to directly query /txs
, it's usually just the current state of your blockchain that you'll care about for most apps.
from lotion.
@keppel OK~ Thank you for your help😋
from lotion.
Hey~keppel @keppel I found a interesting thing. when i run couter app, and add a tx in it like this:
curl http://localhost:3000/txs -d '{"name":"b"}'
then, use this url in firefox:
http://localhost:3000/tendermint/abci_query?data="name"
it will give me a message in bash:
FATAL ERROR STACK: RangeError: not enough data for decode
at Object.decode (/home/elven/Work/test-lotion/node_modules/varstruct/lib/varbuffer.js:28:41)
at Object.decode (/home/elven/Work/test-lotion/node_modules/varstruct/lib/varstring.js:19:31)
at /home/elven/Work/test-lotion/node_modules/varstruct/lib/object.js:36:36
at Object.exports.size (/home/elven/Work/test-lotion/node_modules/varstruct/lib/util.js:6:49)
at Object.decode (/home/elven/Work/test-lotion/node_modules/varstruct/lib/object.js:35:27)
at exports.decode.queryBuffer (/home/elven/Work/test-lotion/node_modules/lotion/lib/query-encoding.js:9:29)
at AbciApp.abciApp.query (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci-app.js:139:17)
at Connection.msgCb (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci/server.js:70:34)
at Connection.appendData (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci/connection.js:38:10)
at Socket.<anonymous> (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci/connection.js:15:10)
FATAL ERROR: RangeError: not enough data for decode
at Object.decode (/home/elven/Work/test-lotion/node_modules/varstruct/lib/varbuffer.js:28:41)
at Object.decode (/home/elven/Work/test-lotion/node_modules/varstruct/lib/varstring.js:19:31)
at /home/elven/Work/test-lotion/node_modules/varstruct/lib/object.js:36:36
at Object.exports.size (/home/elven/Work/test-lotion/node_modules/varstruct/lib/util.js:6:49)
at Object.decode (/home/elven/Work/test-lotion/node_modules/varstruct/lib/object.js:35:27)
at exports.decode.queryBuffer (/home/elven/Work/test-lotion/node_modules/lotion/lib/query-encoding.js:9:29)
at AbciApp.abciApp.query (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci-app.js:139:17)
at Connection.msgCb (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci/server.js:70:34)
at Connection.appendData (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci/connection.js:38:10)
at Socket.<anonymous> (/home/elven/Work/test-lotion/node_modules/lotion/lib/abci/connection.js:15:10)
emmmm, and I found that I can't add a new tx in blockchain, so sad 😢
This may be a bug for tendermint 😕
from lotion.
not a bug in tendermint, just related to the way I handle abci queries in the abci server that lotion manages!
for now, I'd pretend /tendermint
doesn't exist -- you should be able to build an app on just /txs
and /state
.
if you wanna describe what you'd like to do, I'd be happy to explain how exactly you might go about building it w/ lotion!
thanks for your questions btw -- I'll try to clarify the things you ask about in the readme. :)
from lotion.
Thanks again~ I wanna develop a ACG community with tendermint and lotion~ Few days ago, I found lotion, and it is friendly than cosmos-sdk(I think) 😄 Can I join lotion slack group? @keppel
from lotion.
awesome! you absolutely may jump in the slack. :)
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.