Skip to content

Commit

Permalink
Add initial support for connecting via libp2p (#238)
Browse files Browse the repository at this point in the history
* added hivemind.P2P that wraps go-libp2p
* moved pythonic libp2p daemon bindings to hivemind.p2p
* implemented add_unary/stream_handler API for p2p communication
* added configuration options for NAT traversal and circuit relays
* added functionality tests for hivemind.P2P

Co-authored-by: Maxim Kashirin <[email protected]>
Co-authored-by: Denis Mazur <[email protected]>
Co-authored-by: Ilya Kobelev <[email protected]>
Co-authored-by: Alexey Bukhtiyarov <[email protected]>
Co-authored-by: Alexander Borzunov <[email protected]>
Co-authored-by: Max Ryabinin <[email protected]>
Co-authored-by: Michael Diskin <[email protected]>
  • Loading branch information
7 people authored Jun 1, 2021
1 parent 020c068 commit aea7a38
Show file tree
Hide file tree
Showing 16 changed files with 2,356 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: 2.1

parameters:
go-version:
type: string
default: 1.16.2

jobs:
build-and-test-py37:
docker:
Expand All @@ -9,6 +14,11 @@ jobs:
- restore_cache:
keys:
- py37-v1-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
- v1-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
- run: |
wget https://golang.org/dl/go<< pipeline.parameters.go-version >>.linux-amd64.tar.gz -O go.tar.gz
tar -C ~/ -xzf go.tar.gz
echo "export PATH=~/go/bin:$PATH" >> $BASH_ENV
- run: pip install -r requirements.txt
- run: pip install -r requirements-dev.txt
- save_cache:
Expand All @@ -29,6 +39,10 @@ jobs:
- restore_cache:
keys:
- py38-v1-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
- run: |
wget https://golang.org/dl/go<< pipeline.parameters.go-version >>.linux-amd64.tar.gz -O go.tar.gz
tar -C ~/ -xzf go.tar.gz
echo "export PATH=~/go/bin:$PATH" >> $BASH_ENV
- run: pip install -r requirements.txt
- run: pip install -r requirements-dev.txt
- save_cache:
Expand All @@ -49,6 +63,10 @@ jobs:
- restore_cache:
keys:
- py39-v1-{{ checksum "requirements.txt" }}-{{ checksum "requirements-dev.txt" }}
- run: |
wget https://golang.org/dl/go<< pipeline.parameters.go-version >>.linux-amd64.tar.gz -O go.tar.gz
tar -C ~/ -xzf go.tar.gz
echo "export PATH=~/go/bin:$PATH" >> $BASH_ENV
- run: pip install -r requirements.txt
- run: pip install -r requirements-dev.txt
- save_cache:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ debian/files

# protobuf stuff
hivemind/proto/*_pb2*

# libp2p-daemon binary
hivemind/hivemind_cli/p2pd
1 change: 1 addition & 0 deletions hivemind/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from hivemind.client import *
from hivemind.dht import *
from hivemind.p2p import *
from hivemind.server import *
from hivemind.utils import *
from hivemind.optim import *
Expand Down
1 change: 1 addition & 0 deletions hivemind/p2p/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from hivemind.p2p.p2p_daemon import P2P
Loading

0 comments on commit aea7a38

Please sign in to comment.