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.
I have very simple quesiton. Basically I'm running the example app(the counter app) on my machine and I want my friend to use another machine to connect to it.
As I can get the GCI when started the sample app and give it my friend, and my frienis using the below code in a different machine:
let { connect } = require('lotion')
const GCI = "the one that got from sample app and gave to my friend";
async function main(){
let { state, send } = await connect(GCI)
// query state, this is what would have been at http:// localhost:3000/state before
console.log(await state)
But seems it's not working, no state acquired and no new transaction sent and the client(above code) stuck.
Is that suppose to connect 2 machines by knowing their IP? or how can I use one machine to connect another machine that is running a blockchain and query its status and send new transactions to it?
Thank you very much.
The text was updated successfully, but these errors were encountered:
Looks like your friend isn't able to connect. You'll have to make sure your node is accessible from your friend's network, e.g. by moving your node to a DigitalOcean or AWS server, or by forwarding your node's RPC port.
@mappum Thanks, I verified that both machine can ping each other by using 'ping' command, so right now if I run the client it gives me:
Error: connect ECONNREFUSED 127.0.0.1:40291
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1085:14)
the port 40291 is the blockchain server's RPC port so maybe it's connected but the client still take the remote machine as 127.0.0.1 which is still not correct.
So to let client know the blockchain server's IP address do we need to do something when we initiate the blockchain? maybe like:
let app = lotion({
initialState: {
count: 0
},
host: "10.0.20.44" //server's IP address
});
Hi lotionjs team,
I have very simple quesiton. Basically I'm running the example app(the counter app) on my machine and I want my friend to use another machine to connect to it.
As I can get the GCI when started the sample app and give it my friend, and my frienis using the below code in a different machine:
let { connect } = require('lotion')
const GCI = "the one that got from sample app and gave to my friend";
async function main(){
let { state, send } = await connect(GCI)
// query state, this is what would have been at http:// localhost:3000/state before
console.log(await state)
// create tx (previously POST http://localhost:3000/txs)
console.log(await send({ foo: 'bar' }))
}
main()
But seems it's not working, no state acquired and no new transaction sent and the client(above code) stuck.
Is that suppose to connect 2 machines by knowing their IP? or how can I use one machine to connect another machine that is running a blockchain and query its status and send new transactions to it?
Thank you very much.
The text was updated successfully, but these errors were encountered: