Saltar al contenido principal

Agregar metadatos al contrato WASM durante la compilación

Para construir un contrato inteligente, usa el comando stellar contract build. La opción --meta te permitirá agregar entradas de metadatos adicionales a la sección personalizada contractmetav0 del archivo WASM resultante en el momento de la construcción.

export SHA=$(git rev-parse HEAD)
stellar contract build \
--manifest-path ./cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml \
--meta source_repo=https://github.com/stellar/stellar-cli \
--meta commit_sha=$SHA

Luego puedes usar stellar contract info meta para ver los metadatos:

stellar contract info meta \
--wasm target/wasm32v1-none/release/test_hello_world.wasm
Contract meta:
• rsver: 1.91.0 (Rust version)
• rssdkver: 23.0.1#510d3feb724c2b01d7e7ab7652f03b9f8efc3f35 (Soroban SDK version and its commit hash)
• cliver: 23.1.4#v20.0.0-646-g70895dd66fb7dbf2f4c2a81cf38546512ba4198e-dirty
• source_repo: https://github.com/stellar/stellar-cli
• commit_sha: c6f881689d3f4936cb3262089eb70142e9ca9c91

Guías en esta categoría: