diff --git a/.gitignore b/.gitignore index 281be19..8be79ba 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /tmp result venv +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8ecb2f9..aa54378 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,11 +9,15 @@ FROM debian:buster AS build # Allow users to specify forked node, or specific commit # If not fallback to release branch (or alternatively just specify branch) ARG NODE_REPO=https://github.com/casper-network/casper-node.git -ARG NODE_COMMIT= ARG CLIENT_REPO=https://github.com/casper-ecosystem/casper-client-rs.git -ARG CLIENT_COMMIT= -ARG NODE_GITBRANCH=release-1.5.6 -ARG CLIENT_GITBRANCH=release-2.0.0 +ARG SIDECAR_REPO=https://github.com/casper-network/casper-sidecar.git + +ARG NODE_COMMIT= +ARG NODE_GITBRANCH=release-2.0.0-rc3 +ARG CLIENT_GITBRANCH=feat-track-node-2.0 +ARG CLIENT_COMMIT=317051ddfb372d9404850c6a1787f225d6d32b4e +ARG SIDECAR_GITBRANCH=release-1.0.0rc2_node-2.0.0rc3 +ARG SIDECAR_COMMIT= RUN apt-get update \ && DEBIAN_FRONTEND="noninteractive" \ @@ -30,14 +34,19 @@ ENV PATH="$PATH:/root/.cargo/bin" RUN git clone https://github.com/casper-network/casper-node-launcher.git RUN if [ -n "$NODE_COMMIT" ]; then \ - git clone -b $NODE_COMMIT $NODE_REPO; \ + git clone $NODE_REPO && cd casper-node && git checkout $NODE_COMMIT && cd ..; \ else \ git clone -b $NODE_GITBRANCH $NODE_REPO; \ fi \ && if [ -n "$CLIENT_COMMIT" ]; then \ - git clone -b $CLIENT_COMMIT $CLIENT_REPO; \ + git clone $CLIENT_REPO && cd casper-client-rs && git checkout $CLIENT_COMMIT && cd ..; \ else \ git clone -b $CLIENT_GITBRANCH $CLIENT_REPO; \ + fi \ + && if [ -n "$SIDECAR_COMMIT" ]; then \ + git clone $SIDECAR_REPO && cd casper-sidecar && git checkout $SIDECAR_COMMIT && cd ..; \ + else \ + git clone -b $SIDECAR_GITBRANCH $SIDECAR_REPO; \ fi # Local CCTL source code. @@ -76,6 +85,7 @@ WORKDIR /home/cctl COPY --from=build --chown=cctl:cctl /casper-node-launcher ./casper-node-launcher COPY --from=build --chown=cctl:cctl /casper-client-rs ./casper-client-rs COPY --from=build --chown=cctl:cctl /casper-node ./casper-node +COPY --from=build --chown=cctl:cctl /casper-sidecar ./casper-sidecar COPY --from=build --chown=cctl:cctl /cctl ./cctl ENV CCTL="/home/cctl/cctl" @@ -85,9 +95,9 @@ RUN echo "source $CCTL/activate" >> .bashrc COPY --chown=cctl:cctl ./docker/start.sh . RUN chmod +x start.sh -EXPOSE 11101-11105 14101-14105 18101-18105 +EXPOSE 11101-11105 12101-12105 13101-13105 14101-14105 21101-21105 22101-22105 HEALTHCHECK --interval=10s --timeout=5s --retries=4 --start-period=20s \ - CMD curl --silent --location 'http://127.0.0.1:11101/rpc' --header 'Content-Type: application/json' --data '{"id": "1", "jsonrpc": "2.0", "method": "info_get_status", "params": []}' | jq -e -n 'input.result.reactor_state' | grep "Validate" + CMD curl --silent --location 'http://127.0.0.1:21101/rpc' --header 'Content-Type: application/json' --data '{"id": "1", "jsonrpc": "2.0", "method": "info_get_status", "params": []}' | jq -e -n 'input.result.reactor_state' | grep "Validate" CMD ["/bin/bash", "-c", "source start.sh"] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index a1634ad..33e138d 100644 --- a/docker/README.md +++ b/docker/README.md @@ -97,21 +97,17 @@ docker exec -t -i cspr-cctl /bin/bash cctl-chain-view-genesis-chainspec ``` -[TODO: Add a deploy example] - To view how cctl can be used within a project view the following Terminus SDK test projects: -[TODO: Add the links once the Terminus project have migrated to CCTL] - -- Java +- [Java](https://github.com/casper-sdks/terminus-java-tests) -- Python +- [Python](https://github.com/casper-sdks/terminus-python-tests) -- Go +- [Go](https://github.com/casper-sdks/terminus-go-tests) -- JS +- [JS](https://github.com/casper-sdks/terminus-js-tests) -- C# +- [C#](https://github.com/casper-sdks/terminus-dotnet-tests) ### Pre-built images diff --git a/docker/clean.sh b/docker/clean.sh index f3a2e99..05e7104 100644 --- a/docker/clean.sh +++ b/docker/clean.sh @@ -13,8 +13,10 @@ rm -r casper-node-launcher/target/release/.fingerprint rm -r casper-client-rs/target/release/build rm -r casper-client-rs/target/release/deps rm -r casper-client-rs/target/release/.fingerprint +rm -r casper-sidecar/target/release/build +rm -r casper-sidecar/target/release/deps +rm -r casper-sidecar/target/release/.fingerprint rm -r casper-node/.git rm -r casper-client-rs/.git rm -r casper-node-launcher/.git -rm -r casper-node/utils/nctl -rm -r casper-node/utils/nctl-metrics +rm -r casper-sidecar/.git diff --git a/docker/start.sh b/docker/start.sh index 8fe8d20..d87c450 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -1,7 +1,7 @@ #!/bin/bash source $CCTL/activate -source $CCTL/cmds/infra/net/setup.sh -source $CCTL/cmds/infra/net/start.sh +source $CCTL/cmds/infra/net/ctl_setup.sh +source $CCTL/cmds/infra/net/ctl_start.sh tail -f $CCTL/assets/nodes/node-1/logs/node-stderr.log