Skip to content

Commit

Permalink
Merge pull request #12 from archetype-org/docs
Browse files Browse the repository at this point in the history
Add development & usage docs
  • Loading branch information
corydickson authored Feb 21, 2024
2 parents 245e1c0 + f6333f1 commit a7345df
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,39 @@ 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 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 \
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
```

## 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)

### Build, Test and Deploy
To build the contract you can execute the `./build.sh` script, which will in turn run:

```bash
Expand All @@ -17,9 +47,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}}
```

0 comments on commit a7345df

Please sign in to comment.