cargo-near
Advanced tools
Comparing version 0.6.4 to 0.7.0
@@ -14,3 +14,3 @@ const { Binary } = require("binary-install"); | ||
const name = "cargo-near"; | ||
const artifact_download_url = "https://github.com/near/cargo-near/releases/download/cargo-near-v0.6.4"; | ||
const artifact_download_url = "https://github.com/near/cargo-near/releases/download/cargo-near-v0.7.0"; | ||
@@ -17,0 +17,0 @@ const builder_glibc_major_version = 2; |
@@ -10,2 +10,13 @@ # Changelog | ||
## [0.7.0](https://github.com/near/cargo-near/compare/cargo-near-v0.6.4...cargo-near-v0.7.0) - 2024-08-06 | ||
### Added | ||
- Added ability to use SourceScan ([#134](https://github.com/near/cargo-near/pull/134)) | ||
### Fixed | ||
- Replacing atty unmaintained dependency ([#194](https://github.com/near/cargo-near/pull/194)) | ||
### Other | ||
- update default docker images tags + digests ([#191](https://github.com/near/cargo-near/pull/191)) | ||
## [0.6.4](https://github.com/near/cargo-near/compare/cargo-near-v0.6.3...cargo-near-v0.6.4) - 2024-07-22 | ||
@@ -12,0 +23,0 @@ |
{ | ||
"name": "cargo-near", | ||
"version": "0.6.4", | ||
"version": "0.7.0", | ||
"lockfileVersion": 3, | ||
@@ -9,3 +9,3 @@ "requires": true, | ||
"name": "cargo-near", | ||
"version": "0.6.4", | ||
"version": "0.7.0", | ||
"license": "MIT OR Apache-2.0", | ||
@@ -12,0 +12,0 @@ "hasInstallScript": true, |
{ | ||
"name": "cargo-near", | ||
"version": "0.6.4", | ||
"version": "0.7.0", | ||
"description": "Cargo extension for building Rust smart contracts on NEAR", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/near/cargo-near", |
@@ -53,3 +53,3 @@ <!-- markdownlint-disable MD014 --> | ||
```sh | ||
cargo install cargo-near | ||
cargo install --locked cargo-near | ||
``` | ||
@@ -61,3 +61,3 @@ | ||
$ git clone https://github.com/near/cargo-near | ||
$ cargo install --path cargo-near | ||
$ cargo install --locked --path cargo-near | ||
``` | ||
@@ -76,3 +76,14 @@ </details> | ||
--- | ||
Additionally depends on [Git](https://git-scm.com/) binary being installed, besides [cargo](https://github.com/rust-lang/cargo). | ||
```console | ||
cargo near new | ||
``` | ||
Initializes a new project skeleton to create a contract from a template. | ||
--- | ||
```console | ||
cargo near build | ||
@@ -83,4 +94,25 @@ ``` | ||
You can also make this command embed ABI into your WASM artifact by adding `--embed-abi` parameter. Once deployed, this will allow you to call a view function `__contract_abi` to retrieve a [ZST](https://facebook.github.io/zstd/)-compressed ABI. | ||
By default, this runs a reproducible build in a [Docker](https://docs.docker.com/) container, which: | ||
1. runs against source code version, committed to git, ignoring any uncommitted changes | ||
2. requires that `Cargo.lock` of project is created (e.g. via `cargo update`) and added to git. | ||
- this enables `--locked` build by downstream `cargo` command. | ||
3. will use configuration in [`[package.metadata.near.reproducible_build]`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.toml.template#L14-L25) | ||
section of contract's `Cargo.toml` and [`package.repository`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.toml.template#L9) field | ||
- default values for this section can also be found in `Cargo.toml` of | ||
template project, generated by `cargo near new` | ||
Important flags: | ||
1. `--no-docker` | ||
- flag can be used to perform a regular build with rust toolchain installed onto host, running the `cargo-near` cli. | ||
- *NO*-Docker builds run against actual state of code in filesystem and not against a version, committed to source control. | ||
2. `--no-locked` | ||
- flag is allowed in *NO*-Docker builds, e.g. to generate a `Cargo.lock` *and* simultaneously build the contract. | ||
- flag is allowed in Docker builds, but | ||
- such builds are not reproducible due to potential update of dependencies and compiled `wasm` mismatch as the result. | ||
--- | ||
```console | ||
@@ -92,2 +124,6 @@ cargo near abi | ||
Once contract is deployed, this will allow you to call a view function `__contract_abi` to retrieve a [ZST](https://facebook.github.io/zstd/)-compressed ABI. | ||
--- | ||
```console | ||
@@ -99,2 +135,4 @@ cargo near create-dev-account | ||
--- | ||
```console | ||
@@ -106,3 +144,19 @@ cargo near deploy | ||
By default, this runs a reproducible build in a Docker container. | ||
`deploy` command from Docker build requires that contract's source code: | ||
1. doesn't have any modified tracked files, any staged changes or any untracked content. | ||
2. has been pushed to remote repository, identified by | ||
[`package.repository`](https://github.com/near/cargo-near/blob/main/cargo-near/src/commands/new/new-project-template/Cargo.toml.template#L9). | ||
Important flags: | ||
1. `--no-docker` | ||
- flag can be used to perform a regular *NO*-Docker build *and* deploy. | ||
- Similar to `build` command, in this case none of the git-related concerns and restrictions apply. | ||
2. `--no-locked` | ||
- flag is declined for deploy, due to its effects on `build` result | ||
## Contribution | ||
@@ -109,0 +163,0 @@ |
42596
171