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: added WASM functions & mm test #2380

Conversation

mickvandijke
Copy link
Contributor

@mickvandijke mickvandijke commented Nov 4, 2024

Adds all the necessary WASM bindings for the webapp to be able to upload private data to a vault and fetch it again.

Also includes a test that puts private data to a vault and pays for the records using MetaMask.

Running the MetaMask example:

  1. Make sure that you have MetaMask installed in your browser.
  2. Run a local network with websockets enabled.
  3. Depending on the EVM network you are using for the test, make sure that the network has been added to MetaMask and that you have some gas and payment tokens in your account. (I can send some for Arb Sepolia or Arb One)
  4. Build the WASM pkg using the correct EVM network (don't use the local setting here, you need to define the RPC_URL etc manually as ENV vars if you want to use a local EVM network):

Using Arbitrum Sepolia for this example.

RPC_URL="https://sepolia-rollup.arbitrum.io/rpc" PAYMENT_TOKEN_ADDRESS="0xBE1802c27C324a28aeBcd7eeC7D734246C807194" DATA_PAYMENTS_ADDRESS="0xDd56b03Dae2Ab8594D80269EC4518D13F1A110BD" wasm-pack build --release --target=web autonomi --features=data,vault,external-signer
  1. Start a webserver using Python for example:

Run this command inside the safe_network repo.

python3 -m http.server 8000 -d autonomi
  1. Visit http://localhost:8000/examples/metamask/
  2. Make sure that you have the right network selected in MetaMask!
  3. Enter a ws multiaddr of a local node and press run.

@mickvandijke mickvandijke force-pushed the test-metamask-private-put-to-vault-example branch from b428f48 to 21d4044 Compare November 4, 2024 16:43
Copy link
Member

@grumbach grumbach left a comment

Choose a reason for hiding this comment

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

LGMT

@mickvandijke mickvandijke added this pull request to the merge queue Nov 5, 2024
Merged via the queue into maidsafe:main with commit d223ded Nov 5, 2024
28 checks passed
@mickvandijke mickvandijke deleted the test-metamask-private-put-to-vault-example branch November 5, 2024 10:14
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