-
Notifications
You must be signed in to change notification settings - Fork 91
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
Testnet RPCs under ubq.fi domain #493
Comments
This bounty will require another bounty hunter to set it up on their own cloudflare instance, and then walk me through how to set it up on our website. |
I was dabbling around with this today and made a bit of progress but hit a wall with Foundry. Tunnel set up and connected to instance and hosted on my domain but any interaction with it always returned "Connection header did not include 'upgrade'". Which I believe is coming from The error is mentioned once as far as I can see but for something I feel has no grounds here, (Foundry#2978). Once I figure a way round that, connecting and exposing it through the tunnel should be straightforward. |
I would suggest logging the output of the current request headers and compare them to functional request headers. |
I did an investigation, before any work can be done we must know which https://www.cloudflare.com/plans/#overview ubiquity is using, or going to use. For free accounts only full DNS management on Cloudflare side is available. This means that ubq.fi would have to transfer and reconfigure DNS. For paid options the following is available https://developers.cloudflare.com/dns/zone-setups/
Perhaps this is also why some features did not work for @Keyrxng . If full DNS was used on a private domain then this is another case. @pavlovcik which option would be considered here? An |
We can use another domain, we have a few. |
/start |
Tips:
|
Good news, I was able to make this running under my own domain. I had to wait 24 hours to transfer DNS servers from my domain provider (OVH) to Cloudflare, then I configured a simple Python server, then Anvil on my Cloudflare tunnel connected to a custom domain. I will now open a PR with an example solution, provide QA and describe all steps needed to configure. |
Pull request opened. QA: gitcoindev#1 (comment) (and comments below). |
InstructionsAt first, it is important to understand that the whole setup consists of three independent steps. Transferring DNS servers from current provider to CloudflareThis may take 24 hours (it took exactly 24 hours for me). Transferring requires a prerequisite: disable DNSSEC, then follow instructions and put exact server names as provided by Cloudflare: change this on your local domain provider as in the example below: Then wait up to 24 hours, until a confirmation e-mail is received in the mailbox: |
Setting up the tunnel to a custom domainThe second step is to set up a Cloudflared tunnel to the custom domain (Anvil exposed on 8545 port in our case) and create configuration files and GitHub action secret variables. Important notice: creating a tunnel means that Cloudflare will always redirect it, and if Anvil is not running, it will simply return In order to set up the tunnel from command line, one needs to install cloudflared daemon. Instructions are provided at: After the daemon is installed, and your free Cloudflared account was created before, it is needed to log in (the URL will be different for you):
then I used 'anvil' as name of the tunnel. This means that if a custom domain is used e.g.
Each tunnel has a name, and a unique ID which in my case was Creating a tunnel can be verified with a
Now, an important step. We have a named tunnel with a unique UUID, and now have to connect it to a custom domain. This can be achieved with
Now after pointing web browser to the URL provided, one should be able to see And this is very good news, as it confirms that a) tunnel was created, b) domain works correctly. |
Preparing secret variables to connect to Cloudflared tunnel via GitHub actionsThree secret variables must be created in order to connect correctly: CLOUDFLARE_TUNNEL_IDThis variable holds UUID of the tunnel name. Simply copy UUID and paste it to CLOUDFLARE_TUNNEL_ID secret. CLOUDFLARE_TUNNEL_CREDENTIALThis variable contains secret credentials in uuid json file, in base64 encoding. Use base64 tool like in the example below, just replace UUID.
Copy output of base64 command into CLOUDFLARE_TUNNEL_CREDENTIAL secret in GitHub. CLOUDFLARE_TUNNEL_CONFIGURATIONThis variable holds base64 encoded tunnel configuration file. First , create a text file with the following content , and replace uuid with the one generated:
This configuration says: take whatever is running on port 8545 (e.g. Anvil) and connect tunnel with given UUID to it. After file is created, base64 encode it:
and paste into CLOUDFLARE_TUNNEL_CONFIGURATION secret. When those steps are complete, all required secrets should be set up: |
Configuring a GitHub Action workflow to use the tunnelThe last step is to configure a GitHub Action workflow that will connect the tunnel to test RPC like in the PR #799 I also added there comments to QA, which can be removed. When the action is running, the tunnel is active and testnet RPC can be accessed with a custom domain, like in my QA gitcoindev#1 (comment) . I later replaced my domain name with domain.xyz just to show the example. QA: accessing deployed GitHub actions Anvil instance ona custom domain, mining two blocks and getting the eth_blockNumber:
This sums up the instructions. |
So we have 3 options:
As far as I understand we're going to use a separate domain. @pavlovcik You can either transfer a new domain yourself or somehow give me access on cloudflare and I'll handle it. |
i see so this is at the cloudfare level |
I think pavlovcik will still need help to set up this after all the instructions, we could either allow a partial permit and give time to pavlovcik to face all the stuff, or best to pass it to rndqnuu hands (cloudflare), setup, test, QA and mark as complete |
the instructions seems solid, altho the 24 hours to debug after setting up |
Let's mark this as completed in favor of #799 (a utility reference PR, that will be closed), but serves for the tasks purpose and this issue |
Task Assignee Reward[ CLAIM 200 WXDAI ]
If you've enjoyed your experience in the DevPool, we'd appreciate your support. Follow Ubiquity on GitHub and star this repo. Your endorsement means the world to us and helps us grow!We are excited to announce that the DevPool and UbiquiBot are now available to partners! Our ideal collaborators are globally distributed crypto-native organizations, who actively work on open source on GitHub, and excel in research & development. If you can introduce us to the repository maintainers in these types of companies, we have a special bonus in store for you! |
Task Creator Rewardpavlovcik: [ CLAIM 25.2 WXDAI ] |
If we want to set up the temp Anvil deployments under a project domain then there is some setup required with the Cloudflare account that has that domain registered: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/
This action shows the secrets needed:
https://github.com/AnimMouse/setup-cloudflared
Originally posted by @acaldas in #442 (comment)
The text was updated successfully, but these errors were encountered: