curl -X POST "http://localhost:9090/messages" \
-H "Content-Type: application/json" \
-d \
'{
"messages": [
{
"dispatched_block_number": 10000,
"message": {
"version": 3,
"nonce": 1234,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
},
{
"dispatched_block_number": 10010,
"message": {
"version": 3,
"nonce": 1235,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
}
]
}'
const response = await fetch('http://localhost:9090/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
messages: [
{
dispatched_block_number: 10000,
message: {
version: 3,
nonce: 1234,
origin: 1,
destination: 2,
sender: "0xabc...",
recipient: "0xdef...",
body: [0, 3, 0, 23, 43, 65]
}
},
{
dispatched_block_number: 10010,
message: {
version: 3,
nonce: 1235,
origin: 1,
destination: 2,
sender: "0xabc...",
recipient: "0xdef...",
body: [0, 3, 0, 23, 43, 65]
}
}
]
})
});
import requests
response = requests.post('http://localhost:9090/messages', json={
"messages": [
{
"dispatched_block_number": 10000,
"message": {
"version": 3,
"nonce": 1234,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
},
{
"dispatched_block_number": 10010,
"message": {
"version": 3,
"nonce": 1235,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
}
]
})
{
"count": 4,
"skipped": []
}
HTTP API
Insert Messages
POST
/
messages
curl -X POST "http://localhost:9090/messages" \
-H "Content-Type: application/json" \
-d \
'{
"messages": [
{
"dispatched_block_number": 10000,
"message": {
"version": 3,
"nonce": 1234,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
},
{
"dispatched_block_number": 10010,
"message": {
"version": 3,
"nonce": 1235,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
}
]
}'
const response = await fetch('http://localhost:9090/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
messages: [
{
dispatched_block_number: 10000,
message: {
version: 3,
nonce: 1234,
origin: 1,
destination: 2,
sender: "0xabc...",
recipient: "0xdef...",
body: [0, 3, 0, 23, 43, 65]
}
},
{
dispatched_block_number: 10010,
message: {
version: 3,
nonce: 1235,
origin: 1,
destination: 2,
sender: "0xabc...",
recipient: "0xdef...",
body: [0, 3, 0, 23, 43, 65]
}
}
]
})
});
import requests
response = requests.post('http://localhost:9090/messages', json={
"messages": [
{
"dispatched_block_number": 10000,
"message": {
"version": 3,
"nonce": 1234,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
},
{
"dispatched_block_number": 10010,
"message": {
"version": 3,
"nonce": 1235,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
}
]
})
{
"count": 4,
"skipped": []
}
Insert new messages into the database.
Show Request Body
Show Request Body
Show Response Body
Show Response Body
curl -X POST "http://localhost:9090/messages" \
-H "Content-Type: application/json" \
-d \
'{
"messages": [
{
"dispatched_block_number": 10000,
"message": {
"version": 3,
"nonce": 1234,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
},
{
"dispatched_block_number": 10010,
"message": {
"version": 3,
"nonce": 1235,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
}
]
}'
const response = await fetch('http://localhost:9090/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
messages: [
{
dispatched_block_number: 10000,
message: {
version: 3,
nonce: 1234,
origin: 1,
destination: 2,
sender: "0xabc...",
recipient: "0xdef...",
body: [0, 3, 0, 23, 43, 65]
}
},
{
dispatched_block_number: 10010,
message: {
version: 3,
nonce: 1235,
origin: 1,
destination: 2,
sender: "0xabc...",
recipient: "0xdef...",
body: [0, 3, 0, 23, 43, 65]
}
}
]
})
});
import requests
response = requests.post('http://localhost:9090/messages', json={
"messages": [
{
"dispatched_block_number": 10000,
"message": {
"version": 3,
"nonce": 1234,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
},
{
"dispatched_block_number": 10010,
"message": {
"version": 3,
"nonce": 1235,
"origin": 1,
"destination": 2,
"sender": "0xabc...",
"recipient": "0xdef...",
"body": [0, 3, 0, 23, 43, 65]
}
}
]
})
{
"count": 4,
"skipped": []
}
Was this page helpful?
⌘I