docs: bundled contract format description

This commit is contained in:
ppe
2022-09-12 18:10:40 +02:00
parent bf7aaaf2e5
commit 36684d3d89
2 changed files with 194 additions and 13 deletions

View File

@@ -28,10 +28,10 @@ async function main() {
address: "http://13.53.39.138:5666"
})
.build()*/
const contract = warp.contract("f4skRMstoodrRluvl4OCY-Xo50AamgxYwBCZKzw3Uvo");
//const contract = warp.contract("qx1z1YInqcp4Vf5amJER2R8E_SEyY6pmHS1912VSUAs");
/*const jsContractSrc = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.js'), 'utf8');
const jsContractSrc = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.js'), 'utf8');
const wasmContractSrc = fs.readFileSync(path.join(__dirname, 'data/rust/rust-pst_bg.wasm'));
const initialState = fs.readFileSync(path.join(__dirname, 'data/js/token-pst.json'), 'utf8');
@@ -40,35 +40,35 @@ async function main() {
wallet,
initState: initialState,
src: jsContractSrc,
});*/
});
// case 2 - deploy from source, js contract
/*const contractTxId = await warp.createContract.deployFromSourceTx({
/*const {contractTxId} = await warp.createContract.deployFromSourceTx({
wallet,
initState: initialState,
srcTxId: "Hj0S0iK5rG8yVf_5u-usb9vRZg1ZFkylQLXu6rcDt-0",
}, true);*/
});*/
// case 3 - full deploy, wasm contract
/*const contractTxId = await warp.createContract.deploy({
/*const {contractTxId} = await warp.createContract.deploy({
wallet,
initState: initialState,
src: wasmContractSrc,
wasmSrcCodeDir: path.join(__dirname, 'data/rust/src'),
wasmGlueCode: path.join(__dirname, 'data/rust/rust-pst.js')
}, true);*/
});*/
// case 4 - deploy from source, wasm contract
/*const contractTxId = await warp.createContract.deployFromSourceTx({
/*const {contractTxId} = await warp.createContract.deployFromSourceTx({
wallet,
initState: initialState,
srcTxId: "5wXT-A0iugP9pWEyw-iTbB0plZ_AbmvlNKyBfGS3AUY",
}, true);*/
});*/
/*const contract = warp.contract(contractTxId)
.setEvaluationOptions({
const contract = warp.contract(contractTxId)
/*.setEvaluationOptions({
bundlerUrl: "http://13.53.39.138:5666/"
})
})*/
.connect(wallet);
await contract.writeInteraction<any>({
@@ -84,7 +84,7 @@ async function main() {
await contract.writeInteraction<any>({
function: "storeBalance",
target: "M-mpNeJbg9h7mZ-uHaNsa5jwFFRAq0PsTkNWXJ-ojwI",
});*/
});
const {cachedValue} = await contract.readState();