-
Notifications
You must be signed in to change notification settings - Fork 217
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(multichain-testing): stakeIca
contract e2e test
#9534
Changes from all commits
b6f5956
8a4ebee
0c0e179
9311770
cb22e56
47711ec
06b225f
f8a5575
e7e0830
592dbd0
4a4523b
b3bc19d
55f1896
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.tsimp | ||
.yarn/* | ||
!.yarn/patches/* | ||
revise-chain-info* | ||
start-* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,26 +17,30 @@ | |
}, | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@endo/errors": "^1.2.2", | ||
"@agoric/cosmic-proto": "0.4.1-dev-08f8549.0", | ||
"@cosmjs/crypto": "^0.32.2", | ||
"@cosmjs/proto-signing": "^0.32.2", | ||
"@cosmjs/stargate": "^0.32.2", | ||
"@endo/errors": "^1.2.2", | ||
"@endo/far": "^1.1.2", | ||
"@endo/nat": "^5.0.7", | ||
"@endo/ses-ava": "^1.2.2", | ||
"@types/eslint": "^8", | ||
"@types/fs-extra": "^11", | ||
"@types/node": "^20.11.13", | ||
"@typescript-eslint/eslint-plugin": "^6.20.0", | ||
"@typescript-eslint/parser": "^6.20.0", | ||
"ava": "^6.1.3", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"execa": "^9.2.0", | ||
"fs-extra": "^11.2.0", | ||
"patch-package": "^8.0.0", | ||
"prettier": "^3.2.4", | ||
"starshipjs": "2.0.0", | ||
"tsimp": "^2.0.10", | ||
"tsx": "^4.15.6", | ||
"typescript": "^5.3.3" | ||
}, | ||
"resolutions": { | ||
|
@@ -56,7 +60,8 @@ | |
"**/*.test.ts" | ||
], | ||
"concurrency": 1, | ||
"serial": true | ||
"serial": true, | ||
"timeout": "125s" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oddly specific :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😅 the unbonding_period is 2min |
||
}, | ||
"prettier": { | ||
"arrowParens": "avoid", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env tsx | ||
import '@endo/init/debug.js'; | ||
|
||
import { execa } from 'execa'; | ||
import fse from 'fs-extra'; | ||
import childProcess from 'node:child_process'; | ||
|
||
import { makeAgdTools } from '../tools/agd-tools.js'; | ||
import { makeDeployBuilder } from '../tools/deploy.js'; | ||
|
||
async function main() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I expect we'll DRY later There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing similar but I could see it being a regular CLI command. Though I didn't have any specific ideas in mind other than to ignore my DRY/factoring sniffer. |
||
const builder = process.argv[2]; | ||
|
||
if (!builder) { | ||
console.error('USAGE: deploy-cli.ts <builder script>'); | ||
process.exit(1); | ||
} | ||
|
||
try { | ||
const agdTools = await makeAgdTools(console.log, childProcess); | ||
const deployBuilder = makeDeployBuilder(agdTools, fse.readJSON, execa); | ||
await deployBuilder(builder); | ||
} catch (err) { | ||
console.error(err); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
main(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env tsx | ||
|
||
import nodeFetch from 'node-fetch'; | ||
import fsp from 'node:fs/promises'; | ||
import prettier from 'prettier'; | ||
|
||
import { convertChainInfo } from '@agoric/orchestration/src/utils/registry.js'; | ||
|
||
import type { IBCInfo, Chains } from '@chain-registry/types'; | ||
|
||
const fetch = nodeFetch.default; | ||
|
||
/** | ||
* Chain registry running in Starship | ||
* | ||
* https://github.com/cosmology-tech/starship/blob/main/starship/proto/registry/service.proto | ||
* | ||
* http://localhost:8081/chains | ||
* http://localhost:8081/chain_ids | ||
* http://localhost:8081/ibc | ||
*/ | ||
const BASE_URL = 'http://localhost:8081/'; | ||
|
||
const { chains }: { chains: Chains } = await fetch(`${BASE_URL}chains`).then( | ||
r => r.json(), | ||
); | ||
|
||
const ibc: { | ||
data: IBCInfo[]; | ||
} = await fetch(`${BASE_URL}ibc`).then(r => r.json()); | ||
|
||
// UNTIL https://github.com/cosmology-tech/starship/issues/494 | ||
const backmap = { | ||
agoriclocal: 'agoric', | ||
osmosislocal: 'osmosis', | ||
gaialocal: 'cosmoshub', | ||
}; | ||
for (const ibcInfo of ibc.data) { | ||
ibcInfo.chain_1.chain_name = backmap[ibcInfo.chain_1.chain_name]; | ||
ibcInfo.chain_2.chain_name = backmap[ibcInfo.chain_2.chain_name]; | ||
for (const c of ibcInfo.channels) { | ||
// @ts-expect-error XXX bad typedef | ||
c.tags.preferred = c.tags.perferred; | ||
} | ||
} | ||
|
||
const chainInfo = await convertChainInfo({ | ||
chains, | ||
ibcData: ibc.data, | ||
}); | ||
|
||
const record = JSON.stringify(chainInfo, null, 2); | ||
const src = `/** @file Generated by fetch-starship-chain-info.ts */\nexport default /** @type {const} } */ (${record});`; | ||
const prettySrc = await prettier.format(src, { | ||
parser: 'babel', // 'typescript' fails to preserve parens for typecast | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}); | ||
await fsp.writeFile('./starship-chain-info.js', prettySrc); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* global harden */ | ||
/// <reference types="ses" /> | ||
import { makeHelpers } from '@agoric/deploy-script-support'; | ||
|
||
import chainInfo from '../starship-chain-info.js'; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async () => | ||
harden({ | ||
sourceSpec: '@agoric/orchestration/src/proposals/revise-chain-info.js', | ||
getManifestCall: [ | ||
'getManifestForReviseChains', | ||
{ | ||
chainInfo, | ||
}, | ||
], | ||
}); | ||
|
||
export default async (homeP, endowments) => { | ||
const { writeCoreEval } = await makeHelpers(homeP, endowments); | ||
await writeCoreEval('revise-chain-info', defaultProposalBuilder); | ||
}; |
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.
I'm seeing an error running this command but I'm not quite sure why. Did you happen to see this error before?
Expand to see logs(it's long)
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.
I haven't seen this before, but have a few suggestions:
screenshots
_I'm not sure all of these resources are necessary, but this is what mine is configured to. Would be great if we can determine the minimum amount required. I suspect at least ~4 CPU and ~8GB RAM given the resource overrides in
config.yaml
.Try adding
--verbosity 9
to thesetup-kind
command, for more detailed log output:kind create cluster --name agship --verbosity 9
Take a look at the Starship Docs for the primary source of truth and see if there's something I might've missed documenting.