Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 1.44 KB

README.md

File metadata and controls

69 lines (45 loc) · 1.44 KB

LTO github readme

Relay

Build Status

Communication service for the LTO Network private layer. Relays encrypted messages between accounts.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Development

While developing and testing you can choose to run specific services on docker while you make updates to the main relay app.

docker compose up redis rabbitmq

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

# test all
$ npm run test:all

Client usage

import LTO from '@ltonetwork/lto';
import { Relay, Message } from '@ltonetwork/lto/messages';

const lto = new LTO('T');
lto.relay = new Relay('http://localhost:3000'); // Connect to your local relay service

const account = lto.account({ seed: 'My seed phrase' });

const message = new Message('hello').to('3MsAuZ59xHHa5vmoPG45fBGC7PxLCYQZnbM').signWith(account);

await lto.anchor(account, message.hash);
await lto.relay.send(message);

See documentation for more information.