Local network peers
curl --request POST \
--url https://api.compose.market/api/local/network/peers/upsert \
--header 'Content-Type: application/json' \
--header 'x-session-user-address: <x-session-user-address>' \
--data '
{
"userAddress": "<string>",
"chainId": 123,
"agentWallet": "<string>",
"deviceId": "<string>",
"peers": [
{}
]
}
'import requests
url = "https://api.compose.market/api/local/network/peers/upsert"
payload = {
"userAddress": "<string>",
"chainId": 123,
"agentWallet": "<string>",
"deviceId": "<string>",
"peers": [{}]
}
headers = {
"x-session-user-address": "<x-session-user-address>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-session-user-address': '<x-session-user-address>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
userAddress: '<string>',
chainId: 123,
agentWallet: '<string>',
deviceId: '<string>',
peers: [{}]
})
};
fetch('https://api.compose.market/api/local/network/peers/upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.compose.market/api/local/network/peers/upsert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userAddress' => '<string>',
'chainId' => 123,
'agentWallet' => '<string>',
'deviceId' => '<string>',
'peers' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-session-user-address: <x-session-user-address>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.compose.market/api/local/network/peers/upsert"
payload := strings.NewReader("{\n \"userAddress\": \"<string>\",\n \"chainId\": 123,\n \"agentWallet\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"peers\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-session-user-address", "<x-session-user-address>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.compose.market/api/local/network/peers/upsert")
.header("x-session-user-address", "<x-session-user-address>")
.header("Content-Type", "application/json")
.body("{\n \"userAddress\": \"<string>\",\n \"chainId\": 123,\n \"agentWallet\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"peers\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compose.market/api/local/network/peers/upsert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-session-user-address"] = '<x-session-user-address>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userAddress\": \"<string>\",\n \"chainId\": 123,\n \"agentWallet\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"peers\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyMesh
Local network peers
Publish and list local peer summaries for Manowar local networking.
POST
/
api
/
local
/
network
/
peers
/
upsert
Local network peers
curl --request POST \
--url https://api.compose.market/api/local/network/peers/upsert \
--header 'Content-Type: application/json' \
--header 'x-session-user-address: <x-session-user-address>' \
--data '
{
"userAddress": "<string>",
"chainId": 123,
"agentWallet": "<string>",
"deviceId": "<string>",
"peers": [
{}
]
}
'import requests
url = "https://api.compose.market/api/local/network/peers/upsert"
payload = {
"userAddress": "<string>",
"chainId": 123,
"agentWallet": "<string>",
"deviceId": "<string>",
"peers": [{}]
}
headers = {
"x-session-user-address": "<x-session-user-address>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-session-user-address': '<x-session-user-address>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
userAddress: '<string>',
chainId: 123,
agentWallet: '<string>',
deviceId: '<string>',
peers: [{}]
})
};
fetch('https://api.compose.market/api/local/network/peers/upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.compose.market/api/local/network/peers/upsert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userAddress' => '<string>',
'chainId' => 123,
'agentWallet' => '<string>',
'deviceId' => '<string>',
'peers' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-session-user-address: <x-session-user-address>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.compose.market/api/local/network/peers/upsert"
payload := strings.NewReader("{\n \"userAddress\": \"<string>\",\n \"chainId\": 123,\n \"agentWallet\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"peers\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-session-user-address", "<x-session-user-address>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.compose.market/api/local/network/peers/upsert")
.header("x-session-user-address", "<x-session-user-address>")
.header("Content-Type", "application/json")
.body("{\n \"userAddress\": \"<string>\",\n \"chainId\": 123,\n \"agentWallet\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"peers\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compose.market/api/local/network/peers/upsert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-session-user-address"] = '<x-session-user-address>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userAddress\": \"<string>\",\n \"chainId\": 123,\n \"agentWallet\": \"<string>\",\n \"deviceId\": \"<string>\",\n \"peers\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_bodyPeer records are short-lived. Upsert is rate limited per user and chain.
Routes
| Method | Path | Description |
|---|---|---|
POST | /api/local/network/peers/upsert | Publishes current peer summaries. |
GET | /api/local/network/peers | Lists current peers for one user and chain. |
Upsert body
string
required
Wallet address. Must match
x-session-user-address.number
Chain ID. Defaults to the active chain.
string
Optional agent wallet associated with the peers.
string
Optional local device ID.
array
required
Up to 512 peer summaries with
peerId, lastSeenAt, stale, caps, and listenMultiaddrs.List query
string
required
Wallet address. Must match
x-session-user-address.number
Chain ID. Defaults to the active chain.
string
Optional agent wallet filter.
Headers
string
required
Must match
userAddress.⌘I