hoprnet / hopr-core

Main repository of HOPR - this is all you need to run a node on the HOPR network!
https://hoprnet.org
GNU General Public License v3.0
14 stars 5 forks source link

Create web application able to talk to web server #220

Closed nionis closed 4 years ago

nionis commented 4 years ago
0xjjpa commented 4 years ago

@nionis Do you think it might make sense to already put together an sdk for the web server as to quickly allow web clients to talk to it? I think we already have the protos so it should be something even simpler that already includes them. Thoughts?

nionis commented 4 years ago

@jjperezaguinaga Yeah, we can for sure simplify everything with an sdk, it's something good to have that will make the entry to HOPR easier.

brainstorming:

import HoprSDK from "@hoprnet/hopr-web-sdk"

const sdk = new HoprSDK("http://127.0.0.1:8080", {
  credentials: {}
})

// retain service name
const hoprAddress = await sdk.address.getHoprAddress()
const stream = await sdk.listen.listen()

// OR

// flatten
const hoprAddress = await sdk.getHoprAddress()
const stream = await sdk.listen()

await sdk.disconnect()
nionis commented 4 years ago

I am working on a bare bones chat web app similar to telegram, currently adding support of https://github.com/hoprnet/hopr-chat/pull/15

nionis commented 4 years ago

Let's close this and continue the work on a different PR, mainly improve the UI a bit.

Closed by https://github.com/hoprnet/hopr-webapp-demo/pull/1