You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation is that it would be preferred if these are built together to ensure there is no mismatch of versions when using.
cargo near build
should build similar to cargo build except that it includes "-C", "link-arg=-s" rustflags to ensure those aren't left out and includes --target wasm32-unknown-unknown. Unsure if all cargo options should/can be forwarded easily, but at least --release needs to be included as configuration.
This command should output the following files in $CARGO_TARGET_DIR/near/:
<crate name>.json: ABI of contract (logic exists already with cargo near abi)
<crate name>.wasm: Built wasm file
<crate name>.<extension>: Bundle of ABI and wasm in JSON file. Wasm should probably be included in base64 (nearcore RPC accepts this, so no transformation will be required). The motivation for this is some tooling might want both to avoid having to use two separate files.
What the bundle looks like may be opinionated, maybe it's the same schema as ABI except with an extra key for code, or it's a map of {"abi": ..., "code":}. The latter might be a bit redundant/confusing because ABI already has a key abi.
If it works out cleanly, this can be split into three separate changes:
re-opening because there are still components relevant in this issue. exalate screwed up the formatting so it's unviewable now. I'll try to fix it later
Motivation is that it would be preferred if these are built together to ensure there is no mismatch of versions when using.
should build similar to
cargo build
except that it includes"-C", "link-arg=-s"
rustflags to ensure those aren't left out and includes--target wasm32-unknown-unknown
. Unsure if all cargo options should/can be forwarded easily, but at least--release
needs to be included as configuration.This command should output the following files in
$CARGO_TARGET_DIR/near/
:<crate name>.json
: ABI of contract (logic exists already withcargo near abi
)<crate name>.wasm
: Built wasm file<crate name>.<extension>
: Bundle of ABI and wasm in JSON file. Wasm should probably be included in base64 (nearcore RPC accepts this, so no transformation will be required). The motivation for this is some tooling might want both to avoid having to use two separate files.What the bundle looks like may be opinionated, maybe it's the same schema as ABI except with an extra key for
code
, or it's a map of{"abi": ..., "code":}
. The latter might be a bit redundant/confusing because ABI already has a keyabi
.If it works out cleanly, this can be split into three separate changes:
.wasm
Create bundle output of both(moved into Add ability to create bundle of ABI and Wasm #82)The text was updated successfully, but these errors were encountered: