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

Upgrade Canvas to v0.12.0, peer with Explorer #9650

Merged
merged 17 commits into from
Oct 30, 2024

Conversation

raykyri
Copy link
Collaborator

@raykyri raykyri commented Oct 23, 2024

This PR upgrades the Canvas version to 0.12.0, and adds a default peering configuration pointing to https://common-explorer.canvas.xyz/, which is autodeployed from https://github.com/canvasxyz/canvas/tree/main/examples/common-explorer#common-network-explorer.

  • v0.12.0 changes generic types on the Canvas<T extends ModelSchema> object, which is the main "app" abstraction for Canvas, but doesn't otherwise introduce any major new changes.
    • No commonwealth changes were required for this upgrade.
  • v0.11.0:
    • libp2p changed their API for creating private keys and peer ids (PR). Canvas adopted the new API in version 0.11.0, so we need to update references to PEER_ID to LIBP2P_PRIVATE_KEY instead. The underlying format of the PEER_ID env var has not changed.
    • The way we initialise the Canvas object has changed, we now pass libp2p-specific config fields to app.startLibp2p.
    • The constructor for SIWESigner has changed slightly, if we create a SIWESigner without a signer config value then it generates an ethers wallet and then saves it in local storage. This does not affect how Commonwealth works because we always pass in a signer config value (which would be some kind of handle to the MetaMask/WalletConnect/etc browser extension) but it meant that some of the test fixture code had to be changed to explicitly always create a new ethers wallet.

This also changes the logger inside packages/commonwealth/scripts/create-peer-id.ts to use console.log instead of the builtin logger, to avoid importing @hicommonwealth/core...

Link to Issue

Closes: #8919, #7520.

Test Plan

  • pnpm start, create a comment with an account with a live session key, and it should show up on common-explorer.canvas.xyz.

Deployment Plan

  • Delete the old PEER_ID private key inside ENV variables, and add a LIBP2P_PRIVATE_KEY generated by running ./create-peer-id.ts in packages/commonwealth/scripts, and slack @raykyri with the resulting public key (printed 12D3Koo... above the private key).

Other Considerations

  • n/a

@raykyri raykyri force-pushed the rjwebb/upgrade-canvas-to-0-11-0 branch from 560c5df to b24bc22 Compare October 23, 2024 17:39
@raykyri raykyri changed the title Upgrade Canvas to v0.12.0 Upgrade Canvas to v0.12.0, peer with Explorer Oct 23, 2024
@raykyri raykyri marked this pull request as ready for review October 23, 2024 17:50
@raykyri raykyri added 5 Few days task 3 Full day task deployment plan (PRs only) requires manual infrastructure changes on release labels Oct 23, 2024
@timolegros
Copy link
Collaborator

This also changes the logger inside packages/commonwealth/scripts/create-peer-id.ts to use console.log instead of the builtin logger, to avoid importing @hicommonwealth/core

Why? Did importing core cause issues?

Copy link
Collaborator

@timolegros timolegros left a comment

Choose a reason for hiding this comment

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

Fix lockfile

@raykyri raykyri merged commit 3421d50 into master Oct 30, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 Full day task 5 Few days task deployment plan (PRs only) requires manual infrastructure changes on release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🪣 Implement Canvas Indexer/Explorer
4 participants