JustSaying
This is a message type, which doesn't require response back.
Example:
1
const network = require('ocore/network.js');
2
const eventBus = require('ocore/event_bus.js');
3
const ws = network.getInboundDeviceWebSocket(device_address);
4
5
// function parameters: websocket, subject, body
6
network.sendJustsaying(ws, 'custom', 'some data');
7
8
eventBus.on('custom_justsaying', function(ws, content) {
9
console.log(content);
10
};
Copied!
Following is a list of justsaying type JSON messages that are sent over the network:

Send version information

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'version',
5
body: {
6
protocol_version: protocol_version,
7
alt: alt,
8
library: name,
9
library_version: version,
10
program: program,
11
program_version: program_version
12
}
13
}
14
}
Copied!

Send free joints

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'free_joints_end',
5
body: null
6
}
7
}
Copied!

Send a private transaction

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'private_payment',
5
body: privateElement
6
}
7
}
Copied!

Share your node WebSocket URL to accept incoming connections

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'my_url',
5
body: my_url
6
}
7
}
Copied!

Ask to verify your WebSocket URL

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'want_echo',
5
body: random_echo_string
6
}
7
}
Copied!

Verify your WebSocket URL with echo message

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'your_echo',
5
body: echo_string
6
}
7
}
Copied!

Log in to Hub

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/login',
5
body: {
6
challenge: challenge,
7
pubkey: pubkey,
8
signature: signature
9
}
10
}
11
}
Copied!

Get new messages

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/refresh',
5
body: null
6
}
7
}
Copied!

Remove handled message

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/delete',
5
body: message_hash
6
}
7
}
Copied!

Send pairing message

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/challenge',
5
body: challenge
6
}
7
}
Copied!

Send message to device

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/message',
5
body: {
6
message_hash: message_hash,
7
message: message
8
}
9
}
10
}
Copied!

Ask more messages

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/message_box_status',
5
body: 'has_more'
6
}
7
}
Copied!

Light wallet transaction update

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'light/have_updates',
5
body: null
6
}
7
}
Copied!

Light wallet sequence became bad

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'light/sequence_became_bad',
5
body: arrUniqueUnits
6
}
7
}
Copied!

Add light wallet to monitor address

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'light/new_address_to_watch',
5
body: address
6
}
7
}
Copied!

Send bug report

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'bugreport',
5
body: {
6
message: message,
7
exception: exception
8
}
9
}
10
}
Copied!

Push project number (only accepted from hub)

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'hub/push_project_number',
5
body: {
6
projectNumber: projectNumber
7
}
8
}
9
}
Copied!

New version is available (only accepted from hub)

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'new_version',
5
body: {
6
version: version
7
}
8
}
9
}
Copied!

Exchange rates (only accepted from hub)

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'exchange_rates',
5
body: exchangeRates
6
}
7
}
Copied!

Ask to update (only accepted from hub)

1
{
2
type: 'justsaying',
3
content: {
4
subject: 'upgrade_required',
5
body: null
6
}
7
}
Copied!

Custom JustSaying

You can add your own communication protocol on top of the Obyte one. See event there.
1
{
2
type: 'justsaying',
3
content: {
4
tag: tag,
5
subject: 'custom',
6
body: body
7
}
8
}
Copied!
Last modified 11mo ago