diff --git a/buildkite/scripts/build-artifact.sh b/buildkite/scripts/build-artifact.sh index adb98a79ff8a..bdcc48d4c1e6 100755 --- a/buildkite/scripts/build-artifact.sh +++ b/buildkite/scripts/build-artifact.sh @@ -13,7 +13,7 @@ echo "--- Build libp2p_helper TODO: use the previously uploaded build artifact" make -C src/app/libp2p_helper MAINNET_TARGETS="" -[[ ${MINA_BUILD_MAINNET} ]] && MAINNET_TARGETS="src/app/cli/src/mina_mainnet_signatures.exe src/app/rosetta/rosetta_mainnet_signatures.exe " +[[ ${MINA_BUILD_MAINNET} ]] && MAINNET_TARGETS="src/app/cli/src/mina_mainnet_signatures.exe src/app/rosetta/rosetta_mainnet_signatures.exe src/app/rosetta/ocaml-signer/signer_mainnet_signatures.exe" echo "--- Build all major tagets required for packaging" echo "Building from Commit SHA: ${MINA_COMMIT_SHA1}" @@ -33,6 +33,7 @@ dune build "--profile=${DUNE_PROFILE}" \ src/app/swap_bad_balances/swap_bad_balances.exe \ src/app/zkapp_test_transaction/zkapp_test_transaction.exe \ src/app/rosetta/rosetta_testnet_signatures.exe \ + src/app/rosetta/ocaml-signer/signer_testnet_signatures.exe \ src/app/test_executive/test_executive.exe # 2>&1 | tee /tmp/buildocaml.log echo "--- Bundle all packages for Debian ${MINA_DEB_CODENAME}" diff --git a/buildkite/scripts/rosetta-integration-tests.sh b/buildkite/scripts/rosetta-integration-tests.sh index b48b07b1a89b..f96201496fcc 100755 --- a/buildkite/scripts/rosetta-integration-tests.sh +++ b/buildkite/scripts/rosetta-integration-tests.sh @@ -12,7 +12,7 @@ # that source. It is important to make sure that the zkapp-cli version installed # is compatible with o1js version used. -# These tests use the mina-dev binary, as rosetta-cli assumes we use a testnet. +# These tests use the mina binary, as rosetta-cli assumes we use a testnet. # See https://github.com/coinbase/rosetta-sdk-go/blob/master/keys/signer_pallas.go#L222 set -eo pipefail @@ -29,7 +29,7 @@ export PG_CONN=postgres://${POSTGRES_USERNAME}:${POSTGRES_USERNAME}@127.0.0.1:54 # Mina Archive variables export MINA_ARCHIVE_PORT=${MINA_ARCHIVE_PORT:=3086} -export MINA_ARCHIVE_SQL_SCHEMA_PATH=${MINA_ARCHIVE_SQL_SCHEMA_PATH:=/archive/create_schema.sql} +export MINA_ARCHIVE_SQL_SCHEMA_PATH=${MINA_ARCHIVE_SQL_SCHEMA_PATH:=/etc/mina/rosetta/archive/create_schema.sql} # Mina Rosetta variables export MINA_ROSETTA_ONLINE_PORT=${MINA_ROSETTA_ONLINE_PORT:=3087} @@ -88,7 +88,7 @@ popd # Files from ROSETTA_CLI_CONFIG_FILES will be read from # ROSETTA_CONFIGURATION_INPUT_DIR and some placeholders will be # substituted. -ROSETTA_CONFIGURATION_INPUT_DIR=${ROSETTA_CONFIGURATION_INPUT_DIR:=/rosetta/rosetta-cli-config} +ROSETTA_CONFIGURATION_INPUT_DIR=${ROSETTA_CONFIGURATION_INPUT_DIR:=/etc/mina/rosetta/rosetta-cli-config} ROSETTA_CLI_CONFIG_FILES=${ROSETTA_CLI_CONFIG_FILES:="config.json mina.ros"} ROSETTA_CLI_MAIN_CONFIG_FILE=${ROSETTA_CLI_MAIN_CONFIG_FILE:="config.json"} @@ -101,13 +101,13 @@ mv /tmp/MinaProtocol-rosetta-integration-test-zkapps-* $ZKAPP_PATH # Libp2p Keypair echo "=========================== GENERATING KEYPAIR IN ${MINA_LIBP2P_KEYPAIR_PATH} ===========================" -mina-dev libp2p generate-keypair -privkey-path $MINA_LIBP2P_KEYPAIR_PATH +mina libp2p generate-keypair -privkey-path $MINA_LIBP2P_KEYPAIR_PATH # Configuration echo "=========================== GENERATING GENESIS LEDGER FOR ${MINA_NETWORK} ===========================" mkdir -p $MINA_KEYS_PATH -mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/block-producer.key -mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/snark-producer.key +mina advanced generate-keypair --privkey-path $MINA_KEYS_PATH/block-producer.key +mina advanced generate-keypair --privkey-path $MINA_KEYS_PATH/snark-producer.key chmod -R 0700 $MINA_KEYS_PATH BLOCK_PRODUCER_PK=$(cat $MINA_KEYS_PATH/block-producer.key.pub) SNARK_PRODUCER_PK=$(cat $MINA_KEYS_PATH/snark-producer.key.pub) @@ -132,9 +132,9 @@ for zkapp_path in ${ZKAPP_PATH}/*/; do zkapp_path=${zkapp_path%/} zkapp=$(basename $zkapp_path) # Generate zkApp account keypair - mina-dev advanced generate-keypair --privkey-path ${MINA_KEYS_PATH}/zkapp-${zkapp}-account.key + mina advanced generate-keypair --privkey-path ${MINA_KEYS_PATH}/zkapp-${zkapp}-account.key # Generate zkApp fee payer keypair - mina-dev advanced generate-keypair --privkey-path ${MINA_KEYS_PATH}/zkapp-${zkapp}-fee-payer.key + mina advanced generate-keypair --privkey-path ${MINA_KEYS_PATH}/zkapp-${zkapp}-fee-payer.key zkapp_fee_payer_pk=$(cat $MINA_KEYS_PATH/zkapp-${zkapp}-fee-payer.key.pub) line="[{ \"pk\": \"${zkapp_fee_payer_pk}\", \"balance\": \"10000\", \"delegate\": null, \"sk\": null }]" jq ".ledger.accounts |= . + ${line}" $MINA_CONFIG_FILE >${MINA_CONFIG_FILE}.tmp @@ -158,19 +158,19 @@ done # Import Genesis Accounts echo "==================== IMPORTING GENESIS ACCOUNTS ======================" -mina-dev accounts import --privkey-path $MINA_KEYS_PATH/block-producer.key --config-directory $MINA_CONFIG_DIR -mina-dev accounts import --privkey-path $MINA_KEYS_PATH/snark-producer.key --config-directory $MINA_CONFIG_DIR +mina accounts import --privkey-path $MINA_KEYS_PATH/block-producer.key --config-directory $MINA_CONFIG_DIR +mina accounts import --privkey-path $MINA_KEYS_PATH/snark-producer.key --config-directory $MINA_CONFIG_DIR for zkapp_path in ${ZKAPP_PATH}/*/; do zkapp_path=${zkapp_path%/} zkapp=$(basename $zkapp_path) - mina-dev accounts import --privkey-path $MINA_KEYS_PATH/zkapp-${zkapp}-fee-payer.key --config-directory $MINA_CONFIG_DIR + mina accounts import --privkey-path $MINA_KEYS_PATH/zkapp-${zkapp}-fee-payer.key --config-directory $MINA_CONFIG_DIR done # Postgres echo "========================= INITIALIZING POSTGRESQL ===========================" pg_ctlcluster ${POSTGRES_VERSION} main start pg_dropcluster --stop ${POSTGRES_VERSION} main -pg_createcluster --start -d ${POSTGRES_DATA_DIR} --createclusterconf /rosetta/postgresql.conf ${POSTGRES_VERSION} main +pg_createcluster --start -d ${POSTGRES_DATA_DIR} --createclusterconf /etc/mina/rosetta/postgresql.conf ${POSTGRES_VERSION} main sudo -u postgres psql --command "CREATE USER ${POSTGRES_USERNAME} WITH SUPERUSER PASSWORD '${POSTGRES_USERNAME}';" sudo -u postgres createdb -O ${POSTGRES_USERNAME} ${POSTGRES_DBNAME} psql -f "${MINA_ARCHIVE_SQL_SCHEMA_PATH}" "${PG_CONN}" @@ -179,7 +179,7 @@ psql -f "${MINA_ARCHIVE_SQL_SCHEMA_PATH}" "${PG_CONN}" echo "=========================== STARTING ROSETTA API ONLINE AND OFFLINE INSTANCES ===========================" ports=($MINA_ROSETTA_ONLINE_PORT $MINA_ROSETTA_OFFLINE_PORT) for port in ${ports[*]}; do - mina-rosetta-dev \ + mina-rosetta \ --archive-uri "${PG_CONN}" \ --graphql-uri http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql \ --log-level ${LOG_LEVEL} \ @@ -198,7 +198,7 @@ sleep 5 # Daemon echo "========================= STARTING DAEMON connected to ${MINA_NETWORK} ===========================" -mina-dev daemon \ +mina daemon \ --archive-address 127.0.0.1:${MINA_ARCHIVE_PORT} \ --background \ --block-producer-pubkey "$BLOCK_PRODUCER_PK" \ @@ -218,21 +218,21 @@ retries_left=20 until [ $daemon_status == "Synced" ]; do [[ $retries_left -eq 0 ]] && echo "Unable to Sync the Daemon" && exit 1 || ((retries_left--)) sleep 15 - daemon_status=$(mina-dev client status --json | jq -r .sync_status 2>/dev/null || echo "Pending") + daemon_status=$(mina client status --json | jq -r .sync_status 2>/dev/null || echo "Pending") echo "Daemon Status: ${daemon_status}" done # Unlock Genesis Accounts echo "==================== UNLOCKING GENESIS ACCOUNTS ======================" -mina-dev accounts unlock --public-key $BLOCK_PRODUCER_PK -mina-dev accounts unlock --public-key $SNARK_PRODUCER_PK +mina accounts unlock --public-key $BLOCK_PRODUCER_PK +mina accounts unlock --public-key $SNARK_PRODUCER_PK # Start sending payments send_payments() { - mina-dev client send-payment -rest-server http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql -amount 1 -nonce 0 -receiver $BLOCK_PRODUCER_PK -sender $BLOCK_PRODUCER_PK + mina client send-payment -rest-server http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql -amount 1 -nonce 0 -receiver $BLOCK_PRODUCER_PK -sender $BLOCK_PRODUCER_PK while true; do sleep $TRANSACTION_FREQUENCY - mina-dev client send-payment -rest-server http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql -amount 1 -receiver $BLOCK_PRODUCER_PK -sender $BLOCK_PRODUCER_PK + mina client send-payment -rest-server http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql -amount 1 -receiver $BLOCK_PRODUCER_PK -sender $BLOCK_PRODUCER_PK done } send_payments & @@ -240,7 +240,7 @@ send_payments & # Fee payer cache creation echo "==================== PREPARE FEE PAYER CACHE ======================" zkapp_fee_payer_pk=$(cat ${MINA_KEYS_PATH}/zkapp-${zkapp}-fee-payer.key.pub) -zkapp_fee_payer_privkey=$(mina-dev advanced dump-keypair --privkey-path "${MINA_KEYS_PATH}/zkapp-${zkapp}-fee-payer.key" | sed -ne "s/Private key: //p") +zkapp_fee_payer_privkey=$(mina advanced dump-keypair --privkey-path "${MINA_KEYS_PATH}/zkapp-${zkapp}-fee-payer.key" | sed -ne "s/Private key: //p") mkdir -p /root/.cache/zkapp-cli/keys echo -e "{\n \"privateKey\": \"${zkapp_fee_payer_privkey}\",\n \"publicKey\": \"${zkapp_fee_payer_pk}\"\n}" >/root/.cache/zkapp-cli/keys/sandbox.json @@ -264,7 +264,7 @@ for zkapp_path in ${ZKAPP_PATH}/*/; do echo "Deploying ${zkapp}..." zkapp_account_pk=$(cat ${MINA_KEYS_PATH}/zkapp-${zkapp}-account.key.pub) - zkapp_account_privkey=$(mina-dev advanced dump-keypair --privkey-path "${MINA_KEYS_PATH}/zkapp-${zkapp}-account.key" | sed -ne "s/Private key: //p") + zkapp_account_privkey=$(mina advanced dump-keypair --privkey-path "${MINA_KEYS_PATH}/zkapp-${zkapp}-account.key" | sed -ne "s/Private key: //p") mkdir -p ${zkapp_path}/keys echo -e "{\n \"privateKey\": \"${zkapp_account_privkey}\",\n \"publicKey\": \"${zkapp_account_pk}\"\n}" >"${zkapp_path}/keys/sandbox.json" @@ -294,7 +294,7 @@ done # TODO: wait until all zkApps deploy txns are included in a block -next_block_time=$(mina-dev client status --json | jq '.next_block_production.timing[1].time' | tr -d '"') +next_block_time=$(mina client status --json | jq '.next_block_production.timing[1].time' | tr -d '"') curr_time=$(date +%s%N | cut -b1-13) sleep_time=$((($next_block_time - $curr_time) / 1000)) echo "Sleeping for ${sleep_time}s until next block is created..." @@ -314,7 +314,7 @@ for zkapp_path in ${ZKAPP_PATH}/*/; do echo "Done." done -next_block_time=$(mina-dev client status --json | jq '.next_block_production.timing[1].time' | tr -d '"') +next_block_time=$(mina client status --json | jq '.next_block_production.timing[1].time' | tr -d '"') curr_time=$(date +%s%N | cut -b1-13) sleep_time=$((($next_block_time - $curr_time) / 1000)) echo "Sleeping for ${sleep_time}s until next block is created..." diff --git a/buildkite/src/Command/MinaArtifact.dhall b/buildkite/src/Command/MinaArtifact.dhall index 6ef33dfd9ff7..fa396fd79970 100644 --- a/buildkite/src/Command/MinaArtifact.dhall +++ b/buildkite/src/Command/MinaArtifact.dhall @@ -99,8 +99,9 @@ let pipeline : DebianVersions.DebVersion -> PipelineMode.Type -> Pipeline.Config -- rosetta image let rosettaSpec = DockerImage.ReleaseSpec::{ + deps=DebianVersions.dependsOn debVersion, service="mina-rosetta", - extra_args="--build-arg MINA_BRANCH=\\\${BUILDKITE_BRANCH} --cache-from ${DebianVersions.toolchainImage debVersion}", + network="berkeley", deb_codename="${DebianVersions.lowerName debVersion}", step_key="rosetta-${DebianVersions.lowerName debVersion}-docker-image" } diff --git a/dockerfiles/stages/4-production b/dockerfiles/Dockerfile-mina-rosetta old mode 100644 new mode 100755 similarity index 61% rename from dockerfiles/stages/4-production rename to dockerfiles/Dockerfile-mina-rosetta index 1e45c124f74f..7b3e8cc78df0 --- a/dockerfiles/stages/4-production +++ b/dockerfiles/Dockerfile-mina-rosetta @@ -1,13 +1,13 @@ -################################################################################################# -# The "production" Stage -# - sets up the final container with built binaries and a running postgresql archive node setup -################################################################################################# -# Supports debian:buster-slim, debian:bullseye-slim, and ubuntu:focal ARG image=ubuntu:focal FROM ${image} AS production ARG deb_codename=focal +ARG deb_version +ARG deb_release=unstable +ARG network=mainnet ARG psql_version=13 +# Golang version number used to detemine tarball name +ARG GO_VERSION=1.19.11 ARG MINA_DAEMON_PORT=10101 ARG MINA_CONFIG_DIR=/data/.mina-config @@ -18,6 +18,23 @@ ARG ROSETTA_CLI_VERSION=v0.10.1 ENV DEBIAN_FRONTEND noninteractive +# We do not install the below platform-specific dependencies, +# and instead assume that apt will install the proper deps based on the package definition. +# The packages are noted here just for clarity/documentation. +# Stretch-only Deps: +# libffi6 +# libprocps6 +# libjemalloc1 +# Buster-only Deps: +# libffi7 +# libprocps7 +# libjemalloc2 +# Bullseye/Focal-only Deps: +# libffi7 +# libprocps8 +# libjemalloc2 + + # --- Dependencies across many platforms RUN apt-get update --quiet --yes \ && apt-get upgrade --quiet --yes \ @@ -26,6 +43,7 @@ RUN apt-get update --quiet --yes \ apt-transport-https \ curl \ ca-certificates \ + build-essential \ dnsutils \ dumb-init \ gettext \ @@ -46,41 +64,14 @@ RUN curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ postgresql-"$psql_version" \ postgresql-client-"$psql_version" -# --- Debian 11 "Bullseye" Dependencies -RUN test "$deb_codename" = "bullseye" \ - && apt-get update -y \ - && apt-get install -y \ - libjemalloc2 \ - libprocps8 \ - libffi7 \ - || exit 0 - -# --- Debian 10 "Buster" Dependencies -RUN test "$deb_codename" = "buster" \ - && apt-get update --quiet --yes \ - && apt-get install --quiet --yes --no-install-recommends \ - libjemalloc2 \ - libprocps7 \ - libffi6 \ - || exit 0 - -# --- Ubuntu 20.04 "Focal Fossa" Dependencies -RUN test "$deb_codename" = "focal" \ - && apt-get update --quiet --yes \ - && apt-get install --quiet --yes --no-install-recommends \ - libjemalloc2 \ - libprocps8 \ - libffi7 \ - || exit 0 +# --- Golang install of a given GO_VERSION (add -v for spam output of each file from the go dist) +RUN curl -s "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar -xz -C /usr/lib/ # --- Install rosetta-cli - # The following commands install rosetta-cli with an updated rosetta-sdk-go dependency, which supports delegation transactions. # Upstream PR to rosetta-sdk-go: https://github.com/coinbase/rosetta-sdk-go/pull/457 # They can be replaced once there is a new release of rosetta-cli containing the above change by: -# RUN curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/${ROSETTA_CLI_VERSION}/scripts/install.sh | sh -s -COPY --from=builder /usr/lib/go /usr/lib/go -RUN apt-get install -y gcc +#RUN curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-cli/${ROSETTA_CLI_VERSION}/scripts/install.sh | sh -s RUN export GOBIN="$(pwd)/bin" \ && curl -L "https://github.com/coinbase/rosetta-cli/archive/refs/tags/v0.10.1.tar.gz" -o "/tmp/v0.10.1.tar.gz" \ && tar xzf "/tmp/v0.10.1.tar.gz" -C "/tmp" \ @@ -99,15 +90,14 @@ RUN mkdir -p --mode=700 ${MINA_CONFIG_DIR}/wallets/store/ \ > ${MINA_CONFIG_DIR}/wallets/store/${PK} \ && chmod go-rwx ${MINA_CONFIG_DIR}/wallets/store/${PK} -# --- Copy artifacts from the 3-builder stage -COPY --from=builder /home/opam/app/* /usr/local/bin/ -COPY --from=builder /home/opam/mina/src/app/rosetta/*.sh /rosetta/ -COPY --from=builder /home/opam/mina/src/app/rosetta/*.conf /rosetta/ -COPY --from=builder /home/opam/mina/src/app/rosetta/README.md /rosetta/ -COPY --from=builder /home/opam/mina/src/app/rosetta/rosetta-cli-config/*.json /rosetta/rosetta-cli-config/ -COPY --from=builder /home/opam/mina/src/app/rosetta/rosetta-cli-config/*.ros /rosetta/rosetta-cli-config/ -COPY --from=builder /home/opam/mina/src/app/archive/*.sql /archive/ -COPY --from=builder /home/opam/mina/genesis_ledgers /genesis_ledgers/ + +# Mina daemon package +# jemalloc is also installed automatically here to match the package dependencies for this $deb_codename +RUN echo "Building image with version $deb_version from repo $deb_release $deb_codename for network $network" \ + && echo "deb [trusted=yes] http://packages.o1test.net $deb_codename $deb_release" > /etc/apt/sources.list.d/o1.list \ + && apt-get update --quiet --yes \ + && apt-get install --quiet --yes --allow-downgrades "mina-$network=$deb_version" "mina-archive=$deb_version" \ + && rm -rf /var/lib/apt/lists/* # --- Set up postgres USER postgres @@ -118,10 +108,10 @@ RUN POSTGRES_VERSION=$(psql -V | cut -d " " -f 3 | sed 's/.[[:digit:]]*$//g') \ # Run as root so it can create /data/postgresql USER root RUN POSTGRES_VERSION=$(psql -V | cut -d " " -f 3 | sed 's/.[[:digit:]]*$//g') \ - && pg_createcluster --start -d /data/postgresql --createclusterconf /rosetta/postgresql.conf ${POSTGRES_VERSION} main + && pg_createcluster --start -d /data/postgresql --createclusterconf /etc/mina/rosetta/postgresql.conf ${POSTGRES_VERSION} main # --- Container workdir, ports, entrypoint, etc. -WORKDIR /rosetta +WORKDIR /etc/mina/rosetta EXPOSE 3087 EXPOSE $MINA_DAEMON_PORT diff --git a/dockerfiles/stages/3-builder b/dockerfiles/stages/3-builder deleted file mode 100644 index 38b36f5d0666..000000000000 --- a/dockerfiles/stages/3-builder +++ /dev/null @@ -1,72 +0,0 @@ -################################################################################################# -# The "builder" Stage -# - builds mina and any other binaries required to run rosetta -# - should not include any data related to joining a specific network, only the node software itself -################################################################################################# -FROM opam-deps AS builder - -# Use --build-arg "DUNE_PROFILE=dev" to build a dev image or for CI -ARG DUNE_PROFILE=devnet - -# branch to checkout on first clone (this will be the only available branch in the container) -# can also be a tagged release -ARG MINA_BRANCH=compatible - -# repo to checkout the branch from -ARG MINA_REPO=https://github.com/MinaProtocol/mina - -# location of repo used for pins and external package commits -ARG MINA_DIR=mina - -ENV PATH "$PATH:/usr/lib/go/bin:$HOME/.cargo/bin" - -# --- Shallow Clone the Mina repo -# Delete any previous clones of the mina repo and then clone into an empty directory -RUN cd $HOME && rm -rf $HOME/${MINA_DIR} \ - && git clone \ - -b "${MINA_BRANCH}" \ - --depth 1 \ - --shallow-submodules \ - --recurse-submodules \ - ${MINA_REPO} ${HOME}/${MINA_DIR} -# Set the working directory to the cloned mina repo -WORKDIR $HOME/${MINA_DIR} -# Create a directory for compiled outputs -RUN mkdir ${HOME}/app - -# --- Build libp2p_helper -RUN make libp2p_helper \ - && mv src/app/libp2p_helper/result/bin/libp2p_helper ${HOME}/app/libp2p_helper - -# --- Make rosetta-crucial components and the generate_keypair tool -RUN eval $(opam config env) \ - && dune build --profile=${DUNE_PROFILE} \ - src/app/cli/src/mina_testnet_signatures.exe \ - src/app/cli/src/mina_mainnet_signatures.exe \ - src/app/archive/archive.exe \ - src/app/archive_blocks/archive_blocks.exe \ - src/app/extract_blocks/extract_blocks.exe \ - src/app/missing_blocks_auditor/missing_blocks_auditor.exe \ - src/app/replayer/replayer.exe \ - src/app/rosetta/rosetta_testnet_signatures.exe \ - src/app/rosetta/rosetta_mainnet_signatures.exe \ - src/app/generate_keypair/generate_keypair.exe \ - src/app/validate_keypair/validate_keypair.exe \ - src/app/rosetta/ocaml-signer/signer.exe \ - && cp _build/default/src/app/archive_blocks/archive_blocks.exe $HOME/app/mina-archive-blocks \ - && cp _build/default/src/app/extract_blocks/extract_blocks.exe $HOME/app/mina-extract-blocks \ - && cp _build/default/src/app/missing_blocks_auditor/missing_blocks_auditor.exe $HOME/app/mina-missing-blocks-auditor \ - && cp _build/default/src/app/replayer/replayer.exe $HOME/app/mina-replayer \ - && mv _build/default/src/app/cli/src/mina_mainnet_signatures.exe $HOME/app/mina \ - && mv _build/default/src/app/cli/src/mina_testnet_signatures.exe $HOME/app/mina-dev \ - && mv _build/default/src/app/archive/archive.exe $HOME/app/mina-archive \ - && mv _build/default/src/app/rosetta/rosetta_mainnet_signatures.exe $HOME/app/mina-rosetta \ - && mv _build/default/src/app/rosetta/rosetta_testnet_signatures.exe $HOME/app/mina-rosetta-dev \ - && mv _build/default/src/app/generate_keypair/generate_keypair.exe $HOME/app/mina-generate-keypair \ - && mv _build/default/src/app/validate_keypair/validate_keypair.exe $HOME/app/mina-validate-keypair \ - && mv _build/default/src/app/rosetta/ocaml-signer/signer.exe $HOME/app/mina-ocaml-signer \ - && rm -rf _build - -# --- Clear go module caches to make the container smaller -RUN cd src/app/libp2p_helper/src/libp2p_helper \ - && go clean --cache --modcache --testcache -r diff --git a/dockerfiles/stages/4-deb-builder b/dockerfiles/stages/4-deb-builder deleted file mode 100644 index 38dbf10a2cf9..000000000000 --- a/dockerfiles/stages/4-deb-builder +++ /dev/null @@ -1,58 +0,0 @@ -################################################################################################# -# The "deb-builder" Stage -# - builds mina and any other binaries required to run `make deb` -################################################################################################# -FROM toolchain AS deb-builder - -# Use --build-arg "DUNE_PROFILE=dev" to build a dev image or for CI -ARG DUNE_PROFILE=devnet - -# branch to checkout on first clone (this will be the only available branch in the container) -# can also be a tagged release -ARG MINA_BRANCH=compatible - -ARG MINA_COMMIT - -# repo to checkout the branch from -ARG MINA_REPO=https://github.com/MinaProtocol/mina - -# location of repo used for pins and external package commits -ARG MINA_DIR=mina - -ENV MINA_COMMIT_SHA1=${MINA_COMMIT} - -ENV PATH "$PATH:/usr/lib/go/bin:$HOME/.cargo/bin" - -# --- Build all major tagets required for packaging -RUN echo "--- Build all major tagets required for packaging" \ - && echo "Building from Commit SHA: ${MINA_COMMIT_SHA1}" \ - && eval $(opam config env) \ - && dune build --profile=${DUNE_PROFILE} \ - src/app/logproc/logproc.exe \ - src/app/runtime_genesis_ledger/runtime_genesis_ledger.exe \ - src/app/generate_keypair/generate_keypair.exe \ - src/app/validate_keypair/validate_keypair.exe \ - src/app/cli/src/mina.exe \ - src/app/cli/src/mina_testnet_signatures.exe \ - src/app/cli/src/mina_mainnet_signatures.exe \ - src/app/archive/archive.exe \ - src/app/archive/archive_testnet_signatures.exe \ - src/app/archive/archive_mainnet_signatures.exe \ - src/app/rosetta/rosetta.exe \ - src/app/rosetta/rosetta_mainnet_signatures.exe \ - src/app/rosetta/rosetta_testnet_signatures.exe \ - src/app/rosetta/ocaml-signer/signer.exe - -# --- MAKE DEB -RUN eval $(opam config env) \ - && echo "Building from Commit SHA: ${MINA_COMMIT_SHA1}" \ - && ./scripts/rebuild-deb.sh - -# Rosetta-demo artifacts / build dir removal: -# Make rosetta-crucial components and the generate_keypair tool -# && dune build --profile=${DUNE_PROFILE} \ -# && _build/default/src/app/runtime_genesis_ledger/runtime_genesis_ledger.exe \ -# --config-file src/app/rosetta/demo-config.json \ -# --genesis-dir ${HOME}/demo-genesis \ -# && mv _build/default/src/app $HOME/app \ -# && rm -rf _build diff --git a/scripts/rebuild-deb.sh b/scripts/rebuild-deb.sh index 770e1dcbf604..8a5a9015cabb 100755 --- a/scripts/rebuild-deb.sh +++ b/scripts/rebuild-deb.sh @@ -130,7 +130,24 @@ copy_common_daemon_configs() { # Copy signature-based Binaries (based on signature type $2 passed into the function) cp ./default/src/app/cli/src/mina_${2}_signatures.exe "${BUILDDIR}/usr/local/bin/mina" + + # Copy rosetta-based Binaries cp ./default/src/app/rosetta/rosetta_${2}_signatures.exe "${BUILDDIR}/usr/local/bin/mina-rosetta" + cp ./default/src/app/rosetta/ocaml-signer/signer_${2}_signatures.exe "${BUILDDIR}/usr/local/bin/mina-ocaml-signer" + + mkdir -p "${BUILDDIR}/etc/mina/rosetta" + mkdir -p "${BUILDDIR}/etc/mina/rosetta/rosetta-cli-config" + mkdir -p "${BUILDDIR}/etc/mina/rosetta/archive" + mkdir -p "${BUILDDIR}/etc/mina/rosetta/genesis_ledgers" + + # --- Copy artifacts + cp ../src/app/rosetta/*.conf "${BUILDDIR}/etc/mina/rosetta" + cp ../src/app/rosetta/*.sh "${BUILDDIR}/etc/mina/rosetta" + + cp ../src/app/rosetta/rosetta-cli-config/*.json "${BUILDDIR}/etc/mina/rosetta/rosetta-cli-config" + cp ../src/app/rosetta/rosetta-cli-config/*.ros "${BUILDDIR}/etc/mina/rosetta/rosetta-cli-config" + cp ../src/app/archive/*.sql "${BUILDDIR}/etc/mina/rosetta/archive" + cp -r ../genesis_ledgers/* ${BUILDDIR}/etc/mina/rosetta/genesis_ledgers/ # Copy over Build Configs (based on $2) mkdir -p "${BUILDDIR}/etc/coda/build_config" @@ -259,7 +276,7 @@ cp ./default/src/app/zkapp_test_transaction/zkapp_test_transaction.exe "${BUILDD build_deb mina-zkapp-test-transaction -##################################### END SNAPP TEST TXN PACKAGE ####################################### +##################################### END ZKAPP TEST TXN PACKAGE ####################################### ##################################### BERKELEY PACKAGE ####################################### echo "------------------------------------------------------------" diff --git a/scripts/release-docker.sh b/scripts/release-docker.sh index 4407af6656f1..cbf5b26289c3 100755 --- a/scripts/release-docker.sh +++ b/scripts/release-docker.sh @@ -95,7 +95,7 @@ mina-batch-txn) VERSION="${VERSION}-${NETWORK##*=}" ;; mina-rosetta) - DOCKERFILE_PATH="dockerfiles/stages/1-build-deps dockerfiles/stages/2-opam-deps dockerfiles/stages/3-builder dockerfiles/stages/4-production" + DOCKERFILE_PATH="dockerfiles/Dockerfile-mina-rosetta" ;; mina-zkapp-test-transaction) DOCKERFILE_PATH="dockerfiles/Dockerfile-zkapp-test-transaction" diff --git a/src/app/rosetta/rosetta_testnet_signatures.ml b/src/app/rosetta/rosetta_testnet_signatures.ml index ca32b93398a0..b7a558d71451 100644 --- a/src/app/rosetta/rosetta_testnet_signatures.ml +++ b/src/app/rosetta/rosetta_testnet_signatures.ml @@ -3,4 +3,4 @@ open Async let () = Command.run - (Command.async ~summary:"Run Rosetta process on top of Coda" command) + (Command.async ~summary:"Run Rosetta process on top of Mina" command)