-
Notifications
You must be signed in to change notification settings - Fork 2
Deploying Contracts
Thomas Greco edited this page Jan 6, 2025
·
3 revisions
- Grab the latest release
- Install bundles via Cosgov
- You will obtain these files by download the release.
- Run CoreEval with Cosgov.
- Youl will obtain the permit file as well as the start*.js script from the release
- Wait for proposal to pass and watch start script on grafana
Each contract must be given a merkle root at start time. If you would like to experiment with the claiming process, then you will need to change
airdrop.proposal.js
so that it is consumed at start time.To generate accounts, you can refer to this script which produces arrays of accounts. This is useful because we cangenerate accounts, and then use the public keys associated with these accounts to compute the contract’s merkle root. After the contract has been deployed, you can use these accounts in your CLI, browser extension, etc. to inspect the claiming processs further
To step through this process you’ll need to start the docker container via
yarn
script ordocker-compose up
. Please be be sure to do this before you continue on.
- Create code bundles
- From the root directory, run the following:
dapp-ertp-airdrop/contract $ agoric run ./scripts/build-it.js
- The command above should result in the following contents being printed to your console:
agoric: run: running /Users/tgreco/dapp-airdrop/contract/scripts/build-it.js
agoric: run: Deploy script will run with Node.js ESM
----- :::: START-TRIBBLES-AIRDROP.JS ::::.2 2 getManifestForAirdrop
----- :::: START-TRIBBLES-AIRDROP.JS ::::.2 3 installKeys Object <[Object: null prototype] {}> {
tribblesAirdrop: Object <[Object: null prototype] {}> {
bundleID: 'b1-dee9ae3e0cb0aa1ff1c09681d5385f5743efeb0918489a9fb40275994fae57a0db3042b3ecd1d4e3c0718caf89bbc59714de599d5a46c251068c498544d9057e'
}
}
----- :::: START-TRIBBLES-AIRDROP.JS ::::.2 4 options :::: Object <[Object: null prototype] {}> {
customTerms: Object <[Object: null prototype] {}> {
startTime: 0n,
initialPayoutValues: [ 9000000000n, 6500000000n, 3500000000n, 1500000000n, 750000000n ],
targetNumberOfEpochs: 5,
targetEpochLength: 6000n,
targetTokenSupply: 10000000000000n,
tokenName: 'Tribbles',
merkleRoot: '0f7e7eeb1c6e5dec518ec2534a4fc55738af04b5379a052c5e3fe836f451ccd0'
}
}
creating startAirdrop-permit.json
creating startAirdrop.js
You can now run a governance submission command like:
agd tx gov submit-proposal swingset-core-eval startAirdrop-permit.json startAirdrop.js --title="Enable tribblesAirdrop contract" --description="Evaluate startAirdrop.js" --deposit=1000000ubld --gas=auto --gas-adjustment=1.2
Remember to install bundles before submitting the proposal:
agd tx swingset install-bundle @/Users/tgreco/.agoric/cache/b1-dee9ae3e0cb0aa1ff1c09681d5385f5743efeb0918489a9fb40275994fae57a0db3042b3ecd1d4e3c0718caf89bbc59714de599d5a46c251068c498544d9057e.json
agd tx swingset install-bundle @/Users/tgreco/.agoric/cache/b1-98815f9542639b657c2f37c8b6d7bf9b41e072aa6fa6ac20a8c2bb8d21844a6732aa47b45ab8ca4fe7f407094ad1581be683352f359b371b0627adeb2fd5b0c3.json
-
Copy bundles to your project directory
- We’re going to install the code bundles from within the context of a docker container
~/dapp-airdrop/contract $ cp ~/.agoric/cache/b1-{dee9*,98815f9*}.json $(pwd)
- Invoke CoreEval within docker shell
- run
yarn run docker:bash
# cd into working directory
$ cd workspace/contract
# if deploying from a key that agd is unaware of, then first carry out test interactions (options)
$ make mintk4
# run CoreEval deploy script
$ /workspace/contract agd tx gov submit-proposal swingset-core-eval startAirdrop-permit.json startAirdrop.js --title="Enable tribblesAirdrop contract" --description="Evaluate startAirdrop.js" --deposit=1000000ubld --gas=auto --gas-adjustment=1.2 --from user1 --keyring-backend=test --chain-id=agoriclocal --yes -b block