Files
Yuanhai He 4d80ef4f17 feat: dev-stack & bootstrap (#12)
* feat: dev-stack & bootstrap

Signed-off-by: bestmike007 <i@bestmike007.com>

* chore: contract codegen

Signed-off-by: bestmike007 <i@bestmike007.com>

* chore: add depends_on

Signed-off-by: bestmike007 <i@bestmike007.com>

---------

Signed-off-by: bestmike007 <i@bestmike007.com>
2023-08-25 14:55:53 +08:00

32 lines
854 B
TypeScript

import path from 'path';
import {
DEPLOYER_ACCOUNT_ADDRESS,
DEPLOYER_ACCOUNT_SECRETKEY,
STACKS_API_URL,
} from './constants';
import { Contracts } from './contracts/contractNames';
import { deployContracts } from './setup/deployContracts';
import { sleep } from './utils';
import { getAccountInfo, processOperations } from './utils/processOperations';
(async () => {
while (true) {
try {
await getAccountInfo(DEPLOYER_ACCOUNT_ADDRESS());
break;
} catch (e) {
console.log(
`waiting for connecting stacks-node-api: ${STACKS_API_URL()}`,
);
await sleep(500);
}
}
console.log(`starting deploy: ${STACKS_API_URL()}`);
await processOperations(
DEPLOYER_ACCOUNT_ADDRESS(),
DEPLOYER_ACCOUNT_SECRETKEY(),
10 * 1e6,
)(deployContracts(Contracts, path.resolve(__dirname, '..')));
})();