hayesgm / seacrest

WalletConnect over the terminal or GitHub Actions
MIT License
27 stars 6 forks source link
ethereum github-actions walletconnect

Seacrest


Seacrest allows you to connect with WalletConnect 2.0 from your terminal or GitHub Action.

You start Seacrest either in a terminal or as a GitHub Action. In either case, you'll see a QR Code in your terminal after Seacrest starts [like literally, in your terminal or in the GitHub Actions logs]. Connect any WalletConnect app (e.g. MetaMask Mobile) to that QR Code. From then on out, point your apps to the Ethereum node https://localhost:8585. For standard requests, like the current block number, Seacrest proxies the request to an Ethereum node you specify. But for requests for unlocked accounts or signing transactions, Seacrest will forward the request to your WalletConnect app. Magically, you'll have an "unlocked account" available to use with Hardhat or any other Ethereum tool.

Installing

Terminal

To run Seacrest, install it through npm or yarn:

npm install -g seacrest

Next, run seacrest, specifying an Ethereum node to proxy requests to:

seacrest {ethereum_network} {wallet_connect_project_id} http://goerli.infura.io 8585

Now, you can specify http://localhost:8585 as your Ethereum node in any service. If that service calls eth_accounts, eth_sendTransaction, net_version, or personal_sign, that request will be intercepted by Seacrest and passed to WalletConnect. Otherwise, the request will be proxied the given Ethereum node.

GitHub Actions

Seacrest is also meant to be easily used in a GitHub Action. Add to your YAML file:

- name: Seacrest
  uses: hayesgm/seacrest@v1
  with:
    wallet_connect_project_id: '...'
    requested_network: 'goerli' # or 5
    ethereum_url: https://goerli.infura.io # optional, otherwise mainnet
    port: 8585 # default 8585

You will need to pull into your logs when the action is running and connect your wallet. Pull into the action log and scan the QR code. It's a little finnicky, but it should work.

Subsequently, you can simply use http://localhost:8585 as your Ethereum node. Any requests for accounts or signatures will be redirected to WalletConnect. For instance, you could deploy scripts from Hardhat using this node, with the security of WalletConnect but the ease and transparency of GitHub Actions.

Configuration

You can configure the following values from the environment:

Why?

First, for fun and profit. Moreso, there's value in interacting and deploying Ethereum contracts in plain sight. But that's hard to do since most people don't want to share private keys with GitHub Secrets, even if they are throw-aways. This gives developers the option to securely sign transactions in public.

Secondly, you could use this as an authorization flow in GitHub Actions, e.g. to unlock other secrets or anything else. It is the first "human in the loop" authorization action that I know of.

Contributing

Create a PR to contribute to Seacrest. All contributors agree to accept the license specified in this repository for all contributions to this project. See LICENSE.md.

Feel free to create Feature Requests in the issues.

Note: The author generated the Seacrest logo with DALL•E, OpenAI's text-to-image generation model. The image was further modified by the author.