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

JS test with Mocha (DRAFT) #2255

Merged
merged 5 commits into from
Oct 18, 2024
Merged

JS test with Mocha (DRAFT) #2255

merged 5 commits into from
Oct 18, 2024

Conversation

b-zee
Copy link
Contributor

@b-zee b-zee commented Oct 16, 2024

Built on top of #2244

Usage

First build the NPM package. Currently, all env vars for the local network have to be set when running this, as the network settings will be hardcoded in the package. (Later we would pass this in during runtime.)

export RPC_URL="http://localhost:4343/" PAYMENT_TOKEN_ADDRESS="0x5FbDB2315678afecb367f032d93F642f64180aa3" DATA_PAYMENTS_ADDRESS="0x8464135c8F25Da09e49BC8782676a84730C318bC" REWARDS_ADDRESS=0xc0ffee254729296a45a3885639AC7E10F9d54979
wasm-pack build --dev --target=web autonomi --features=vault

Then cd into autonomi/tests-js

cd autonomi/tests-js
npm install
npm run serve

Then go to http://127.0.0.1:8080 in the browser. Here, enter a ws multiaddr of a peer and press 'run'.

autonomi/tests-js/package.json Dismissed Show dismissed Hide dismissed
const dataAddr = await client.dataPut(data, wallet);
console.log("put done: ", dataAddr.toString());

let archive = new Map([["README.md", dataAddr]]);
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should be using the new API for Archives here:

let archive = new Archive
archive.add_new_file("README.md", dataAddr)

@b-zee b-zee marked this pull request as ready for review October 18, 2024 05:56
@b-zee b-zee enabled auto-merge October 18, 2024 11:09
@b-zee b-zee added this pull request to the merge queue Oct 18, 2024
Merged via the queue into maidsafe:main with commit f5b6b24 Oct 18, 2024
26 checks passed
@b-zee b-zee deleted the test-js-wasm branch October 18, 2024 14:12
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