Skip to content
darius1702 edited this page Apr 12, 2021 · 3 revisions

Faxcoin Api

Registering a messenger

Register a new messenger on a running node

POST to /registerMessenger

{
// ...
"address":"[MessengerKey]", // the messenger's public key
// ...
}

Registering a neighbour

Register a new neigbour for a node

POST to /registerNeighbour (Only required for initial registration)

{
// ...
"address":"[NeighbourAddress]", // [ip:port] of the node to register as a neighbour
// ...
}

Sending a message

Send a message to a recipient on the same node

POST to /sendMessage

{
// ...
"content":"[content]", // the message in string form
"sender":"[SenderKey]", // the sender's public key
"receiver":"[ReceiverKey]", // the receiver's public key
"signing":"[signing]", // content signed with sender's private key
// ...
}

Messages to nonexistent receivers

If the current node gets sent a message destined for a receiver not registered on this node, pass it on to neighbouring nodes

POST to /receiveMessage

{
// ...
"content":"[content]", // the message in string form
"sender":"[SenderKey]", // the sender's public key
"receiver":"[ReceiverKey]", // the receiver's public key
"signing":"[signing]", // content signed with sender's private key
// ...
}

TODO

  • /getMessageQueue
  • /getNeighbours