gRPC-based protocol for exchanging ILP packets
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist/example
src
.gitignore
.npmignore
LICENSE
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

ilp-transport-grpc

ilp-transport-grpc module provides an asynchronous request-response framework for communicating ILP packets between clients and a server over an underlying gRPC bidirectional stream.

#Server

const server = new GrpcTransportServer({}, {
  log: createLogger('grpc-server'),
  authenticate: () => Promise.resolve({ id: 'test' })
})

// Listen on unused port
server.listen({
  host: '0.0.0.0',
  port: 5001
})

#Client

const client = await createConnection('127.0.0.1:5001');

client.on('error', (data) =>  {
    console.log(data)
})

client.on('request', (data) =>  {
    console.log(data)
})

const response = await client.request({
    protocol: 'ilp',
    contentType: FrameContentType.ApplicationOctetStream,
    payload: Buffer.from('Hello?')
  })