File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ RUN node -e 'console.log("Node.js runs")'
56
56
COPY --from=stacks-node-build /stacks-node stacks-node/
57
57
ENV PATH="$PATH:$HOME/stacks-node"
58
58
59
+ # ### Copy stacks-node mocknet config
60
+ COPY ./stacks-blockchain/Stacks-mocknet.toml ./
61
+
59
62
# ## Setup stacks-blockchain-api
60
63
COPY --from=build /app stacks-blockchain-api
61
64
RUN sudo chown -Rh stacky:stacky stacks-blockchain-api
@@ -100,12 +103,20 @@ ENV STACKS_CORE_RPC_PORT=20443
100
103
101
104
# ## Startup script & coordinator
102
105
RUN printf '#!/bin/bash\n \
106
+ trap "exit" INT TERM\n \
107
+ trap "kill 0" EXIT\n \
108
+ echo Your container args are: "$@"\n \
103
109
tail --retry -F stacks-api.log stacks-node.log 2>&1 &\n \
104
110
while true\n \
105
111
do\n \
106
112
pg_start\n \
107
113
stacks_api &> stacks-api.log &\n \
108
114
stacks_api_pid=$!\n \
115
+ if [ $1 = "mocknet" ]; then\n \
116
+ stacks-node start --config=/home/stacky/Stacks-mocknet.toml &> stacks-node.log &\n \
117
+ else\n \
118
+ stacks-node argon &> stacks-node.log &\n \
119
+ fi\n \
109
120
stacks-node argon &> stacks-node.log &\n \
110
121
stacks_node_pid=$!\n \
111
122
wait $stacks_node_pid\n \
@@ -117,4 +128,6 @@ do\n\
117
128
done\n \
118
129
' >> run.sh && chmod +x run.sh
119
130
131
+ ENTRYPOINT ["/home/stacky/run.sh" ]
132
+
120
133
CMD ["/home/stacky/run.sh" ]
Original file line number Diff line number Diff line change 6
6
7
7
## Quick start
8
8
9
- A self-contained Docker image is provided which will start a Stacks 2.0 blockchain and API testnet.
9
+ A self-contained Docker image is provided which starts a Stacks 2.0 blockchain and API instance connected to the testnet.
10
10
11
11
Ensure Docker is installed, then run the command:
12
12
13
13
```
14
14
docker run -p 3999:3999 blockstack/stacks-blockchain-api-standalone
15
15
```
16
16
17
+ Similarity, a "mocknet" instance can be started. This runs a local node, isolated from the testnet/mainnet:
18
+
19
+ ```
20
+ docker run -p 3999:3999 blockstack/stacks-blockchain-api-standalone mocknet
21
+ ```
22
+
23
+
17
24
Once the blockchain has synced with network, the API will be available at:
18
25
[ http://localhost:3999 ] ( http://localhost:3999 )
19
26
You can’t perform that action at this time.
0 commit comments