From 6644f5086b5c9558bcf594d31f8af21cf09dbb25 Mon Sep 17 00:00:00 2001 From: Seth Feibus Date: Tue, 20 Feb 2024 14:20:32 -0500 Subject: [PATCH 1/2] Add development & usage docs --- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eaa41c8..7f64816 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,48 @@ This smart contract tracks IPFS hashes that can contain metadata pertaining to B trie similar to NEAR SocialDB. In addition to this, arbitrary users can attest to data that map via the package name and the account ID of the author. To save on gas, attestors who attempt to make claims against packages *not* already in the registry will revert. Furthermore `content_type` can be specified for releases to allow consumers different methods of resolution once the content is retrieved. -# Quickstart +## Usage -## Build, Test and Deploy +:information_source: A JS library will be provided to interact with the contract, but for now, here are the NEAR CLI commands to interact with the contract. + +### `create_manifest` + +To publish a package manifest to the registry, use the following command with `near-cli-rs`, replacing with your own values: +```bash +near contract \ + call-function \ + as-transaction {{reg.archetype-test.testnet}} create_manifest \ + json-args '{ + "package_name": "test-package", + "version": "0.0.1", + "content_type": "ipfs", + "cid": "bafybeicn7i3soqdgr7dwnrwytgq4zxy7a5jpkizrvhm5mv6bgjd32wm3q4" + }' \ + prepaid-gas '3 Tgas' \ + attached-deposit '0 NEAR' \ + sign-as {{mrtesterman.testnet}} \ + network-config testnet \ + sign-with-keychain \ + send +``` + +### `update_manifest` +### `get_manifest` +### `get_latest_manifest` +### `create_attestation` +### `get_attestations` +### `get_attestation` + + +## Development + +### Prerequisites + +- [rustup](https://rustup.rs/) +- [cargo-near](https://github.com/near/cargo-near) +- [near-cli-rs](https://github.com/near/near-cli-rs) OR [near-cli](https://github.com/near/near-cli) (there are a few versions for both rust & js, so your commands may vary. DYOR) + +### Build, Test and Deploy To build the contract you can execute the `./build.sh` script, which will in turn run: ```bash @@ -17,9 +56,16 @@ cargo build --target wasm32-unknown-unknown --release Then, run the `./deploy.sh` script, which will in turn run: ```bash -near dev-deploy --wasmFile ./target/wasm32-unknown-unknown/release/attestation-registry.wasm +near dev-deploy --wasmFile ./target/wasm32-unknown-unknown/release/attestation_registry.wasm ``` To run unit tests seperately, execute `./test.sh` Latest version has been deployed via testnet [here](https://explorer.testnet.near.org/accounts/dev-1706709131163-75127504488588). + + +If you're using `near-cli-rs`, you can deploy with this command: +```bash +near contract deploy {{reg.archetype-test.testnet}} use-file ./target/wasm32-unknown-unknown/release/attestation_registry.wasm without-init-call network-config {{testnet}} +``` + From f6333f1c60adeb3f68411cb5accd93a7132fdc22 Mon Sep 17 00:00:00 2001 From: Cory Dickson Date: Wed, 21 Feb 2024 15:38:18 -0500 Subject: [PATCH 2/2] Remove unused sections --- README.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7f64816..019c821 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,10 @@ attempt to make claims against packages *not* already in the registry will rever ## Usage -:information_source: A JS library will be provided to interact with the contract, but for now, here are the NEAR CLI commands to interact with the contract. - -### `create_manifest` +:information_source: A JS library will be provided to interact with the contract, but for now, here is an example NEAR CLI command. To publish a package manifest to the registry, use the following command with `near-cli-rs`, replacing with your own values: + ```bash near contract \ call-function \ @@ -29,21 +28,13 @@ near contract \ send ``` -### `update_manifest` -### `get_manifest` -### `get_latest_manifest` -### `create_attestation` -### `get_attestations` -### `get_attestation` - - ## Development ### Prerequisites - [rustup](https://rustup.rs/) - [cargo-near](https://github.com/near/cargo-near) -- [near-cli-rs](https://github.com/near/near-cli-rs) OR [near-cli](https://github.com/near/near-cli) (there are a few versions for both rust & js, so your commands may vary. DYOR) +- [near-cli-rs](https://github.com/near/near-cli-rs) OR [near-cli](https://github.com/near/near-cli) ### Build, Test and Deploy To build the contract you can execute the `./build.sh` script, which will in turn run: @@ -63,8 +54,8 @@ To run unit tests seperately, execute `./test.sh` Latest version has been deployed via testnet [here](https://explorer.testnet.near.org/accounts/dev-1706709131163-75127504488588). - If you're using `near-cli-rs`, you can deploy with this command: + ```bash near contract deploy {{reg.archetype-test.testnet}} use-file ./target/wasm32-unknown-unknown/release/attestation_registry.wasm without-init-call network-config {{testnet}} ```