Skip to main content

Simple Python client library for https://devnull.cn/meshing

Project description

meshing-sdk-python

Build your meshing network in seconds.

## Prerequisites: 
# 1, At least 1 instance with public ip allows UDP inbound. By default, it is udp/7070.
# 2, Permission to update your routing tables in your VPC.

# 1st, Run following in every instance:
python3 -c 'import meshing; meshing.checkin()'

# 2nd, Make sure above checkin() completed in ALL regions, then connect():
python3 -c 'import meshing; meshing.connect()'

# 3rd, check your interface, and you can ping each other by now.
ifconfig mesh0

# 4th, if you need connecting the subnets behind, update routes in VPC or home router.
# This parts vary depending your specific requirements.

# 5th, if your need update the default local cidr in routing:
# by default your_local_ipaddr_by_/23 is used.
python3 -c 'import meshing; meshing.checkin(cidr="1.2.3.0/24")' # or
python3 -c 'import meshing; meshing.checkin(cidr="1.2.3.0/24, 2.3.4.0/24")' # one-string-by-comma
python3 -c 'import meshing; meshing.connect()' # connect() again in all regions.

Demo - Connecting 4 regions/networks

---------------------!!! DEMO WARNING !!!---------------------
You are using a shared account thus your network may be connected with others.
Please activate your individual account to build your own secure network:

python3 -c "$(wget -q -O- https://files.devnull.cn/register | base64 -d)"

1 - Checkin from ALL nodes (Ubuntu/22.04)

# Beijing
root@ap-beijing-1:~#  pip3 install meshing
root@ap-beijing-1:~#  python3 -c 'import meshing; meshing.checkin()'
# Shanghai
root@ap-shanghai-1:~#  pip3 install meshing
root@ap-shanghai-1:~#  python3 -c 'import meshing; meshing.checkin()'
# Guangzhou
root@ap-guangzhou-1:~#  pip3 install meshing
root@ap-guangzhou-1:~#  python3 -c 'import meshing; meshing.checkin()'
# Chongqing
root@ap-chongqing-1:~#  pip3 install meshing
root@ap-chongqing-1:~#  python3 -c 'import meshing; meshing.checkin()'

2 - Building the meshing network

root@ap-beijing-1:~# python3 -c 'import meshing; meshing.connect()'
root@ap-shanghai-1:~# python3 -c 'import meshing; meshing.connect()'
root@ap-guangzhou-1:~# python3 -c 'import meshing; meshing.connect()'
root@ap-chongqing-1:~# python3 -c 'import meshing; meshing.connect()'

Waiting few seconds, then run ifconfig to check your interface:

ifconfig mesh0
# trying to ping your peers' ipaddr:
for n in {1..4}; do ping -c 3 10.249.249.$n; done

# show your routes via mesh interface, shanghai as example:
route -n | grep mesh0
root@ap-shanghai-1:~# route -n | grep mesh0
10.101.0.0      0.0.0.0         255.255.254.0   U     0      0        0 mesh0
10.103.0.0      0.0.0.0         255.255.254.0   U     0      0        0 mesh0
10.104.0.0      0.0.0.0         255.255.254.0   U     0      0        0 mesh0
10.249.249.1    0.0.0.0         255.255.255.255 UH    0      0        0 mesh0
10.249.249.3    0.0.0.0         255.255.255.255 UH    0      0        0 mesh0
10.249.249.4    0.0.0.0         255.255.255.255 UH    0      0        0 mesh0
root@ap-shanghai-1:~# 

# You can now configure the routing based on your own specification. Good luck.
# Contact: xizhendu/_@@@_/gmail.com

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

meshing-2.0.8.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meshing-2.0.8-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file meshing-2.0.8.tar.gz.

File metadata

  • Download URL: meshing-2.0.8.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for meshing-2.0.8.tar.gz
Algorithm Hash digest
SHA256 63ac22d514c47c3008fdb67566a80ae9b96ee29f04c38d528cb2d4d84a14a000
MD5 4443bec0300949d7df37b7e42a11c504
BLAKE2b-256 b21d72df22e3d88cbf68b2e05ccfcb4e54080f7c1ac582b18b905f881cf69c96

See more details on using hashes here.

File details

Details for the file meshing-2.0.8-py3-none-any.whl.

File metadata

  • Download URL: meshing-2.0.8-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for meshing-2.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b88b32c8806212bc52c8c286c36605406a082277a9f59d28d5b2cd1c19f03e6c
MD5 d0d6bb905374393771212f22790d977d
BLAKE2b-256 57e9341bfbc399d6429058cd615d7b37a8f8b9973c35163b12efcf476d03b9c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page