From d602c2ed85feb153bb31717f31a5c59dc46b5548 Mon Sep 17 00:00:00 2001 From: beqaabu Date: Wed, 6 Oct 2021 12:43:55 +0200 Subject: [PATCH] Fix Readme --- README.md | 135 +++++++----------------------------------------------- 1 file changed, 17 insertions(+), 118 deletions(-) diff --git a/README.md b/README.md index 58d8a181f..93fe8dd10 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,20 @@ -<<<<<<< HEAD # Cargo plugin for t3rn composable contracts -======= -
- cargo-contract ->>>>>>> 8e86572b4b4ed2442de131c8e3506dee219fb0b7 -[![CI Status][a1]][a2] -[![Matrix Chat][b1]][b2] -[![Discord Chat][c1]][c2] -[![Latest Release][d1]][d2] +[![GitHub license](https://img.shields.io/github/license/paritytech/cargo-contract)](LICENSE) +[![GitLab Status](https://gitlab.parity.io/parity/cargo-contract/badges/master/pipeline.svg)](https://gitlab.parity.io/parity/cargo-contract/pipelines) +[![Latest Version](https://img.shields.io/crates/v/cargo-contract.svg)](https://crates.io/crates/cargo-contract) -[a1]: https://gitlab.parity.io/parity/cargo-contract/badges/master/pipeline.svg -[a2]: https://gitlab.parity.io/parity/cargo-contract/pipelines -[b1]: https://img.shields.io/badge/matrix-chat-brightgreen.svg?style=flat -[b2]: https://riot.im/app/#/room/#ink:matrix.parity.io -[c1]: https://img.shields.io/discord/722223075629727774?style=flat-square&label=discord -[c2]: https://discord.gg/ztCASQE -[d1]: https://img.shields.io/crates/v/cargo-contract.svg -[d2]: https://crates.io/crates/cargo-contract - -

- -> squink, the ink! mascot`cargo-contract` is a CLI tool which helps you develop smart contracts in Parity's ink!.
ink! is a Rust [eDSL](https://wiki.haskell.org/Embedded_domain_specific_language) which allows you to write smart contracts for blockchains built on the [Substrate](https://github.com/paritytech/substrate) framework. -

- -
- -[Guided Tutorial for Beginners](https://substrate.dev/substrate-contracts-workshop/#/0/building-your-contract)  •   -[ink! Documentation Portal](https://paritytech.github.io/ink-docs) - -
-
- -More relevant links: -* Talk to us on [Element][b2] or [Discord][c2] -* [`ink!`](https://github.com/paritytech/ink) ‒ The main ink! repository with smart contract examples -* [Canvas UI](https://paritytech.github.io/canvas-ui/#/upload) ‒ Frontend for contract deployment and interaction -* [Substrate Contracts Node](https://github.com/paritytech/substrate-contracts-node) ‒ Simple Substrate blockchain which includes smart contract functionality - -<<<<<<< HEAD A CLI tool for helping setting up and managing WebAssembly smart contracts in !ink, Solidity (_not yet! WIP._) and WebAssembly text format. Supports t3rn composable contracts. **This is a fork of [`cargo-contracts`](https://github.com/paritytech/cargo-contracts). The fork extends the smart contract languages with Solidity and WASM text format. It also adds the features of composable contract builds, deployment and execution via t3rn gateways.** -======= ->>>>>>> 8e86572b4b4ed2442de131c8e3506dee219fb0b7 ## Installation -* Step 1: `rustup component add rust-src`. +- **Prerequisites** -* Step 2: Install `binaryen` in a version >= 99: + - **rust-src**: `rustup component add rust-src` + - **wasm-opt**: https://github.com/WebAssembly/binaryen#tools -<<<<<<< HEAD - **Install from source** - `cargo build --features extrinsics` - **Install from remote repo** @@ -59,37 +22,10 @@ A CLI tool for helping setting up and managing WebAssembly smart contracts in !i **You can now use the compiler as a command line tool: `cargo t3rn-contract`** -======= - * [Debian/Ubuntu](https://tracker.debian.org/pkg/binaryen): `apt-get install binaryen` - * [Homebrew](https://formulae.brew.sh/formula/binaryen): `brew install binaryen` - * [Arch Linux](https://archlinux.org/packages/community/x86_64/binaryen/): `pacman -S binaryen` - * Windows: [binary releases are available](https://github.com/WebAssembly/binaryen/releases) ->>>>>>> 8e86572b4b4ed2442de131c8e3506dee219fb0b7 - - There's only an old version in your distributions package manager? Just use a - [binary release](https://github.com/WebAssembly/binaryen/releases). - -* Step 3: `cargo install --force cargo-contract` - -### Installation using Docker Image - -If you prefer to use Docker instead we have a Docker image -[available on the Docker Hub](https://hub.docker.com/r/paritytech/contracts-ci-linux): - -```bash -# Pull the latest stable image. -docker pull paritytech/contracts-ci-linux:production -# Create a new contract in your current directory. -docker run --rm -it -v $(pwd):/sources paritytech/contracts-ci-linux:production \ - cargo +nightly contract new --target-dir /sources my_contract +## Usage -# Build the contract. This will create the contract file under -# `my_contract/target/ink/my_contract.contract`. -docker run --rm -it -v $(pwd):/sources paritytech/contracts-ci-linux:production \ - cargo +nightly contract build --manifest-path=/sources/my_contract/Cargo.toml ``` -<<<<<<< HEAD cargo-t3rn-contract 0.3.0 Utilities to develop Wasm smart contracts. @@ -116,62 +52,25 @@ SUBCOMMANDS: instantiate Instantiate a deployed smart contract help Prints this message or the help of the given subcommand(s) ``` -======= ->>>>>>> 8e86572b4b4ed2442de131c8e3506dee219fb0b7 - -If you want to reproduce other steps of CI process you can use the following -[guide](https://github.com/paritytech/scripts#reproduce-ci-locally). -## Usage +## `build` requires the `nightly` toolchain -You can always use `cargo contract help` to print information on available -commands and their usage. +`cargo contract build` must be run using the `nightly` toolchain. If you have +[`rustup`](https://github.com/rust-lang/rustup) installed, the simplest way to do so is `cargo +nightly contract build`. +To avoid having to add `+nightly` you can also create a `rust-toolchain` file in your local directory containing +`nightly`. Read more about how to [specify the rustup toolchain](https://github.com/rust-lang/rustup#override-precedence). -For each command there is also a `--help` flag with info on additional parameters, -e.g. `cargo contract new --help`. +## Features -##### `cargo contract new my_contract` +The `deploy` and `instantiate` subcommands are **disabled by default**, since they are not fully stable yet and increase the build time. -Creates an initial smart contract with some scaffolding code into a new -folder `my_contract` . +If you want to try them, you need to enable the `extrinsics` feature: -<<<<<<< HEAD `cargo install --git https://github.com/MaciejBaj/cargo-contract cargo-t3rn-contract --features extrinsics --force` -======= -The contract contains the source code for the [`Flipper`](https://github.com/paritytech/ink/blob/master/examples/flipper/lib.rs) -contract, which is about the simplest "smart" contract you can build ‒ a `bool` which gets flipped -from `true` to `false` through the `flip()` function. ->>>>>>> 8e86572b4b4ed2442de131c8e3506dee219fb0b7 - -##### `cargo +nightly contract build` - -Compiles the contract into optimized WebAssembly bytecode, generates metadata for it, -and bundles both together in a `.contract` file, which you can use for -deploying the contract on-chain. - -`cargo contract build` must be run using the `nightly` toolchain. If you have -[`rustup`](https://github.com/rust-lang/rustup) installed, the simplest way to -do so is `cargo +nightly contract build`. -<<<<<<< HEAD -The entire code within this repository is licensed under the [GPLv3](LICENSE). Please [contact Parity](https://www.parity.io/contact/) if you have questions about the licensing of this product. -======= -To avoid having to always add `+nightly` you can also set `nightly` as the default -toolchain of a directory by executing `rustup override set nightly` in it. - -##### `cargo contract check` - -Checks that the code builds as WebAssembly. This command does not output any `.contract` -artifact to the `target/` directory. - -##### `cargo contract test` - -Runs test suites defined for a smart contract off-chain. +Once they are stable and the compilation time is acceptable, we will consider removing the `extrinsics` feature. ## License ->>>>>>> 8e86572b4b4ed2442de131c8e3506dee219fb0b7 -The entire code within this repository is licensed under the [GPLv3](LICENSE). +The entire code within this repository is licensed under the [GPLv3](LICENSE). Please [contact Parity](https://www.parity.io/contact/) if you have questions about the licensing of this product. -Please [contact us](https://www.parity.io/contact/) if you have questions about -the licensing of our products.