Building and deploying for sewup projects is easier by cargo sewup cli tool, however you still can get the ewasm binary and deploy with web3js or other client. Also cargo sewup cli tool provide the abi.json generator, you can use web3js to interact with ERC token contracts made with sewup.
In following sections, I will describe that how sewup project deploy on the block chain network, this method is easier and the build will automatically done be fore deployment.
Providing deployment informationFollowing deploy configure should provide in sewup.toml
. Besides, you may optionally change the gas
and the gas_price
as you need.
[deploy] url = "http://localhost:8545" private = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" address = "0xXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" # gas = 5000000 # optional # gas_price = 1 # optionalInstall sewup tool and deploy
Install deploy tool
cargo install cargo-sewup
Cargo.toml
of the contractcargo sewup
cargo install cargo-sewup --force
cargo-sewup can build a deployable ewasm without deploy with --build-only
or -b
option . The deployable ewasm will be built as ./target/wasm32-unknown-unknown/release/{contract_name}.deploy.wasm
You can read it as binary and deploy with tool you want. Following is the building flow of deployable ewasm.
graph TD A[cargo sewup --build-only] -->|compile| B(Constructor wasm) A -->|compile| C(Runtime wasm) B --> |modified| D(Constructor ewasm) C --> |modified| E(Runtime ewasm) D --> |as body part| F[deployable wasm] E --> |as return part| FLoading
It is not required to use sewup be complied with web3.js, and the token apis of sewup are complied with web3.js. You may use following command to generate the abi.json for web.js client. cargo sewup -g
or cargo sewup --generate-abi
.
Following is the flow for generating the abi.json
graph TD A[cargo sewup --generate-abi] -->|compile| B(Runtime wasm) B --> |expand macro and parse handlers in use| C[generator.rs] C --> |run and print| D[abi.json]Loading
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4