Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rust): automated deployment to fly.io #91

Merged
merged 9 commits into from
Oct 4, 2023

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Sep 24, 2023

I'd like to deploy an instance of the Rust peer to a fly.io worker everytime we merge to master. I tested this and it does work although unfortunately only for IPv4. It is a start though and perhaps fly.io will at some point support UDP + IPv6. See https://fly.io/docs/app-guides/udp-and-tcp/#udp-wont-work-over-ipv6 for details.

Currently, this is running on the free-tier and thus does not incur any costs.

@vercel
Copy link

vercel bot commented Sep 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
universal-connectivity ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2023 1:31am

rust-peer/src/main.rs Outdated Show resolved Hide resolved
@thomaseizinger
Copy link
Contributor Author

This is ready from my PoV. In the current state, the rust-peer is a general bootnode and not directly tied to any of our deployments. It does have a default to connect to our deployment but users can override that.

In my opinion, this is a nice middlegroup between having this work out of the box but also being general enough to teach others how to bootstrap their own network.

cmd = ["/bin/sh", "-c", "set -ex; LISTEN_ADDRESS=$(getent hosts fly-global-services | cut -d' ' -f1) && rust-libp2p-webrtc-peer"]

[env]
EXTERNAL_ADDRESS="149.248.215.31" # TODO: Remove this in favor of an AutoNAT setup.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would AutoNAT even work when deployed to Fly.io? In my experience running Kubo on fly.io, their overlay network messes with AutoNAT and results in the wrong IP, but it's been a while since I actually tried it and I didn't dive too deep.

#

app = "universal-connectivity-rust-peer"
primary_region = "syd"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thoughts on moving this to Europe/US, where most users will likely be connecting from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to, this is just the default 😅

Copy link
Collaborator

@2color 2color left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I also created a token and added it to the repo (available in GH Actions)

@2color 2color merged commit 2e80cf5 into libp2p:main Oct 4, 2023
3 checks passed
@2color
Copy link
Collaborator

2color commented Oct 4, 2023

The node is deployed, but I'm unable to connect to it from the browser.

Here's the latest deployed multiaddr:

/ip4/149.248.215.31/udp/9090/webrtc-direct/certhash/uEiCQZmCs9WKvHTfUdx3ZwOEU8-Fxe2R_LfCkOY0HKLva5Q/p2p/12D3KooWMySXdno1LFG71NcfQh6dJYx4CHe45L7wnHETWR2NntuS

I get the following error
Screenshot 2023-10-04 at 5 39 32 PM

@thomaseizinger
Copy link
Contributor Author

thomaseizinger commented Oct 5, 2023

Weird! It does work locally but for some reason, can't connect to the deployed one on fly.io. cc @libp2p/js-libp2p-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants