-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: deploy contract without custom code (WIP) #48
Draft
Jovonni
wants to merge
3
commits into
main
Choose a base branch
from
dev/no-custom-core-eval
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jovonni
commented
Jul 17, 2024
•
edited
Loading
edited
- removed deprecated version in docker compose
- deploy contract without custom code
Run Logs: % make deploy-contract-mint
yarn node scripts/deploy-contract.js \
--deploy ./src/sell-concert-tickets.contract.js
bundles bundle-sell-concert-tickets.js valid: 127 files bundled at 2024-07-17T19:40:47.384Z
{
name: 'sell-concert-tickets',
upToDate: 'bundles/bundle-sell-concert-tickets.json.installed'
}
// @ts-check
import { allValues } from './objectTools.js';
import {
AmountMath,
installContract,
startContract,
} from './platform-goals/start-contract.js';
const { Fail } = assert;
const contractName = '_CONTRACT_NAME_'; // for pattern match
const IST_UNIT = 1_000_000n;
/**
* Core eval script to start contract
*
* @param {BootstrapPowers } permittedPowers
* @param {*} config
*
*/
export const deployContract = async (permittedPowers, config) => {
console.log('core eval for', contractName);
const {
// must be supplied by caller or template-replaced
bundleID = Fail`no bundleID`,
} = config?.options?.[contractName] ?? {};
const installation = await installContract(permittedPowers, {
name: contractName,
bundleID,
});
await startContract(permittedPowers, {
name: contractName,
startArgs: {
installation,
},
});
console.log(contractName, '(re)started');
};
/** @type { import("@agoric/vats/src/core/lib-boot.js").BootstrapManifestPermit } */
export const permit = harden({
consume: {
startUpgradable: true, // to start contract and save adminFacet
},
installation: {
consume: { [contractName]: true },
produce: { [contractName]: true },
},
instance: { produce: { [contractName]: true } },
// generate issuer/brand
});
export const main = deployContract;
/Users/jovonni/Documents/projects/dapp-agoric-basics/contract
sell-concert-tickets
{ contractEntry: './src/sell-concert-tickets.contract.js' }
meta: {
contractName: 'sellConcertTickets',
customTermsShape: { inventory: Object [match:recordOf] { payload: [Array] } },
permit: {
consume: {
agoricNames: true,
brandAuxPublisher: true,
startUpgradable: true,
zoe: true
},
installation: { consume: [Object], produce: [Object] },
instance: { produce: [Object] },
issuer: { consume: [Object], produce: [Object] },
brand: { consume: [Object], produce: [Object] }
}
}
(Error#1)
Error#1: bundle sell-concert-tickets was for /Users/jovonni/Documents/projects/dapp-agoric-basics/contract/src/sell-concert-tickets.contract.js , not bundles/deploy-sell-concert-tickets.js
at async Object.buildAndRunCoreEval [as runCoreEval] (file:///Users/jovonni/Documents/projects/dapp-agoric-basics/contract/tools/e2e-tools.js:577:5)
at async main (file:///Users/jovonni/Documents/projects/dapp-agoric-basics/contract/scripts/deploy-contract.js:132:22)
bundles add: sell-concert-tickets from bundles/deploy-sell-concert-tickets.js
(Error#2)
Error#2: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js'
(Error#3)
Error#3: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js'
(Error#4)
Error#4: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js.js'
(Error#5)
Error#5: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js.js'
(Error#6)
Error#6: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js.json'
(Error#7)
Error#7: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js.json'
(Error#8)
Error#8: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js.node'
(Error#9)
Error#9: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js.node'
(Error#10)
Error#10: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js/index.js'
(Error#11)
Error#11: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js/index.js'
(Error#12)
Error#12: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js/index.json'
(Error#13)
Error#13: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js/index.json'
(Error#14)
Error#14: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/objectTools.js/index.node'
(Error#15)
Error#15: ENOENT: no such file or directory, stat '/Users/jovonni/Documents/projects/dapp-agoric-basics/contract/bundles/platform-goals/start-contract.js/index.node'
bundles bundled 1 files in bundle-sell-concert-tickets.js at 2024-07-17T19:47:42.591Z
submit proposal sell-concert-tickets
[
'bundles/deploy-sell-concert-tickets-permit.json',
'bundles/deploy-sell-concert-tickets.js'
]
await tx [
'bundles/deploy-sell-concert-tickets-permit.json',
'bundles/deploy-sell-concert-tickets.js'
]
$$$ agd tx gov submit-proposal swingset-core-eval bundles/deploy-sell-concert-tickets-permit.json bundles/deploy-sell-concert-tickets.js --title sell-concert-tickets --description sell-concert-tickets --deposit 10000000ubld --keyring-backend test --chain-id agoriclocal --from agoric1estsewt6jqsx77pwcxkn5ah0jqgu8rhgflwfdl --broadcast-mode block --gas auto --gas-adjustment 1.4 --yes --output json
gas estimate: 829595
{
txhash: 'BEA4EC377333C4AD84AD75BDDB62263B1EF0A83BA9B252A96D3E594BF36A8825',
code: 0,
height: '4589',
gas_used: '589548'
}
await voteLatestProposalAndWait [
'bundles/deploy-sell-concert-tickets-permit.json',
'bundles/deploy-sell-concert-tickets.js'
]
{ before: 'deposit', on: '13', delay: 1 } ...
$$$ agd tx gov deposit 13 50000000ubld --keyring-backend test --chain-id agoriclocal --from validator --broadcast-mode block --gas auto --gas-adjustment 1.4 --yes --output json
gas estimate: 208133
$$$ agd tx gov vote 13 yes --keyring-backend test --chain-id agoriclocal --from validator --broadcast-mode block --gas auto --gas-adjustment 1.4 --yes --output json
gas estimate: 90066
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
{ step: 'voting', on: '13', delay: 1 } ...
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
{ step: 'voting', on: '13', delay: 1 } ...
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
{ step: 'voting', on: '13', delay: 1 } ...
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
{ step: 'voting', on: '13', delay: 1 } ...
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_VOTING_PERIOD)
{ step: 'voting', on: '13', delay: 1 } ...
Waiting for proposal 13 to pass (status=PROPOSAL_STATUS_PASSED)
{ step: 'voting', on: '13', delay: 1 } ...
undefined 2024-07-17T19:47:53.179648879Z PROPOSAL_STATUS_PASSED
{ step: 'run', propsal: undefined, delay: 1 } ...
{ step: 'run', propsal: undefined, delay: 1 } ...
{ step: 'run', propsal: undefined, delay: 1 } ...
{
id: '13',
messages: [
{
'@type': '/cosmos.gov.v1.MsgExecLegacyContent',
content: [Object],
authority: 'agoric10d07y265gmmuvt4z0w9aw880jnsr700jgl36x9'
}
],
status: 'PROPOSAL_STATUS_PASSED',
final_tally_result: {
yes_count: '5000000000',
abstain_count: '0',
no_count: '0',
no_with_veto_count: '0'
},
submit_time: '2024-07-17T19:47:43.179648879Z',
deposit_end_time: '2024-07-19T19:47:43.179648879Z',
total_deposit: [ { denom: 'ubld', amount: '60000000' } ],
voting_start_time: '2024-07-17T19:47:43.179648879Z',
voting_end_time: '2024-07-17T19:47:53.179648879Z',
metadata: ''
} |
error:
|
dckc
reviewed
Sep 5, 2024
|
||
const generateDeployArtifact = async (path, name, { readFile, writeFile }) => { | ||
// readtemplate | ||
const template = await readFile('src/auto-deploy.template.js', 'utf-8'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops! looks like this template file didn't get committed.
1 task
dckc
added a commit
that referenced
this pull request
Sep 10, 2024
We negledted to check this in. Fortunately, we logged it and captured the log in a comment. #48 (comment)
This was referenced Sep 11, 2024
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.