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(ETH/POL): Added support for ETH and POL/matic wallets. #9

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Bobinstein
Copy link
Contributor

Added support for using ETH and POL/Matic wallets to sign and pay for data uploads, and update ArNS records.

Simplified Turbo upload logic, using turbo.uploadFolder rather than manually uploading each file and generating a custom manifest.

Added fallback value for GIT_HASH to enable simpler local operation.

README updates.

@Bobinstein Bobinstein marked this pull request as ready for review December 14, 2024 22:15
@Bobinstein Bobinstein marked this pull request as draft December 14, 2024 22:16
.gitignore Outdated Show resolved Hide resolved
@@ -20,7 +21,9 @@ Before using `permaweb-deploy`, you must:
```bash
base64 -i wallet.json | pbcopy
```
3. Ensure that the secret name for the encoded wallet is `DEPLOY_KEY`.
2. Ensure that the secret name for the encoded wallet is `DEPLOY_KEY`.

Choose a reason for hiding this comment

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

Just a thought here, would be preferable to store as json string. B64 encoding doesnt actually gain any protection - its still a string, just like a json string, and requires more work to decode it.

Copy link

@atticusofsparta atticusofsparta Dec 14, 2024

Choose a reason for hiding this comment

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

And considering eth and pol wallets dont use b64 encoding... well it seems even stranger to still have this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, but updating the required method for providing an Arweave wallet's jwk would be a major breaking change. It should be discussed in more detail with the repo owner directly before any community prs are made to address it.

Copy link

@atticusofsparta atticusofsparta Dec 15, 2024

Choose a reason for hiding this comment

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

@twilson63 wdyt? I think either we stick to b64 encoding at all times or revert it for arweave addresses.

src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated
@@ -67,29 +76,86 @@ export function getTagValue(list, name) {
return;
}

let jwk = JSON.parse(Buffer.from(DEPLOY_KEY, 'base64').toString('utf-8'));
// Throw an error if both --eth and --pol are true

Choose a reason for hiding this comment

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

This is not a very scalable method i think. An argument of sig-type or something that passes in values like would remove the need for these checks. Ideally it matches up with the arbundles signature config so we can map from their, but we can also use named values like polygon or ethereum to map to the right signers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I understand. We want deployments to default to Arweave unless something else is explicitly specified. Requiring a declaration of signer type in all cases would be a major breaking change.

Can you clarify what you're requesting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the -e and -p flags to use a single --sig-type flag instead, that defaults to arweave, and only valid signer types may be provided.

src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
Comment on lines 138 to +158
await ant.setRecord(
{
undername: argv.undername,
transactionId: manifestId,
ttlSeconds: 3600,
},{
},
{
tags: [
{
name: 'GIT-HASH',
value: process.env.GITHUB_SHA,
value: process.env.GITHUB_SHA || '',
},
{
name: 'App-Name',
value: 'Permaweb-Deploy',
},
]
{
name: 'anchor',
value: new Date().toISOString(),
},
],

Choose a reason for hiding this comment

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

Could add options for custom tags in the cli here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but this is outside the scope of this pr.

Choose a reason for hiding this comment

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

no need to add anchor here - the github sha will be unique - and i believe we add this anchor in the ario sdk already

@Bobinstein Bobinstein marked this pull request as ready for review December 15, 2024 01:10
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