create-dubhe 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +44 -42
- package/package.json +1 -1
- package/template/101/rooch-template/.dockerignore +7 -0
- package/template/101/rooch-template/.eslintrc.json +3 -0
- package/template/101/rooch-template/.prettierrc +8 -0
- package/template/101/rooch-template/Dockerfile +52 -0
- package/template/101/rooch-template/LICENSE +674 -0
- package/template/101/rooch-template/README.md +14 -0
- package/template/101/rooch-template/contracts/counter/Move.toml +14 -0
- package/template/101/rooch-template/contracts/counter/sources/counter.move +48 -0
- package/template/101/rooch-template/dubhe.config.ts +14 -0
- package/template/101/rooch-template/jest.config.ts +17 -0
- package/template/101/rooch-template/next-env.d.ts +5 -0
- package/template/101/rooch-template/next-i18next.config.js +6 -0
- package/template/101/rooch-template/next.config.js +15 -0
- package/template/101/rooch-template/package.json +72 -0
- package/template/101/rooch-template/postcss.config.js +6 -0
- package/template/101/rooch-template/public/discord.svg +9 -0
- package/template/101/rooch-template/public/fail.svg +12 -0
- package/template/101/rooch-template/public/favicon.ico +0 -0
- package/template/101/rooch-template/public/locales/de/common.json +8 -0
- package/template/101/rooch-template/public/locales/de/footer.json +3 -0
- package/template/101/rooch-template/public/locales/de/second-page.json +5 -0
- package/template/101/rooch-template/public/locales/en/common.json +8 -0
- package/template/101/rooch-template/public/locales/en/footer.json +3 -0
- package/template/101/rooch-template/public/locales/en/second-page.json +5 -0
- package/template/101/rooch-template/public/locales/zn/common.json +8 -0
- package/template/101/rooch-template/public/locales/zn/footer.json +3 -0
- package/template/101/rooch-template/public/locales/zn/second-page.json +5 -0
- package/template/101/rooch-template/public/logo.svg +1 -0
- package/template/101/rooch-template/public/medium.svg +9 -0
- package/template/101/rooch-template/public/successful.svg +11 -0
- package/template/101/rooch-template/public/telegram.svg +9 -0
- package/template/101/rooch-template/public/twitter.svg +9 -0
- package/template/101/rooch-template/scripts/checkBalance.ts +37 -0
- package/template/101/rooch-template/scripts/generateAccount.ts +55 -0
- package/template/101/rooch-template/scripts/storeConfig.ts +52 -0
- package/template/101/rooch-template/scripts/waitNode.ts +9 -0
- package/template/101/rooch-template/src/chain/config.ts +5 -0
- package/template/101/rooch-template/src/css/font-awesome.css +2337 -0
- package/template/101/rooch-template/src/css/font-awesome.min.css +4 -0
- package/template/101/rooch-template/src/fonts/FontAwesome.otf +0 -0
- package/template/101/rooch-template/src/fonts/fontawesome-webfont.eot +0 -0
- package/template/101/rooch-template/src/fonts/fontawesome-webfont.svg +2671 -0
- package/template/101/rooch-template/src/fonts/fontawesome-webfont.ttf +0 -0
- package/template/101/rooch-template/src/fonts/fontawesome-webfont.woff +0 -0
- package/template/101/rooch-template/src/fonts/fontawesome-webfont.woff2 +0 -0
- package/template/101/rooch-template/src/jotai/index.tsx +12 -0
- package/template/101/rooch-template/src/pages/_app.tsx +9 -0
- package/template/101/rooch-template/src/pages/home/index.tsx +82 -0
- package/template/101/rooch-template/src/pages/index.tsx +14 -0
- package/template/101/rooch-template/tailwind.config.js +56 -0
- package/template/101/rooch-template/tsconfig.json +25 -0
- package/template/101/sui-template/contracts/counter/Move.toml +3 -3
- package/template/101/sui-template/contracts/counter/sources/codegen/schema_hub.move +60 -0
- package/template/101/sui-template/contracts/counter/sources/codegen/schemas/counter.move +17 -15
- package/template/101/sui-template/contracts/counter/sources/script/deploy_hook.move +37 -19
- package/template/101/sui-template/contracts/counter/sources/script/migrate.move +8 -0
- package/template/101/sui-template/localnet/dubhe-framework/Move.toml +6 -16
- package/template/{nextjs/sui-template/localnet/dubhe-framework/sources/schemas/dapps/dapps.move → 101/sui-template/localnet/dubhe-framework/sources/core/dapps/schema.move} +12 -2
- package/template/101/sui-template/localnet/dubhe-framework/sources/core/dapps/system.move +75 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/core/dapps/tests.move +52 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/core/root/schema.move +33 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/core/root/system.move +24 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/core/root/tests.move +39 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/frames/utils/type_info.move +29 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/storages/double_map.move +0 -3
- package/template/101/sui-template/localnet/dubhe-framework/sources/storages/map.move +0 -3
- package/template/101/sui-template/localnet/dubhe-framework/sources/storages/migrate.move +19 -0
- package/template/101/sui-template/localnet/dubhe-framework/sources/storages/value.move +0 -3
- package/template/101/sui-template/package.json +19 -27
- package/template/101/sui-template/scripts/deployment/testnet/deploy.ts +2 -2
- package/template/101/sui-template/src/chain/config.ts +3 -3
- package/template/cocos/sui-template/assets/lib/dubhe.js +21 -1
- package/template/cocos/sui-template/contracts/counter/Move.toml +1 -1
- package/template/cocos/sui-template/package.json +3 -3
- package/template/contract/sui-template/contracts/counter/Move.toml +13 -0
- package/template/contract/sui-template/contracts/counter/sources/codegen/dapp_key.move +16 -0
- package/template/contract/sui-template/contracts/counter/sources/codegen/schema_hub.move +60 -0
- package/template/contract/sui-template/contracts/counter/sources/codegen/schemas/counter.move +60 -0
- package/template/contract/sui-template/contracts/counter/sources/script/deploy_hook.move +85 -0
- package/template/contract/sui-template/contracts/counter/sources/script/migrate.move +8 -0
- package/template/contract/sui-template/dubhe.config.ts +14 -0
- package/template/contract/sui-template/localnet/dubhe-framework/Move.toml +29 -0
- package/template/{101/sui-template/localnet/dubhe-framework/sources/schemas/dapps/dapps.move → contract/sui-template/localnet/dubhe-framework/sources/core/dapps/schema.move} +12 -2
- package/template/contract/sui-template/localnet/dubhe-framework/sources/core/dapps/system.move +75 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/core/dapps/tests.move +52 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/core/root/schema.move +33 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/core/root/system.move +24 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/core/root/tests.move +39 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/frames/utils/type_info.move +29 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/storages/double_map.move +153 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/storages/map.move +156 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/storages/migrate.move +19 -0
- package/template/contract/sui-template/localnet/dubhe-framework/sources/storages/value.move +97 -0
- package/template/contract/sui-template/localnet/dubhe-framework/tests/init.move +6 -0
- package/template/contract/sui-template/localnet/dubhe-framework/tests/obelisk_framework_tests.move +19 -0
- package/template/contract/sui-template/package.json +28 -0
- package/template/contract/sui-template/scripts/checkBalance.ts +40 -0
- package/template/contract/sui-template/scripts/deployment/common.ts +45 -0
- package/template/contract/sui-template/scripts/deployment/localnet/deploy.ts +42 -0
- package/template/contract/sui-template/scripts/deployment/testnet/deploy.ts +48 -0
- package/template/contract/sui-template/scripts/deployment/types.ts +13 -0
- package/template/contract/sui-template/scripts/framework/common.ts +17 -0
- package/template/contract/sui-template/scripts/framework/deploy.ts +199 -0
- package/template/contract/sui-template/scripts/framework/parse-history.ts +76 -0
- package/template/contract/sui-template/scripts/framework/types.ts +8 -0
- package/template/contract/sui-template/scripts/generateAccount.ts +37 -0
- package/template/contract/sui-template/tsconfig.json +35 -0
- package/template/nextjs/sui-template/contracts/counter/Move.toml +3 -3
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/schema_hub.move +60 -0
- package/template/nextjs/sui-template/contracts/counter/sources/codegen/schemas/counter.move +17 -15
- package/template/nextjs/sui-template/contracts/counter/sources/script/deploy_hook.move +37 -19
- package/template/nextjs/sui-template/contracts/counter/sources/script/migrate.move +8 -0
- package/template/nextjs/sui-template/contracts/counter/sources/systems/counter.move +11 -0
- package/template/nextjs/sui-template/dubhe.config.ts +2 -2
- package/template/nextjs/sui-template/localnet/dubhe-framework/Move.toml +6 -16
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/dapps/metadata.move +96 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/dapps/schema.move +83 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/dapps/system.move +75 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/dapps/tests.move +52 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/root/schema.move +33 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/root/system.move +24 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/core/root/tests.move +39 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/frames/utils/type_info.move +29 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/storages/double_map.move +0 -3
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/storages/map.move +0 -3
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/storages/migrate.move +19 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/storages/tests.move +398 -0
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/storages/value.move +0 -3
- package/template/nextjs/sui-template/package.json +19 -27
- package/template/nextjs/sui-template/scripts/deployment/testnet/deploy.ts +2 -2
- package/template/nextjs/sui-template/src/chain/config.ts +2 -2
- package/template/101/sui-template/localnet/dubhe-framework/README.md +0 -18
- package/template/101/sui-template/localnet/dubhe-framework/sources/access_control.move +0 -35
- package/template/101/sui-template/localnet/dubhe-framework/sources/events.move +0 -23
- package/template/101/sui-template/localnet/dubhe-framework/sources/resource_id.move +0 -22
- package/template/101/sui-template/localnet/dubhe-framework/sources/resource_types.move +0 -18
- package/template/101/sui-template/localnet/dubhe-framework/sources/schema.move +0 -36
- package/template/101/sui-template/localnet/dubhe-framework/sources/systems/dapps.move +0 -90
- package/template/101/sui-template/localnet/dubhe-framework/sources/world.move +0 -81
- package/template/101/sui-template/localnet/dubhe-framework/tests/dapp.move +0 -16
- package/template/nextjs/sui-template/localnet/dubhe-framework/README.md +0 -18
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/access_control.move +0 -35
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/events.move +0 -23
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/resource_id.move +0 -22
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/resource_types.move +0 -18
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/schema.move +0 -36
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/systems/dapps.move +0 -90
- package/template/nextjs/sui-template/localnet/dubhe-framework/sources/world.move +0 -81
- package/template/nextjs/sui-template/localnet/dubhe-framework/tests/dapp.move +0 -16
- /package/template/101/sui-template/contracts/counter/sources/{system → systems}/counter.move +0 -0
- /package/template/101/sui-template/localnet/dubhe-framework/sources/{schemas → core}/dapps/metadata.move +0 -0
- /package/template/101/sui-template/localnet/dubhe-framework/{tests/storage.move → sources/storages/tests.move} +0 -0
- /package/template/{nextjs/sui-template/contracts/counter/sources/system → contract/sui-template/contracts/counter/sources/systems}/counter.move +0 -0
- /package/template/{nextjs/sui-template/localnet/dubhe-framework/sources/schemas → contract/sui-template/localnet/dubhe-framework/sources/core}/dapps/metadata.move +0 -0
- /package/template/{nextjs/sui-template/localnet/dubhe-framework/tests/storage.move → contract/sui-template/localnet/dubhe-framework/sources/storages/tests.move} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as fsAsync from 'fs/promises';
|
|
2
|
+
import { mkdirSync, writeFileSync } from 'fs';
|
|
3
|
+
import { exit } from 'process';
|
|
4
|
+
import { dubheConfig } from '../dubhe.config';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
|
|
7
|
+
type DeploymentJsonType = {
|
|
8
|
+
projectName: string;
|
|
9
|
+
network: 'mainnet' | 'testnet' | 'devnet' | 'localnet';
|
|
10
|
+
packageId: string;
|
|
11
|
+
version: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
async function getDeploymentJson(projectPath: string, network: string) {
|
|
15
|
+
try {
|
|
16
|
+
const data = await fsAsync.readFile(`${projectPath}/.history/rooch_${network}/latest.json`, 'utf8');
|
|
17
|
+
return JSON.parse(data) as DeploymentJsonType;
|
|
18
|
+
} catch {
|
|
19
|
+
console.log('store config failed.');
|
|
20
|
+
exit;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function storeConfig(network: string, packageId: string) {
|
|
25
|
+
let code = `type NetworkType = 'testnet' | 'mainnet' | 'devnet' | 'localnet';
|
|
26
|
+
|
|
27
|
+
export const NETWORK: NetworkType = '${network}';
|
|
28
|
+
|
|
29
|
+
export const PACKAGE_ID = '${packageId}'
|
|
30
|
+
`;
|
|
31
|
+
const path = process.cwd();
|
|
32
|
+
writeOutput(code, `${path}/src/chain/config.ts`, 'storeConfig');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function writeOutput(output: string, fullOutputPath: string, logPrefix?: string): Promise<void> {
|
|
36
|
+
mkdirSync(dirname(fullOutputPath), { recursive: true });
|
|
37
|
+
|
|
38
|
+
writeFileSync(fullOutputPath, output);
|
|
39
|
+
if (logPrefix !== undefined) {
|
|
40
|
+
console.log(`${logPrefix}: ${fullOutputPath}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function main() {
|
|
45
|
+
const path = process.cwd();
|
|
46
|
+
const network = process.argv[2];
|
|
47
|
+
const contractPath = `${path}/contracts/${dubheConfig.name}`;
|
|
48
|
+
const deployment = await getDeploymentJson(contractPath, network);
|
|
49
|
+
storeConfig(deployment.network, deployment.packageId);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
main();
|