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: Adds support for AtomOne Gov CosmosSDK module #10180

Merged
merged 11 commits into from
Dec 12, 2024

Conversation

clockworkgr
Copy link
Contributor

@clockworkgr clockworkgr commented Dec 9, 2024

This PR adds support for viewing and interacting with proposals on the AtomOne chain by implementing support for the AtomOne version of the Cosmos SDK gov module

Followed the same principles/flow as #9097

Assumes the AtomOne community has Cosmos Governance version v1atomone

Deployment Plan

(Added by @timolegros)
Execute the following in production after deployment:

INSERT INTO "ChainNodes" (url, alt_wallet_url, balance_type, name, bech32, created_at, updated_at, cosmos_chain_id,
                          cosmos_gov_version, slip44)
VALUES ('https://rpc.cosmos.directory/atomone', 'https://rpc.cosmos.directory/atomone', 'cosmos', 'AtomOne', 'atone',
        CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'atomone', 'v1atomone', 118)
RETURNING id;

UPDATE "Communities"
SET type          = 'chain',
    base          = 'cosmos',
    network       = 'atomone-1',
    chain_node_id = ?
WHERE id = 'govgen';

@timolegros
Copy link
Collaborator

Create a copy PR in the main repo just to run CI. Unit + Integration + Devnet tests are all fine. Please just fix the type errors on the client (see failing jobs) then this can go in.

@timolegros
Copy link
Collaborator

INSERT INTO "ChainNodes" (url, alt_wallet_url, balance_type, name, bech32, created_at, updated_at, cosmos_chain_id, cosmos_gov_version, slip44)
VALUES ('https://rpc.cosmos.directory/atomone', 'https://rpc.cosmos.directory/atomone', 'cosmos', 'AtomOne', 'atone', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'atomone', 'v1atomone', 118)
RETURNING id;

UPDATE "Communities"
SET type          = 'chain',
    base          = 'cosmos',
    network       = 'atomone-1',
    chain_node_id = ?
WHERE id = 'govgen';

@timolegros
Copy link
Collaborator

I come across this issue when I start the local server with pnpm start:

✘ [ERROR] Could not resolve "@cosmology/lcd"

    ../../node_modules/.pnpm/@[email protected]/node_modules/@atomone/atomone-types-long/atomone/lcd.js:28:22:
      28 │ const lcd_1 = require("@cosmology/lcd");
         ╵                       ~~~~~~~~~~~~~~~~

  You can mark the path "@cosmology/lcd" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.


 ERROR  4:16:35 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
../../node_modules/.pnpm/@[email protected]/node_modules/@atomone/atomone-types-long/atomone/lcd.js:28:22: ERROR: Could not resolve "@cosmology/lcd"
    at failureErrorWithLog (/home/timolegros/Projects/commonwealth/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1472:15)
    at /home/timolegros/Projects/commonwealth/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:945:25
    at /home/timolegros/Projects/commonwealth/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1353:9
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

@kurtisassad any ideas?

@clockworkgr
Copy link
Contributor Author

I come across this issue when I start the local server with pnpm start:

✘ [ERROR] Could not resolve "@cosmology/lcd"

    ../../node_modules/.pnpm/@[email protected]/node_modules/@atomone/atomone-types-long/atomone/lcd.js:28:22:
      28 │ const lcd_1 = require("@cosmology/lcd");
         ╵                       ~~~~~~~~~~~~~~~~

  You can mark the path "@cosmology/lcd" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.


 ERROR  4:16:35 PM [vite] error while updating dependencies:
Error: Build failed with 1 error:
../../node_modules/.pnpm/@[email protected]/node_modules/@atomone/atomone-types-long/atomone/lcd.js:28:22: ERROR: Could not resolve "@cosmology/lcd"
    at failureErrorWithLog (/home/timolegros/Projects/commonwealth/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1472:15)
    at /home/timolegros/Projects/commonwealth/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:945:25
    at /home/timolegros/Projects/commonwealth/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1353:9
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

@kurtisassad any ideas?

I think this may be a fault on our side and @cosmology/lcd needs to be defined as a dependency rather than a devDependency in atomone-types...let me push an updated version

@timolegros timolegros merged commit 5e8152a into hicommonwealth:master Dec 12, 2024
18 of 20 checks passed
@timolegros timolegros added the deployment plan (PRs only) requires manual infrastructure changes on release label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment plan (PRs only) requires manual infrastructure changes on release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants