Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

ethpmV3 support #3247

Merged
merged 9 commits into from
Nov 3, 2020
Merged

ethpmV3 support #3247

merged 9 commits into from
Nov 3, 2020

Conversation

njgheorghita
Copy link
Contributor

@njgheorghita njgheorghita commented Aug 10, 2020

Truffle support for the ethpmV3 spec!

Hey @gnidan and @eggplantzzz . Thanks for your help so far in discussing this. Here's a first pass at ethpmV3 x truffle. I'm sure there's plenty of areas where my javascript is smelly, please point them out anywhere you see them. After a review, I plan to run this through another thorough round of integration tests, & I have an update to the trufflesuite.com docs in the pipeline to reflect these changes.

@njgheorghita njgheorghita mentioned this pull request Aug 10, 2020
@njgheorghita njgheorghita force-pushed the ethpm-v3 branch 12 times, most recently from 34ebb36 to 46618af Compare August 11, 2020 00:44
packages/core/lib/commands/packages.js Outdated Show resolved Hide resolved
packages/ethpm-v1/package.json Outdated Show resolved Hide resolved
ipfsProtocol: "https",
ipfsPort: "5001",
registry: {
address: "0x8011df4830b4f696cd81393997e5371b93338878",
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 happy to deploy an un-authenticated registry for truffle to use as its default, unless you guys want to handle that. I'm 50/50 on whether it should be on mainnet (better reliability / authority / helps minimize spam packages) or on any testnet (much much cheaper / easier to start getting your hands dirty with publishing ethpm packages)

Copy link
Contributor

Choose a reason for hiding this comment

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

does this field respect ENS names?

Copy link
Contributor Author

@njgheorghita njgheorghita Aug 12, 2020

Choose a reason for hiding this comment

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

Yep, though right now it only permits ens on mainnet. However, upon further investigation it looks like truffle supports ens on all testnets except kovan, so I updated it to support ens on these other testnets.

packages/ethpm-v1/README.md Show resolved Hide resolved
gasPrice: 100000000000,
data: encodedTxData
});
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like there might be a better mechanism available somewhere in truffle that manages sending txs with a more user-friendly interface? Could you point me in the right direction...

packages/core/lib/commands/install.js Outdated Show resolved Hide resolved
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

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

Here's an initial review on the @truffle/core plumbing stuff

ipfsProtocol: "https",
ipfsPort: "5001",
registry: {
address: "0x8011df4830b4f696cd81393997e5371b93338878",
Copy link
Contributor

Choose a reason for hiding this comment

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

does this field respect ENS names?

@@ -3,33 +3,43 @@ const command = {
description: "Install a package from the Ethereum Package Registry",
builder: {},
help: {
usage: "truffle install <package_name>[@<version>]",
usage: "truffle install <packageId> [--alias]",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
usage: "truffle install <packageId> [--alias]",
usage: "truffle install <package-identifier> [--alias]",

packages/core/lib/commands/install.js Outdated Show resolved Hide resolved
packages/core/lib/commands/install.js Outdated Show resolved Hide resolved
packages/core/lib/commands/install.js Outdated Show resolved Hide resolved
packages/core/lib/commands/install.js Show resolved Hide resolved
packages/core/lib/commands/packages.js Outdated Show resolved Hide resolved
packages/core/lib/commands/publish.js Outdated Show resolved Hide resolved
packages/core/lib/commands/packages.js Outdated Show resolved Hide resolved
packages/core/lib/commands/install.js Outdated Show resolved Hide resolved
@njgheorghita
Copy link
Contributor Author

@eggplantzzz Thanks for the review! I've changed or responded to your comments. Let me know if there's anything else glaring / obvious that needs addressing. In terms of the failing tests... Has there been any significant changes to the resolver recently? It seems to me that the await Migrate.run(config) step is failing in the tests - and it's not obvious the best way to fix it, but I'll be able to dig a little deeper into it tomorrow if it's not obvious to you what changed.

@eggplantzzz
Copy link
Contributor

Sorry about jerking you back and forth on the package-identifier stuff, I didn't see @gnidan's suggestion about it until afterwards haha.

@eggplantzzz
Copy link
Contributor

As for the CI failures, I don't think anything changed with the migrations. I'll take a quick look and see if I can find anything out about this.

@eggplantzzz
Copy link
Contributor

So @njgheorghita, I took a look and your tests are failing because there were a bunch of breaking changes to some of the compilation packages. workflow-compile had compilation and the saving of artifacts separated into two steps. I made the necessary corrections and pushed them to a branch in the Truffle repo called fix-ethpm-tests. I didn't want to push directly to your branch but feel free to merge it into yours or fix it yourself. The gist of the matter is that Contracts.compile no longer saves the artifacts. There is now a method Contracts.compileAndSave that you need to use to do both. We also started using WorkflowCompile as the name when importing that library and I made that change in there as well. Let me know if something is unclear or if you need anything else!

@njgheorghita njgheorghita force-pushed the ethpm-v3 branch 2 times, most recently from d3a25a0 to 32736ce Compare October 7, 2020 08:38
@njgheorghita
Copy link
Contributor Author

@eggplantzzz Nailed it! Thanks for looking into it and the fix!

packages/ethpm-v3/lib/utils.js Outdated Show resolved Hide resolved
packages/ethpm-v3/lib/utils.js Outdated Show resolved Hide resolved
packages/ethpm-v1/lib/ethpm-v1.js Show resolved Hide resolved
packages/resolver/lib/sources/ethpm-v3.ts Outdated Show resolved Hide resolved
packages/resolver/lib/sources/ethpm-v3.ts Outdated Show resolved Hide resolved
packages/resolver/lib/sources/ethpm-v3.ts Outdated Show resolved Hide resolved
@njgheorghita njgheorghita force-pushed the ethpm-v3 branch 2 times, most recently from 8578562 to 00a55ef Compare October 19, 2020 10:03
@njgheorghita
Copy link
Contributor Author

@eggplantzzz I can definitely update packageIdentifier -> package_identifier. Just to make sure I'm not messing up anything here - what's the reason to merge the develop branch into this one? Is it fine to continue building on top of it?

@njgheorghita
Copy link
Contributor Author

I've also updated the ethpm x truffle docs here and added my blog (which is fairly similar to the docs but has a better example and more in-depth analysis) here.

@eggplantzzz
Copy link
Contributor

eggplantzzz commented Oct 28, 2020

@njgheorghita Oh, I think there was just a merge conflict so I resolved it for you. I hope you don't mind...sorry if I stepped on your toes. It should be fine to continue as normal. And thanks for the fix!

@eggplantzzz eggplantzzz merged commit 3cc229d into trufflesuite:develop Nov 3, 2020
@gnidan gnidan mentioned this pull request Nov 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants