Updated README
This commit is contained in:
51
README.md
51
README.md
@@ -2,18 +2,49 @@
|
|||||||
|
|
||||||
TypeScript library for MeshCore protocol utilities.
|
TypeScript library for MeshCore protocol utilities.
|
||||||
|
|
||||||
Quick start
|
## Packet parsing
|
||||||
|
|
||||||
1. Install dev dependencies:
|
Using the library to decode MeshCore packets:
|
||||||
|
|
||||||
```bash
|
```ts
|
||||||
npm install --save-dev typescript tsup
|
import { Packet } from '@hamradio/meshcore';
|
||||||
|
|
||||||
|
const raw = new Uint8Array(Buffer.from("050AA50E2CB0336DB67BBF78928A3BB9BF7A8B677C83B6EC0716F9DD10002A06", "hex"));
|
||||||
|
const packet = Packet.fromBytes(raw);
|
||||||
|
console.log(packet);
|
||||||
|
|
||||||
|
/*
|
||||||
|
_Packet {
|
||||||
|
header: 5,
|
||||||
|
transport: undefined,
|
||||||
|
pathLength: 10,
|
||||||
|
path: Uint8Array(10) [
|
||||||
|
165, 14, 44, 176,
|
||||||
|
51, 109, 182, 123,
|
||||||
|
191, 120
|
||||||
|
],
|
||||||
|
payload: Uint8Array(20) [
|
||||||
|
146, 138, 59, 185, 191, 122,
|
||||||
|
139, 103, 124, 131, 182, 236,
|
||||||
|
7, 22, 249, 221, 16, 0,
|
||||||
|
42, 6
|
||||||
|
],
|
||||||
|
routeType: 1,
|
||||||
|
payloadVersion: 0,
|
||||||
|
payloadType: 1,
|
||||||
|
pathHashCount: 1,
|
||||||
|
pathHashSize: 10,
|
||||||
|
pathHashBytes: 10,
|
||||||
|
pathHashes: [ 'a50e2cb0336db67bbf78' ]
|
||||||
|
}
|
||||||
|
*/
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Build the library:
|
## Identities
|
||||||
|
|
||||||
```bash
|
The package supports:
|
||||||
npm run build
|
- `Identity` for public key management.
|
||||||
```
|
- `LocalIdentity` for private key management.
|
||||||
|
- `Contact` for managing named identities.
|
||||||
3. Use the build output from the `dist/` folder or publish to npm.
|
- `Group` for managing groups.
|
||||||
|
- `KeyManager` for managing all of the above and handling decryption.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hamradio/meshcore",
|
"name": "@hamradio/meshcore",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"description": "MeshCore protocol support for Typescript",
|
"description": "MeshCore protocol support for Typescript",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"MeshCore",
|
"MeshCore",
|
||||||
|
|||||||
Reference in New Issue
Block a user