This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
forked from playmint/ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.devstartup.js
81 lines (68 loc) · 2.76 KB
/
.devstartup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const concurrently = require('concurrently');
const path = require('path');
const { execSync } = require("child_process");
// ------------------------------------------------------------------
// this is a startup script for running a local build of downstream
// ------------------------------------------------------------------
//
const SEQUENCER_PRIVATE_KEY = "095a37ef5b5d87db7fe50551725cb64804c8c554868d3d729c0dd17f0e664c87";
const DEPLOYER_PRIVATE_KEY = "0x6335c92c05660f35b36148bbfb2105a68dd40275ebf16eff9524d487fb5d57a8";
// configure services to run
const commands = [
{
name: 'networks',
command: "anvil -m 'thunder road vendor cradle rigid subway isolate ridge feel illegal whale lens' --block-time 2 --block-base-fee-per-gas 1 --transaction-block-keeper 25 --prune-history",
prefixColor: 'black',
},
{
name: 'contract',
command: `./lib/cog/services/bin/wait-for -it localhost:8545 -t 300 \
&& forge script script/Deploy.sol:GameDeployer --broadcast --rpc-url "http://localhost:8545" \
&& ./lib/cog/services/bin/wait-for -it localhost:8080 -t 300 \
&& sleep 2 \
&& ds -k ${DEPLOYER_PRIVATE_KEY} -n local apply -R -f ./src/fixtures/ --max-connections 500 \
&& ds -k ${DEPLOYER_PRIVATE_KEY} -n local apply -R -f ./src/example-plugins/ --max-connections 500 \
&& sleep 9999999`,
prefixColor: 'black',
env: {
DEPLOYER_PRIVATE_KEY,
},
cwd: path.resolve(__dirname, path.join('contracts')),
},
{
name: 'services',
command: './bin/wait-for -it localhost:8545 -t 300 && ./bin/ds-node',
env: {
PORT: "8181",
CHAIN_ID: "1337",
SEQUENCER_PRIVATE_KEY,
SEQUENCER_PROVIDER_URL_HTTP: "http://localhost:8545",
SEQUENCER_PROVIDER_URL_WS: "ws://localhost:8545",
INDEXER_WATCH_PENDING: "false",
INDEXER_PROVIDER_URL_HTTP: "http://localhost:8545",
INDEXER_PROVIDER_URL_WS: "ws://localhost:8545",
},
prefixColor: 'yellow',
cwd: path.resolve(__dirname, path.join('contracts', 'lib', 'cog', 'services')),
},
{
name: ' client ',
command: 'npm run dev --workspace=frontend -- -p 3000',
prefixColor: 'blueBright',
},
{
name: ' core ',
command: 'npm run build:watch --workspace=core',
prefixColor: 'blueBright',
},
];
// run everything concurrently. if one exits, they all exit.
const processes = concurrently(commands, {
prefix: 'name',
prefixColors: 'auto',
killOthers: ['failure', 'success'],
restartTries: 1,
});
processes.result
.then(() => console.log('shutdown'))
.catch(() => console.error('stopped'));