diff --git a/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.md b/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.md index c82d1a51f0b..eaad0c4f1b2 100644 --- a/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.md +++ b/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.md @@ -14,6 +14,10 @@ Generated by [AVA](https://avajs.dev). [ [ 'published.agoricNames.chain.agoric', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"chainId\\\\\\":\\\\\\"agoric-3\\\\\\",\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ubld\\\\\\"}]}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chain.agoriclocal', '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"chainId\\\\\\":\\\\\\"agoriclocal\\\\\\"}\\",\\"slots\\":[]}"]}', ], [ @@ -60,6 +64,30 @@ Generated by [AVA](https://avajs.dev). 'published.agoricNames.chain.stride', '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"chainId\\\\\\":\\\\\\"stride-1\\\\\\",\\\\\\"stakingTokens\\\\\\":[{\\\\\\"denom\\\\\\":\\\\\\"ustrd\\\\\\"}]}\\",\\"slots\\":[]}"]}', ], + [ + 'published.agoricNames.chainConnection.agoric-3_cosmoshub-4', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-6\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-927\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-405\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-5\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-927\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-6\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-5\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-405\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_noble-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-77\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-32\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-72\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-21\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-62\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-32\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-77\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-72\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-62\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-21\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_omniflixhub-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-73\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-47\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-67\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-30\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-58\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-47\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-73\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-67\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-58\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-30\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_osmosis-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-1\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-2109\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-1649\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-320\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-2109\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-1\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-1649\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-320\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_secret-4', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-17\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-111\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-80\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-17\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-51\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-10\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-111\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-17\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-17\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-80\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-10\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-51\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_stride-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-74\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-129\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-118\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-68\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-148\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-59\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-129\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-74\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-68\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-118\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-59\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-148\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], [ 'published.agoricNames.chainConnection.agoriclocal_cosmoshub-4', '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-3\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-2\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":1,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', @@ -232,6 +260,30 @@ Generated by [AVA](https://avajs.dev). > See also board marshalling conventions (_to appear_). [ + [ + 'published.agoricNames.chainConnection.agoric-3_cosmoshub-4', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-6\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-927\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-405\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-5\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-927\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-6\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-8\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-649\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-5\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-405\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_noble-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-77\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-32\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-72\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-21\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-62\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-32\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-77\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-72\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-62\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-21\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_omniflixhub-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-73\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-47\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-67\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-30\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-58\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-47\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-73\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-67\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-40\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-58\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-30\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_osmosis-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-1\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-2109\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-1649\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-320\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-2109\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-1\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-1649\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-320\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_secret-4', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-17\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-111\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-80\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-17\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-51\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-10\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-111\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-17\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-17\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-80\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-10\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-51\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], + [ + 'published.agoricNames.chainConnection.agoric-3_stride-1', + '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-74\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-129\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-118\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-68\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-148\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-59\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}","{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-129\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-74\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-68\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"FIXME\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-118\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-59\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-148\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":0,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', + ], [ 'published.agoricNames.chainConnection.agoriclocal_cosmoshub-4', '{"blockHeight":"0","values":["{\\"body\\":\\"{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-3\\\\\\",\\\\\\"counterparty\\\\\\":{\\\\\\"client_id\\\\\\":\\\\\\"07-tendermint-2\\\\\\",\\\\\\"connection_id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"prefix\\\\\\":{\\\\\\"key_prefix\\\\\\":\\\\\\"\\\\\\"}},\\\\\\"id\\\\\\":\\\\\\"connection-1\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"transferChannel\\\\\\":{\\\\\\"channelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyChannelId\\\\\\":\\\\\\"channel-1\\\\\\",\\\\\\"counterPartyPortId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"ordering\\\\\\":1,\\\\\\"portId\\\\\\":\\\\\\"transfer\\\\\\",\\\\\\"state\\\\\\":3,\\\\\\"version\\\\\\":\\\\\\"ics20-1\\\\\\"}}\\",\\"slots\\":[]}"]}', diff --git a/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.snap b/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.snap index 8cb9717b25e..4b6b32eb10b 100644 Binary files a/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.snap and b/packages/boot/test/bootstrapTests/snapshots/orchestration.test.ts.snap differ diff --git a/packages/boot/test/bootstrapTests/vat-orchestration.test.ts b/packages/boot/test/bootstrapTests/vat-orchestration.test.ts index 600475ffdae..b70a8997530 100644 --- a/packages/boot/test/bootstrapTests/vat-orchestration.test.ts +++ b/packages/boot/test/bootstrapTests/vat-orchestration.test.ts @@ -78,6 +78,7 @@ test('makeAccount returns an ICA connection', async t => { await EV.vat('bootstrap').consumeItem('orchestration'); const account = await EV(orchestration).makeAccount( + 'somechain-1', 'connection-0', 'connection-0', ); @@ -95,7 +96,7 @@ test('makeAccount returns an ICA connection', async t => { t.regex(remoteAddress, /icahost/); t.regex(localAddress, /icacontroller/); t.regex(chainAddress.address, /cosmos1/); - t.regex(chainAddress.chainId, /FIXME/); // TODO, use a real chainId #9063 + t.is(chainAddress.chainId, 'somechain-1'); t.truthy(matches(port, M.remotable('Port'))); t.log('ICA Account Addresses', { remoteAddress, @@ -113,6 +114,7 @@ test('ICA connection can be closed', async t => { await EV.vat('bootstrap').consumeItem('orchestration'); const account = await EV(orchestration).makeAccount( + 'somechain-1', 'connection-0', 'connection-0', ); @@ -134,6 +136,7 @@ test('ICA connection can send msg with proto3', async t => { await EV.vat('bootstrap').consumeItem('orchestration'); const account = await EV(orchestration).makeAccount( + 'somechain-1', 'connection-0', 'connection-0', ); diff --git a/packages/orchestration/scripts/fetch-chain-info.ts b/packages/orchestration/scripts/fetch-chain-info.ts index 911d34c5e5d..5c0564f8624 100755 --- a/packages/orchestration/scripts/fetch-chain-info.ts +++ b/packages/orchestration/scripts/fetch-chain-info.ts @@ -21,6 +21,7 @@ const outputFile = 'src/fetched-chain-info.js'; * Names for which to fetch info */ const chainNames = [ + 'agoric', 'celestia', 'cosmoshub', 'dydx', diff --git a/packages/orchestration/src/chain-info.js b/packages/orchestration/src/chain-info.js index 6363b9655f2..90ed61d885f 100644 --- a/packages/orchestration/src/chain-info.js +++ b/packages/orchestration/src/chain-info.js @@ -10,7 +10,9 @@ import fetchedChainInfo from './fetched-chain-info.js'; const knownChains = /** @satisfies {Record} */ ( harden({ ...fetchedChainInfo, - agoric: { + // XXX does not have useful connections + // UNTIL https://github.com/Agoric/agoric-sdk/issues/9492 + agoriclocal: { chainId: 'agoriclocal', connections: { 'cosmoshub-4': { diff --git a/packages/orchestration/src/examples/stakeIca.contract.js b/packages/orchestration/src/examples/stakeIca.contract.js index cf2285fa944..e1093857d8f 100644 --- a/packages/orchestration/src/examples/stakeIca.contract.js +++ b/packages/orchestration/src/examples/stakeIca.contract.js @@ -19,6 +19,7 @@ const trace = makeTracer('StakeAtom'); export const meta = harden({ customTermsShape: { + chainId: M.string(), hostConnectionId: M.string(), controllerConnectionId: M.string(), bondDenom: M.string(), @@ -34,6 +35,7 @@ export const privateArgsShape = meta.privateArgsShape; /** * @typedef {{ + * chainId: string; * hostConnectionId: IBCConnectionID; * controllerConnectionId: IBCConnectionID; * bondDenom: string; @@ -51,8 +53,7 @@ export const privateArgsShape = meta.privateArgsShape; * @param {Baggage} baggage */ export const start = async (zcf, privateArgs, baggage) => { - // TODO #9063 this roughly matches what we'll get from Chain.getChainInfo() - const { hostConnectionId, controllerConnectionId, bondDenom } = + const { chainId, hostConnectionId, controllerConnectionId, bondDenom } = zcf.getTerms(); const { orchestration, marshaller, storageNode, timer } = privateArgs; @@ -68,6 +69,7 @@ export const start = async (zcf, privateArgs, baggage) => { async function makeAccountKit() { const account = await E(orchestration).makeAccount( + chainId, hostConnectionId, controllerConnectionId, ); diff --git a/packages/orchestration/src/examples/swapExample.contract.js b/packages/orchestration/src/examples/swapExample.contract.js index 34c0f83a16e..9c138c393ae 100644 --- a/packages/orchestration/src/examples/swapExample.contract.js +++ b/packages/orchestration/src/examples/swapExample.contract.js @@ -105,15 +105,15 @@ export const start = async (zcf, privateArgs, baggage) => { async (/** @type {Orchestrator} */ orch, { zcf }, seat, offerArgs) => { const { give } = seat.getProposal(); - const celestia = await orch.getChain('celestia'); + const omni = await orch.getChain('omniflixhub'); const agoric = await orch.getChain('agoric'); - const [celestiaAccount, localAccount] = await Promise.all([ - celestia.makeAccount(), + const [omniAccount, localAccount] = await Promise.all([ + omni.makeAccount(), agoric.makeAccount(), ]); - const tiaAddress = celestiaAccount.getAddress(); + const omniAddress = omniAccount.getAddress(); // deposit funds from user seat to LocalChainAccount const payments = await withdrawFromSeat(zcf, seat, give); @@ -122,8 +122,8 @@ export const start = async (zcf, privateArgs, baggage) => { // build swap instructions with orcUtils library const transferMsg = orcUtils.makeOsmosisSwap({ - destChain: 'celestia', - destAddress: tiaAddress, + destChain: 'omniflixhub', + destAddress: omniAddress, amountIn: give.Stable, brandOut: /** @type {any} */ ('FIXME'), slippage: 0.03, @@ -132,7 +132,7 @@ export const start = async (zcf, privateArgs, baggage) => { await localAccount .transferSteps(give.Stable, transferMsg) .then(_txResult => - celestiaAccount.delegate(offerArgs.validator, offerArgs.staked), + omniAccount.delegate(offerArgs.validator, offerArgs.staked), ) .catch(e => console.error(e)); diff --git a/packages/orchestration/src/examples/unbondExample.contract.js b/packages/orchestration/src/examples/unbondExample.contract.js index 6e0e67291cf..7bd5d2053e6 100644 --- a/packages/orchestration/src/examples/unbondExample.contract.js +++ b/packages/orchestration/src/examples/unbondExample.contract.js @@ -69,8 +69,8 @@ export const start = async (zcf, privateArgs, baggage) => { // We would actually alreaady have the account from the orchestrator // ??? could these be passed in? It would reduce the size of this handler, // keeping it focused on long-running operations. - const celestia = await orch.getChain('celestia'); - const celestiaAccount = await celestia.makeAccount(); + const omni = await orch.getChain('omniflixhub'); + const omniAccount = await omni.makeAccount(); // TODO implement these // const delegations = await celestiaAccount.getDelegations(); @@ -86,7 +86,7 @@ export const start = async (zcf, privateArgs, baggage) => { // await celestiaAccount.transfer(tiaAmt, strideAccount.getAddress()); // await strideAccount.liquidStake(tiaAmt); - console.log(celestiaAccount, strideAccount); + console.log(omniAccount, strideAccount); }, ); diff --git a/packages/orchestration/src/exos/chainAccountKit.js b/packages/orchestration/src/exos/chainAccountKit.js index 01f3d92afe5..35d20c5583d 100644 --- a/packages/orchestration/src/exos/chainAccountKit.js +++ b/packages/orchestration/src/exos/chainAccountKit.js @@ -45,6 +45,7 @@ export const ChainAccountI = M.interface('ChainAccount', { /** * @typedef {{ + * chainId: string; * port: Port; * connection: Remote | undefined; * localAddress: LocalIbcAddress | undefined; @@ -60,11 +61,13 @@ export const prepareChainAccountKit = zone => 'ChainAccountKit', { account: ChainAccountI, connectionHandler: ConnectionHandlerI }, /** + * @param {string} chainId * @param {Port} port * @param {string} requestedRemoteAddress */ - (port, requestedRemoteAddress) => + (chainId, port, requestedRemoteAddress) => /** @type {State} */ ({ + chainId, port, connection: undefined, requestedRemoteAddress, @@ -158,9 +161,7 @@ export const prepareChainAccountKit = zone => this.state.localAddress = localAddr; this.state.chainAddress = harden({ address: findAddressField(remoteAddr) || UNPARSABLE_CHAIN_ADDRESS, - // TODO get this from `Chain` object #9063 - // XXX how do we get a chainId for an unknown chain? seems it may need to be a user supplied arg - chainId: 'FIXME', + chainId: this.state.chainId, addressEncoding: 'bech32', }); }, diff --git a/packages/orchestration/src/facade.js b/packages/orchestration/src/facade.js index c152ead7996..1eec138dbbb 100644 --- a/packages/orchestration/src/facade.js +++ b/packages/orchestration/src/facade.js @@ -6,10 +6,11 @@ import { prepareCosmosOrchestrationAccount } from './exos/cosmosOrchestrationAcc /** * @import {Zone} from '@agoric/zone'; * @import {TimerService} from '@agoric/time'; + * @import {IBCConnectionID} from '@agoric/vats'; * @import {LocalChain} from '@agoric/vats/src/localchain.js'; * @import {Remote} from '@agoric/internal'; * @import {OrchestrationService} from './service.js'; - * @import {Chain, ChainInfo, CosmosChainInfo, OrchestrationAccount, Orchestrator} from './types.js'; + * @import {Chain, ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount, Orchestrator} from './types.js'; */ /** @type {any} */ @@ -91,6 +92,7 @@ const makeLocalChainFacade = ( /** * @template {CosmosChainInfo} CCI * @param {CCI} chainInfo + * @param {IBCConnectionInfo} connectionInfo * @param {object} io * @param {Remote} io.orchestration * @param {Remote} io.timer @@ -100,13 +102,12 @@ const makeLocalChainFacade = ( */ const makeRemoteChainFacade = ( chainInfo, + connectionInfo, { orchestration, timer, zcf, zone }, ) => { - const name = chainInfo.chainId; - const makeRecorderKit = () => anyVal; const makeCosmosOrchestrationAccount = prepareCosmosOrchestrationAccount( - zone.subZone(name), + zone.subZone(chainInfo.chainId), makeRecorderKit, zcf, ); @@ -115,14 +116,13 @@ const makeRemoteChainFacade = ( getChainInfo: async () => chainInfo, /** @returns {Promise>} */ makeAccount: async () => { - // FIXME look up real values - // UNTIL https://github.com/Agoric/agoric-sdk/issues/9063 - const hostConnectionId = 'connection-1'; - const controllerConnectionId = 'connection-2'; - const icaAccount = await E(orchestration).makeAccount( - hostConnectionId, - controllerConnectionId, + chainInfo.chainId, + // XXX IBCConnectionInfo concessions for JSON encoding + /** @type {IBCConnectionID} */ (connectionInfo.id), + /** @type {IBCConnectionID} */ ( + connectionInfo.counterparty.connection_id + ), ); const address = await E(icaAccount).getAddress(); @@ -190,17 +190,23 @@ export const makeOrchestrationFacade = ({ /** @type {Orchestrator} */ const orc = { async getChain(name) { - const chainInfo = await chainHub.getChainInfo(name); + const agoricChainInfo = await chainHub.getChainInfo('agoric'); if (name === 'agoric') { return makeLocalChainFacade( localchain, makeLocalChainAccountKit, - chainInfo, + agoricChainInfo, ); } - return makeRemoteChainFacade(chainInfo, { + const remoteChainInfo = await chainHub.getChainInfo(name); + const connectionInfo = await chainHub.getConnectionInfo( + agoricChainInfo.chainId, + remoteChainInfo.chainId, + ); + + return makeRemoteChainFacade(remoteChainInfo, connectionInfo, { orchestration: orchestrationService, timer: timerService, zcf, diff --git a/packages/orchestration/src/fetched-chain-info.js b/packages/orchestration/src/fetched-chain-info.js index 073a62a2899..fc460d5a705 100644 --- a/packages/orchestration/src/fetched-chain-info.js +++ b/packages/orchestration/src/fetched-chain-info.js @@ -1,5 +1,141 @@ /** @file Generated by fetch-chain-info.ts */ export default { + agoric: { + chainId: 'agoric-3', + stakingTokens: [ + { + denom: 'ubld', + }, + ], + connections: { + 'cosmoshub-4': { + id: 'connection-8', + client_id: '07-tendermint-6', + counterparty: { + client_id: '07-tendermint-927', + connection_id: 'connection-649', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-405', + portId: 'transfer', + counterPartyChannelId: 'channel-5', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, + 'noble-1': { + id: 'connection-72', + client_id: '07-tendermint-77', + counterparty: { + client_id: '07-tendermint-32', + connection_id: 'connection-40', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-21', + portId: 'transfer', + counterPartyChannelId: 'channel-62', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, + 'omniflixhub-1': { + id: 'connection-67', + client_id: '07-tendermint-73', + counterparty: { + client_id: '07-tendermint-47', + connection_id: 'connection-40', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-30', + portId: 'transfer', + counterPartyChannelId: 'channel-58', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, + 'osmosis-1': { + id: 'connection-1', + client_id: '07-tendermint-1', + counterparty: { + client_id: '07-tendermint-2109', + connection_id: 'connection-1649', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-320', + portId: 'transfer', + counterPartyChannelId: 'channel-1', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, + 'secret-4': { + id: 'connection-17', + client_id: '07-tendermint-17', + counterparty: { + client_id: '07-tendermint-111', + connection_id: 'connection-80', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-51', + portId: 'transfer', + counterPartyChannelId: 'channel-10', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, + 'stride-1': { + id: 'connection-68', + client_id: '07-tendermint-74', + counterparty: { + client_id: '07-tendermint-129', + connection_id: 'connection-118', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-148', + portId: 'transfer', + counterPartyChannelId: 'channel-59', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, + }, + }, celestia: { chainId: 'celestia', stakingTokens: [ @@ -123,6 +259,27 @@ export default { }, ], connections: { + 'agoric-3': { + id: 'connection-649', + client_id: '07-tendermint-927', + counterparty: { + client_id: '07-tendermint-6', + connection_id: 'connection-8', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-5', + portId: 'transfer', + counterPartyChannelId: 'channel-405', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, 'juno-1': { id: 'connection-372', client_id: '07-tendermint-439', @@ -751,6 +908,27 @@ export default { }, ], connections: { + 'agoric-3': { + id: 'connection-40', + client_id: '07-tendermint-32', + counterparty: { + client_id: '07-tendermint-77', + connection_id: 'connection-72', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-62', + portId: 'transfer', + counterPartyChannelId: 'channel-21', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, 'cosmoshub-4': { id: 'connection-12', client_id: '07-tendermint-4', @@ -929,6 +1107,27 @@ export default { }, ], connections: { + 'agoric-3': { + id: 'connection-40', + client_id: '07-tendermint-47', + counterparty: { + client_id: '07-tendermint-73', + connection_id: 'connection-67', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-58', + portId: 'transfer', + counterPartyChannelId: 'channel-30', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, 'cosmoshub-4': { id: 'connection-19', client_id: '07-tendermint-23', @@ -1003,6 +1202,27 @@ export default { ], icqEnabled: true, connections: { + 'agoric-3': { + id: 'connection-1649', + client_id: '07-tendermint-2109', + counterparty: { + client_id: '07-tendermint-1', + connection_id: 'connection-1', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-1', + portId: 'transfer', + counterPartyChannelId: 'channel-320', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, celestia: { id: 'connection-2503', client_id: '07-tendermint-3012', @@ -1223,6 +1443,27 @@ export default { }, ], connections: { + 'agoric-3': { + id: 'connection-80', + client_id: '07-tendermint-111', + counterparty: { + client_id: '07-tendermint-17', + connection_id: 'connection-17', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-10', + portId: 'transfer', + counterPartyChannelId: 'channel-51', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, celestia: { id: 'connection-131', client_id: '07-tendermint-174', @@ -1579,6 +1820,27 @@ export default { }, ], connections: { + 'agoric-3': { + id: 'connection-118', + client_id: '07-tendermint-129', + counterparty: { + client_id: '07-tendermint-74', + connection_id: 'connection-68', + prefix: { + key_prefix: 'FIXME', + }, + }, + state: 3, + transferChannel: { + channelId: 'channel-59', + portId: 'transfer', + counterPartyChannelId: 'channel-148', + counterPartyPortId: 'transfer', + ordering: 0, + state: 3, + version: 'ics20-1', + }, + }, celestia: { id: 'connection-125', client_id: '07-tendermint-137', diff --git a/packages/orchestration/src/proposals/start-stakeAtom.js b/packages/orchestration/src/proposals/start-stakeAtom.js index 5316b9c76bf..496072edd01 100644 --- a/packages/orchestration/src/proposals/start-stakeAtom.js +++ b/packages/orchestration/src/proposals/start-stakeAtom.js @@ -48,10 +48,11 @@ export const startStakeAtom = async ({ const chainHub = makeChainHub(await agoricNames); + const agoric = await chainHub.getChainInfo('agoric'); const cosmoshub = await chainHub.getChainInfo('cosmoshub'); const connectionInfo = await chainHub.getConnectionInfo( - 'agoriclocal', - 'cosmoshub-4', + agoric.chainId, + cosmoshub.chainId, ); /** @type {StartUpgradableOpts} */ @@ -60,6 +61,7 @@ export const startStakeAtom = async ({ installation: stakeIca, issuerKeywordRecord: harden({ ATOM: atomIssuer }), terms: { + chainId: cosmoshub.chainId, hostConnectionId: /** @type {IBCConnectionID} */ (connectionInfo.id), controllerConnectionId: /** @type {IBCConnectionID} */ ( connectionInfo.counterparty.connection_id diff --git a/packages/orchestration/src/service.js b/packages/orchestration/src/service.js index 6435e07713a..3c203914296 100644 --- a/packages/orchestration/src/service.js +++ b/packages/orchestration/src/service.js @@ -51,7 +51,7 @@ const getPower = (powers, name) => { }; export const OrchestrationI = M.interface('Orchestration', { - makeAccount: M.callWhen(M.string(), M.string()).returns( + makeAccount: M.callWhen(M.string(), M.string(), M.string()).returns( M.remotable('ChainAccount'), ), provideICQConnection: M.callWhen(M.string()).returns( @@ -109,19 +109,24 @@ const prepareOrchestrationKit = ( }, public: { /** + * @param {string} chainId * @param {IBCConnectionID} hostConnectionId the counterparty * connection_id * @param {IBCConnectionID} controllerConnectionId self connection_id * @returns {Promise} */ - async makeAccount(hostConnectionId, controllerConnectionId) { + async makeAccount(chainId, hostConnectionId, controllerConnectionId) { const port = await this.facets.self.allocateICAControllerPort(); const remoteConnAddr = makeICAChannelAddress( hostConnectionId, controllerConnectionId, ); - const chainAccountKit = makeChainAccountKit(port, remoteConnAddr); + const chainAccountKit = makeChainAccountKit( + chainId, + port, + remoteConnAddr, + ); // await so we do not return a ChainAccount before it successfully instantiates await E(port).connect( diff --git a/packages/orchestration/src/utils/chainHub.js b/packages/orchestration/src/utils/chainHub.js index 25194797d7e..d1df713d5c1 100644 --- a/packages/orchestration/src/utils/chainHub.js +++ b/packages/orchestration/src/utils/chainHub.js @@ -104,22 +104,22 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => { return chainInfo; }, /** - * @param {string} srcChainId - * @param {string} destChainId + * @param {string} chainId1 + * @param {string} chainId2 * @param {IBCConnectionInfo} connectionInfo */ - registerConnection(srcChainId, destChainId, connectionInfo) { - const key = connectionKey(srcChainId, destChainId); + registerConnection(chainId1, chainId2, connectionInfo) { + const key = connectionKey(chainId1, chainId2); connectionInfos.init(key, connectionInfo); }, /** - * @param {string} srcChainId - * @param {string} destChainId + * @param {string} chainId1 + * @param {string} chainId2 * @returns {Promise} */ - async getConnectionInfo(srcChainId, destChainId) { - const key = connectionKey(srcChainId, destChainId); + async getConnectionInfo(chainId1, chainId2) { + const key = connectionKey(chainId1, chainId2); if (connectionInfos.has(key)) { return connectionInfos.get(key); } @@ -127,9 +127,7 @@ export const makeChainHub = (agoricNames, zone = makeHeapZone()) => { const connectionInfo = await E(agoricNames) .lookup(CONNECTIONS_KEY, key) .catch(_cause => { - throw assert.error( - `connection not found: ${srcChainId}<->${destChainId}`, - ); + throw assert.error(`connection not found: ${chainId1}<->${chainId2}`); }); connectionInfos.init(key, connectionInfo); return connectionInfo; @@ -166,8 +164,8 @@ export const registerChain = async ( ]; // XXX updates redundantly, twice per edge - for await (const [destChainId, connInfo] of Object.entries(connections)) { - const key = connectionKey(chainInfo.chainId, destChainId); + for await (const [counterChainId, connInfo] of Object.entries(connections)) { + const key = connectionKey(chainInfo.chainId, counterChainId); promises.push( E(connAdmin) .update(key, connInfo) diff --git a/packages/orchestration/test/chain-info.test.js b/packages/orchestration/test/chain-info.test.js index 8a48a147b79..c779d74d17a 100644 --- a/packages/orchestration/test/chain-info.test.js +++ b/packages/orchestration/test/chain-info.test.js @@ -15,6 +15,7 @@ test('chain-info', async t => { }); t.deepEqual(chainNames.keys(), [ 'agoric', + 'agoriclocal', 'celestia', 'cosmoshub', 'dydx', diff --git a/packages/orchestration/test/examples/sendAnywhere.test.ts b/packages/orchestration/test/examples/sendAnywhere.test.ts index 1f8aee96148..6c5b44a23f7 100644 --- a/packages/orchestration/test/examples/sendAnywhere.test.ts +++ b/packages/orchestration/test/examples/sendAnywhere.test.ts @@ -164,7 +164,7 @@ test('send using arbitrary chain info', async t => { '@type': '/ibc.applications.transfer.v1.MsgTransfer', receiver: 'cosmos1destAddr', sender: execAddr, - sourceChannel: 'channel-1', + sourceChannel: 'channel-5', token: { amount: '1250000', denom: 'uist' }, }); } @@ -176,7 +176,7 @@ test('send using arbitrary chain info', async t => { 'hot', harden({ ...hotChainInfo, - connections: { agoriclocal: agoricToHotConnection }, + connections: { 'agoric-3': agoricToHotConnection }, }), ); diff --git a/packages/orchestration/test/examples/stake-atom.contract.test.ts b/packages/orchestration/test/examples/stake-atom.contract.test.ts index fa465e4c83e..31f8478b03e 100644 --- a/packages/orchestration/test/examples/stake-atom.contract.test.ts +++ b/packages/orchestration/test/examples/stake-atom.contract.test.ts @@ -28,6 +28,7 @@ const startContract = async ({ installation, { In: bld.issuer }, { + chainId: 'cosmoshub-4', hostConnectionId: 'connection-1', controllerConnectionId: 'connection-2', bondDenom: 'uatom', @@ -56,7 +57,7 @@ test('makeAccount, deposit, withdraw', async t => { const address = await E(account).getAddress(); // XXX address.address is weird // t.regex(address.address, /agoric1/); - t.like(address, { chainId: 'FIXME', addressEncoding: 'bech32' }); + t.like(address, { chainId: 'cosmoshub-4', addressEncoding: 'bech32' }); t.log('deposit 100 bld to account'); await E(account).deposit(await utils.pourPayment(ist.units(100))); diff --git a/packages/orchestration/test/exos/local-chain-account-kit.test.ts b/packages/orchestration/test/exos/local-chain-account-kit.test.ts index a1e9f1a4a28..0df46078a82 100644 --- a/packages/orchestration/test/exos/local-chain-account-kit.test.ts +++ b/packages/orchestration/test/exos/local-chain-account-kit.test.ts @@ -196,7 +196,7 @@ test('transfer', async t => { }; await t.throwsAsync( () => E(account).transfer({ denom: 'ubld', value: 1n }, unknownDestination), - { message: /connection not found: agoriclocal<->fakenet/ }, + { message: /connection not found: agoric-3<->fakenet/ }, 'cannot create transfer msg with unknown chainId', ); diff --git a/packages/orchestration/test/facade.test.ts b/packages/orchestration/test/facade.test.ts index 3d637205a91..28ede33b678 100644 --- a/packages/orchestration/test/facade.test.ts +++ b/packages/orchestration/test/facade.test.ts @@ -1,7 +1,7 @@ import { test as anyTest } from '@agoric/zoe/tools/prepare-test-env-ava.js'; import { setupZCFTest } from '@agoric/zoe/test/unitTests/zcf/setupZcfTest.js'; -import type { CosmosChainInfo } from '../src/cosmos-api.js'; +import type { CosmosChainInfo, IBCConnectionInfo } from '../src/cosmos-api.js'; import { makeOrchestrationFacade } from '../src/facade.js'; import type { Chain } from '../src/orchestration-api.js'; import { commonSetup } from './supports.js'; @@ -11,13 +11,33 @@ const test = anyTest; export const mockChainInfo: CosmosChainInfo = harden({ chainId: 'mock-1', - connections: {}, icaEnabled: false, icqEnabled: false, pfmEnabled: false, ibcHooksEnabled: false, stakingTokens: [{ denom: 'umock' }], }); +export const mockChainConnection: IBCConnectionInfo = { + id: 'connection-0', + client_id: '07-tendermint-2', + counterparty: { + client_id: '07-tendermint-2', + connection_id: 'connection-1', + prefix: { + key_prefix: '', + }, + }, + state: 3 /* IBCConnectionState.STATE_OPEN */, + transferChannel: { + portId: 'transfer', + channelId: 'channel-1', + counterPartyChannelId: 'channel-1', + counterPartyPortId: 'transfer', + ordering: 1 /* Order.ORDER_UNORDERED */, + state: 3 /* IBCConnectionState.STATE_OPEN */, + version: 'ics20-1', + }, +}; const makeLocalChainAccountKit = () => assert.fail(`not used`); @@ -39,6 +59,11 @@ test('chain info', async t => { }); chainHub.registerChain('mock', mockChainInfo); + chainHub.registerConnection( + 'agoric-3', + mockChainInfo.chainId, + mockChainConnection, + ); const handle = orchestrate('mock', {}, async orc => { return orc.getChain('mock'); diff --git a/packages/orchestration/test/snapshots/chain-info.test.js.md b/packages/orchestration/test/snapshots/chain-info.test.js.md index 7153e0dd24b..be1e99dbe93 100644 --- a/packages/orchestration/test/snapshots/chain-info.test.js.md +++ b/packages/orchestration/test/snapshots/chain-info.test.js.md @@ -11,6 +11,17 @@ Generated by [AVA](https://avajs.dev). [ [ 'agoric', + { + chainId: 'agoric-3', + stakingTokens: [ + { + denom: 'ubld', + }, + ], + }, + ], + [ + 'agoriclocal', { chainId: 'agoriclocal', }, diff --git a/packages/orchestration/test/snapshots/chain-info.test.js.snap b/packages/orchestration/test/snapshots/chain-info.test.js.snap index 351ff9eea0f..d8fbb0be254 100644 Binary files a/packages/orchestration/test/snapshots/chain-info.test.js.snap and b/packages/orchestration/test/snapshots/chain-info.test.js.snap differ diff --git a/packages/orchestration/test/supports.ts b/packages/orchestration/test/supports.ts index b75b1482bee..a74006bbb8e 100644 --- a/packages/orchestration/test/supports.ts +++ b/packages/orchestration/test/supports.ts @@ -108,7 +108,7 @@ export const commonSetup = async t => { const { portAllocator } = fakeNetworkEchoStuff(rootZone.subZone('network')); const { public: orchestration } = makeOrchestrationKit({ portAllocator }); - await registerChainNamespace(agoricNamesAdmin, t.log); + await registerChainNamespace(agoricNamesAdmin, () => {}); return { bootstrap: {