MESC is the Multiple Endpoint Shared Configuration Standard
Project description
Python MESC Implementation
This is a reference implementation of the Python MESC Standard
It has no external dependencies.
Installation
From PyPI
pip install mesc
From Source
git clone https://github/paradigmxyz/mesc
cd mesc
pip install ./
Example Usage
import mesc
# get the default endpoint
endpoint = mesc.get_default_endpoint()
# get the default endpoint of a network
endpoint = mesc.get_endpoint_by_network(5)
# get the default endpoint for a particular tool
endpoint = mesc.get_default_endpoint(profile='xyz_tool')
# get the default endpoint of a network for a particular tool
endpoint = mesc.get_endpoint_by_network(5, profile='xyz_tool')
# get an endpoint by name
endpoint = mesc.get_endpoint_by_name('local_goerli')
# parse a user-provided string into a matching endpoint
# (first try 1. endpoint name, then 2. chain id, then 3. network name)
endpoint = mesc.get_endpoint_by_query(user_str, profile='xyz_tool')
# find all endpoints matching given criteria
endpoints = mesc.find_endpoints(chain_id=5)
Reference
from typing import Any, MutableMapping, TypedDict, Literal, Sequence
class RpcConfig(TypedDict):
mesc_version: str
default_endpoint: str | None
endpoints: MutableMapping[str, Endpoint]
network_defaults: MutableMapping[str, str]
network_names: MutableMapping[str, str]
profiles: MutableMapping[str, Profile]
global_metadata: MutableMapping[str, Any]
class Endpoint(TypedDict):
name: str
url: str
chain_id: str | None
endpoint_metadata: MutableMapping[str, Any]
class Profile(TypedDict):
name: str
default_endpoint: str | None
network_defaults: MutableMapping[str, str]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mesc-0.1.1.tar.gz
(5.4 kB
view details)
Built Distribution
mesc-0.1.1-py3-none-any.whl
(7.1 kB
view details)
File details
Details for the file mesc-0.1.1.tar.gz
.
File metadata
- Download URL: mesc-0.1.1.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.30.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 390672ffdc3d51f36703474b937a0bd6ee347798ba5ddcd3e616d0451de185a8 |
|
MD5 | e20aeb261e31da46a136bc39942dc043 |
|
BLAKE2b-256 | faba3ccc817354e51495da61da08a5a9860560889f08ed81c87089ff93833510 |
File details
Details for the file mesc-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: mesc-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.30.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 329c0b59515ee78dde79df0a1f37a425e5cb628c0a443b5ec8f010e88dfd39af |
|
MD5 | 7cd3e64e9b2e9304912d226a061fd742 |
|
BLAKE2b-256 | 804c26bbe9b65ceef82a7234e21593db79304d550b8ed35a1e746e96d1c9832d |