This client allows all node-runners to take advantage of relay traffic in locations around the world without having a full Pocket node at these locations.
This allows to receive relays in name of a Servicer in a different geolocation, serve it with the minimum validation and later notify the Servicer node. At the end of the session process the Servicer node will post a single claim transaction for all the relays.
To achieve this you need to deploy your Servicer Node and your Mesh Node behind a proxy like you are currently doing to set up your SSL. Also, you need to set both of them behind a Global DNS provider. The Global DNS will provide the IP address of the closest Servicer OR Mesh node, based on the request location.
(we are expecting your feedback on this!)
This guide assume you already have a Servicer properly setup and running. If not, please refer to our docs to understand how
{
"Value": "<SOME VALUE HERE>",
"Issued": "2022-09-29T00:00:00.000000000-00:00"
}
config.json
mesh_node option as true into the section pocket_configgenerate_token_on_start option to false into the section pocket_config/v1 and /v1/client, please add:
/v1/private/mesh/relay - allow mesh node to notify about relays done/v1/health - return node status: version, height, starting, catching_upconfig.json file inside the --datadir directory{
"data_dir": "/home/app/.pocket/mesh",
"rpc_port": "8081", // mesh node listening port
"chains_name": "chains/chains.json", // chains for mesh node. This should be a filename path relative to --datadir
"rpc_timeout": 30000, // chains rpc timeout
"log_level": "*:info", // log level, you can try with *:error or even *:debug (this print a lot)
"user_agent": "mesh-node", // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
"auth_token_file": "key/auth.json", // authtoken for mesh private endpoints. This should be a filename path relative to --datadir
"pocket_prometheus_port": "8083",
"prometheus_max_open_files": 3,
"relay_cache_file": "data/relays.pkt",
"session_cache_file": "data/session.pkt",
// Worker options match with: https://github.com/alitto/pond#resizing-strategies
// These are used for the relay report queue
"worker_strategy": "balanced", // Kind of worker strategy, could be: balanced | eager | lazy
"max_workers": 20,
"max_workers_capacity": 100,
"workers_idle_timeout": 1000,
"servicer_private_key_file": "key/key.json", // servicer private key to sign proof message on relay response. This should be a filename path relative to --datadir
"servicer_url": "http://localhost:8081", // servicer url/ip where mesh node can reach the servicer node to check health, proxy requests and notify relays
"servicer_rpc_timeout": 30000, // servicer rpc timeout
"servicer_auth_token_file": "key/auth.json", // authtoken used to call servicer. This should be a filename path relative to --datadir
// Servicer relay notification has a retry mechanism, refer to: https://github.com/hashicorp/go-retryablehttp
"servicer_retry_max_times": 10,
"servicer_retry_wait_min": 10,
"servicer_retry_wait_max": 180000
}
config.json:{
"priv_key": ""
}
config.json for auth_token_file and servicer_auth_token_file:{
"Value": "<SOME VALUE HERE>",
"Issued": "2022-09-29T00:00:00.000000000-00:00"
}
config.json
pocket start-mesh --datadir </your/path>You can test the Mesh node as any other kind of node. The Mesh node support the --simulateRelay parameter as Servicer does, so you can use it.
Also, you can use LocalNet Repository to deploy a local network and test all this together locally.
Content type
Image
Digest
sha256:1e800d60e…
Size
47.1 MB
Last updated
over 1 year ago
docker pull poktscan/pocket-core