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

Adding in support for mainnet #897

Merged
merged 25 commits into from
Sep 24, 2024
Merged

Conversation

Pauan
Copy link
Collaborator

@Pauan Pauan commented Jul 12, 2024

This PR allows users to use either testnet or mainnet (or both).

The user imports whichever network they want to use:

import * as sdk from "@provablehq/sdk/testnet.js";
import * as sdk from "@provablehq/sdk/mainnet.js";

// This enables multi-threading
"--config", `build.rustflags=["-C", "target-feature=+atomics,+bulk-memory,+mutable-globals", "-C", "link-arg=--max-memory=4294967296"]`,
"--no-default-features",
"--features", `browser,${network}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

What are the consequences on this on node.js support?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There shouldn't be any consequences, everything should work the same in Node as it does right now.

This is just adding in a new testnet / mainnet feature flag, the testnet flag is identical to the current behavior.

Comment on lines +17 to +21
#[cfg(feature = "testnet")]
mod testnet;

#[cfg(feature = "testnet")]
pub use testnet::*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a good way to approach it.

@Pauan Pauan force-pushed the feat/mainnet branch 2 times, most recently from 2faf1ec to 4b65978 Compare August 6, 2024 21:26
@Pauan
Copy link
Collaborator Author

Pauan commented Aug 6, 2024

I added in some end-to-end tests under the sdk/e2e folder.

Right now I just copied the Node template, so it's just doing a basic "hello world".

But over time we can add more e2e tests and flesh them out.

@Pauan
Copy link
Collaborator Author

Pauan commented Aug 6, 2024

Also as discussed in Slack, I got rid of Jest and replaced it with Mocha + Chai + Sinon. The unit tests work so much better now.

@Pauan
Copy link
Collaborator Author

Pauan commented Aug 6, 2024

The PR is ready for review now, but it can't be merged until after mainnet launches, because it relies upon mainnet URLs that just don't exist right now.

After mainnet launches, we will re-run all of the tests until they're all green!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
website/src/pages/TermsOfUse.jsx Outdated Show resolved Hide resolved
create-leo-app/template-react-leo/README.md Outdated Show resolved Hide resolved
sdk/README.md Outdated Show resolved Hide resolved
sdk/README.md Outdated Show resolved Hide resolved
wasm/src/lib.rs Outdated Show resolved Hide resolved
website/src/pages/Homepage.jsx Outdated Show resolved Hide resolved
.github/ISSUE_TEMPLATE/bug.md Show resolved Hide resolved
Copy link
Collaborator

@iamalwaysuncomfortable iamalwaysuncomfortable left a comment

Choose a reason for hiding this comment

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

One final comment from my end is to update all SnarkVM dependencies to rev 3d42aa0 (i.e. the latest stable rev). This ensures the correct Network trait constants are present in the SDK!

Copy link
Collaborator

@jaketarnow jaketarnow left a comment

Choose a reason for hiding this comment

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

LGTM

@jaketarnow jaketarnow merged commit 04e9715 into ProvableHQ:testnet3 Sep 24, 2024
11 of 12 checks passed
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.

3 participants