mirror of
https://github.com/alexgo-io/brc20-indexer-contracts.git
synced 2026-01-12 14:34:24 +08:00
* 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>
32 lines
854 B
TypeScript
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, '..')));
|
|
})();
|