Skip to main content

Client API

The Client API is used by Ethereum clients (for example, Hyperledger Besu) to interact with Orion.

The port used by the Client API is defined by the clientport property in the configuration file. The default port is 8888.

Methods

createPrivacyGroup

Creates a privacy group with the specified members.

HTTP Verb

POST

Headers

  • Content-Type: application/json

Request Body

addresses : array of strings - Orion node keys to include in the privacy group

from : string - Orion node key of node creating the privacy group

name : string - Name of the privacy group

description : string - Description for the privacy group

Returns

privacy group : object - Privacy group object

curl -X POST http://127.0.0.1:8888/createPrivacyGroup \
-H 'Content-Type: application/json' \
-d '{
"addresses": [
"g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw=",
"negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk="
],
"from": "negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=",
"name": "Organisation A",
"description": "Contains members of Organisation A"
}'

deletePrivacyGroup

Deletes a privacy group.

HTTP Verb

POST

Headers

  • Content-Type: application/json

Request Body

privacyGroupId : string - ID of the privacy group to delete

from : string - Orion node key of node deleting the privacy group

Returns

privacyGroupId : string - ID of the deleted privacy group

curl -X POST http://127.0.0.1:8888/deletePrivacyGroup \
-H 'Content-Type: application/json' \
-d '{
"privacyGroupId": "C68ZfeG6wHeXb+CyfwS6NjmmaMWwRaj8ZkrPq/o+S8Q=",
"from": "negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk="
}'

findPrivacyGroup

Finds all privacy groups containing only the specified members.

HTTP Verb

POST

Headers

  • Content-Type: application/json

Request Body

addresses : array of strings - Orion node keys for which to return privacy groups

Returns

array of objects - Privacy group objects for all privacy groups containing only the specified members

curl -X POST http://127.0.0.1:8888/findPrivacyGroup \
-H 'Content-Type: application/json' \
-d '{
"addresses" : [
"g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw=",
"negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk="
]
}'

knownnodes

Returns the public key and URL of nodes discovered by Orion.

HTTP Verb

GET

Headers

None

Request Body

None

Returns

array of objects - Public key and URL of each discovered node.

curl -X GET http://127.0.0.1:8888/knownnodes

receive

Receives a payload from Orion using the payload key. The payload key is returned by the send method.

HTTP Verb

POST

Headers

  • Content-Type: application/json

Request Body

key : string - Key used to receive the payload

to : string - Orion key of the receiver

Returns

payload : string - Base64 encoded payload

curl -X POST http://127.0.0.1:8888/receive \
-H 'Content-Type: application/json' \
-d '{
"key": "wS+RMprLKIuCaHzOBfPeHmkJWUdOJ7Ji/9U3qj2jbXQ=",
"to": "YE5cJRJYTRO4XFo7yuAi/0K9DwjySGjsHB2YrFPnJXo="
}'

receive with privacy group ID

To return the privacy group ID with the payload, use the receive method with the header Content-Type: application/vnd.orion.v1+json.

curl -X POST \
http://127.0.0.1:8888/receive \
-H 'Content-Type: application/vnd.orion.v1+json' \
-d '{
"key": "dRQUqPeGy6sj9LQJUYqNlUFroBiWm/tJO+CriTce6AA=",
"to": "negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk="
}'

receiveraw

Receives a raw payload from Orion using the payload key. The payload key is returned by the sendraw method

HTTP Verb

POST

Headers

  • Content-Type: application/octet-stream
  • c11n-key: Key used to receive the payload

Request Body

None

Returns

Payload

curl -X POST \
http://127.0.0.1:8888/receiveraw \
-H 'Content-Type: application/octet-stream' \
-H 'c11n-key: +3gnwO0oHXe4kXsr3kegd9jTTqsq3Y6Hm3w26WHR/RM='

send

Sends a payload to Orion.

HTTP Verb

POST

Headers

  • Content-Type: application/json

Request Body

payload : string - Base64-encoded payload

from : string - Orion node key of sender

to : array of strings - Orion node keys to receive this payload

or

privacyGroupId : string - Privacy group to receive this payload

Returns

key : string - Key used to receive the payload

curl -X POST http://127.0.0.1:8888/send \
-H 'Content-Type: application/json' \
-d '{
"payload": "SGVsbG8sIFdvcmxkIQ==",
"from": "4xanJzyaDPcBVMUSwl/tLp+DbXzd3jF9MKk1yJuyewE=",
"to": ["YE5cJRJYTRO4XFo7yuAi/0K9DwjySGjsHB2YrFPnJXo="]
}'

sendraw

Sends a raw payload to Orion.

HTTP Verb

POST

Headers

  • Content-Type: application/octet-stream
  • c11n-from: Orion node key of the sender
  • c11n-to: List of Orion node keys to receive this payload

Request Body

payload : string - Payload

Returns

Key used to receive the payload

curl -X POST http://127.0.0.1:8888/sendraw \
-H 'Content-Type: application/octet-stream' \
-H 'c11n-from: 4xanJzyaDPcBVMUSwl/tLp+DbXzd3jF9MKk1yJuyewE=' \
-H 'c11n-to: YE5cJRJYTRO4XFo7yuAi/0K9DwjySGjsHB2YrFPnJXo=' \
-d 'Hello, World!'

upcheck

Confirms if Orion is running.

HTTP Verb

GET

Headers

None

Request Body

None

Returns

string : I'm up

curl -X GET http://127.0.0.1:8888/upcheck