From 06a203d2e0e21f99a611863c1765d11a1f22ba4c Mon Sep 17 00:00:00 2001 From: evgenidefi Date: Mon, 23 Dec 2024 16:18:22 +0100 Subject: [PATCH 1/3] add dockerfile & docker-compose.yml for a basic ntt cli setup --- .../deployment-process/troubleshooting.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md b/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md index 61fcb564..02dbb3bd 100644 --- a/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md +++ b/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md @@ -16,5 +16,89 @@ If you encounter issues during the NTT deployment process, check the following c - **For EVM tokens** - confirm the token minter was set to the NTT Manager. Refer to the [set Token Minter to NTT Manager](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-evm/#set-token-minter-to-ntt-manager){target=\_blank} section for details - **Decimal configuration** - run `ntt pull` to correctly configure the decimals in your `deployment.json` file. More details in the [configure NTT](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-solana/#configure-ntt){target=\_blank} section - **Rate limit configuration** - increase your rate limits to a value greater than zero. A rate limit of zero can cause transactions to get stuck. Learn more on how to [configure rate limits](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-evm/#configure-ntt){target=\_blank} +- **Docker environment based on Ubuntu 20.04 with all dependencies required for Wormhole NTT CLI development** - run `docker compose up -d` to start the container in your terminal from the directory containing the docker-compose.yml file +???- interface "Dockerfile" +```Dockerfile + FROM ubuntu:20.04 + # Set environment variables to prevent interactive prompts during installation + ENV DEBIAN_FRONTEND=noninteractive + # Update and install necessary dependencies + RUN apt-get update && apt-get install -y \ + curl \ + wget \ + git \ + build-essential \ + libssl-dev \ + libudev-dev \ + pkg-config \ + python3 \ + python3-pip \ + software-properties-common \ + ca-certificates \ + unzip \ + clang \ + cmake \ + protobuf-compiler \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + + # Install Rust + RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + ENV PATH="/root/.cargo/bin:$PATH" + + # Install Solana CLI (v1.18.10) + RUN sh -c "$(curl -sSfL https://release.solana.com/v1.18.10/install)" + ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH" + + # Install Anchor using avm + RUN cargo install --git https://github.com/coral-xyz/anchor avm --locked --force \ + && avm install 0.29.0 \ + && avm use 0.29.0 + ENV PATH="/root/.avm/bin:$PATH" + + + ENV NVM_DIR=/root/.nvm + RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash \ + && . "$NVM_DIR/nvm.sh" \ + && nvm install 22 \ + && nvm use 22 \ + && nvm alias default 22 + ENV PATH="$NVM_DIR/versions/node/v22.12.0/bin:$PATH" + + # Install Bun + RUN curl -fsSL https://bun.sh/install | bash + ENV PATH="/root/.bun/bin:$PATH" + + # Install Foundry + RUN curl -L https://foundry.paradigm.xyz | bash + ENV PATH="/root/.foundry/bin:${PATH}" + RUN /bin/bash -c "source /root/.bashrc && foundryup" + + # Install Wormhole NTT CLI + RUN curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash + + # Add a default working directory + WORKDIR /app + + # Expose port for development if needed + EXPOSE 8899 + + # Entry point for the container + CMD ["bash"] +``` + + +???- interface "docker-compose.yml" +```yml + services: + portal-ntt: + build: + context: . + dockerfile: Dockerfile + platform: linux/amd64 + volumes: + - ./src:/app + working_dir: /app + tty: true +``` From 683bc8f4b1a63ebf36a89d102a13f8c2c145242c Mon Sep 17 00:00:00 2001 From: Ilaria Enache Date: Mon, 23 Dec 2024 16:26:13 +0100 Subject: [PATCH 2/3] fix spacing --- .../deployment-process/troubleshooting.md | 170 +++++++++--------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md b/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md index 02dbb3bd..d1a57ce6 100644 --- a/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md +++ b/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md @@ -17,88 +17,88 @@ If you encounter issues during the NTT deployment process, check the following c - **Decimal configuration** - run `ntt pull` to correctly configure the decimals in your `deployment.json` file. More details in the [configure NTT](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-solana/#configure-ntt){target=\_blank} section - **Rate limit configuration** - increase your rate limits to a value greater than zero. A rate limit of zero can cause transactions to get stuck. Learn more on how to [configure rate limits](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-evm/#configure-ntt){target=\_blank} - **Docker environment based on Ubuntu 20.04 with all dependencies required for Wormhole NTT CLI development** - run `docker compose up -d` to start the container in your terminal from the directory containing the docker-compose.yml file -???- interface "Dockerfile" - -```Dockerfile - FROM ubuntu:20.04 - # Set environment variables to prevent interactive prompts during installation - ENV DEBIAN_FRONTEND=noninteractive - - # Update and install necessary dependencies - RUN apt-get update && apt-get install -y \ - curl \ - wget \ - git \ - build-essential \ - libssl-dev \ - libudev-dev \ - pkg-config \ - python3 \ - python3-pip \ - software-properties-common \ - ca-certificates \ - unzip \ - clang \ - cmake \ - protobuf-compiler \ - && apt-get clean && rm -rf /var/lib/apt/lists/* - - # Install Rust - RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - ENV PATH="/root/.cargo/bin:$PATH" - - # Install Solana CLI (v1.18.10) - RUN sh -c "$(curl -sSfL https://release.solana.com/v1.18.10/install)" - ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH" - - # Install Anchor using avm - RUN cargo install --git https://github.com/coral-xyz/anchor avm --locked --force \ - && avm install 0.29.0 \ - && avm use 0.29.0 - ENV PATH="/root/.avm/bin:$PATH" - - - ENV NVM_DIR=/root/.nvm - RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash \ - && . "$NVM_DIR/nvm.sh" \ - && nvm install 22 \ - && nvm use 22 \ - && nvm alias default 22 - ENV PATH="$NVM_DIR/versions/node/v22.12.0/bin:$PATH" - - # Install Bun - RUN curl -fsSL https://bun.sh/install | bash - ENV PATH="/root/.bun/bin:$PATH" - - # Install Foundry - RUN curl -L https://foundry.paradigm.xyz | bash - ENV PATH="/root/.foundry/bin:${PATH}" - RUN /bin/bash -c "source /root/.bashrc && foundryup" - - # Install Wormhole NTT CLI - RUN curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash - - # Add a default working directory - WORKDIR /app - - # Expose port for development if needed - EXPOSE 8899 - - # Entry point for the container - CMD ["bash"] -``` - - -???- interface "docker-compose.yml" -```yml - services: - portal-ntt: - build: - context: . - dockerfile: Dockerfile - platform: linux/amd64 - volumes: - - ./src:/app - working_dir: /app - tty: true -``` + + ???- interface "Dockerfile" + + ```Dockerfile + FROM ubuntu:20.04 + # Set environment variables to prevent interactive prompts during installation + ENV DEBIAN_FRONTEND=noninteractive + + # Update and install necessary dependencies + RUN apt-get update && apt-get install -y \ + curl \ + wget \ + git \ + build-essential \ + libssl-dev \ + libudev-dev \ + pkg-config \ + python3 \ + python3-pip \ + software-properties-common \ + ca-certificates \ + unzip \ + clang \ + cmake \ + protobuf-compiler \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + + # Install Rust + RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + ENV PATH="/root/.cargo/bin:$PATH" + + # Install Solana CLI (v1.18.10) + RUN sh -c "$(curl -sSfL https://release.solana.com/v1.18.10/install)" + ENV PATH="/root/.local/share/solana/install/active_release/bin:$PATH" + + # Install Anchor using avm + RUN cargo install --git https://github.com/coral-xyz/anchor avm --locked --force \ + && avm install 0.29.0 \ + && avm use 0.29.0 + ENV PATH="/root/.avm/bin:$PATH" + + + ENV NVM_DIR=/root/.nvm + RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash \ + && . "$NVM_DIR/nvm.sh" \ + && nvm install 22 \ + && nvm use 22 \ + && nvm alias default 22 + ENV PATH="$NVM_DIR/versions/node/v22.12.0/bin:$PATH" + + # Install Bun + RUN curl -fsSL https://bun.sh/install | bash + ENV PATH="/root/.bun/bin:$PATH" + + # Install Foundry + RUN curl -L https://foundry.paradigm.xyz | bash + ENV PATH="/root/.foundry/bin:${PATH}" + RUN /bin/bash -c "source /root/.bashrc && foundryup" + + # Install Wormhole NTT CLI + RUN curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash + + # Add a default working directory + WORKDIR /app + + # Expose port for development if needed + EXPOSE 8899 + + # Entry point for the container + CMD ["bash"] + ``` + + ???- interface "docker-compose.yml" + ```yml + services: + portal-ntt: + build: + context: . + dockerfile: Dockerfile + platform: linux/amd64 + volumes: + - ./src:/app + working_dir: /app + tty: true + ``` From 241614acbe8ea2402060cb89775729dab4621acf Mon Sep 17 00:00:00 2001 From: Erin Shaben Date: Mon, 23 Dec 2024 10:51:46 -0500 Subject: [PATCH 3/3] Update build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md --- .../deployment-process/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md b/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md index d1a57ce6..57dc30ad 100644 --- a/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md +++ b/build/contract-integrations/native-token-transfers/deployment-process/troubleshooting.md @@ -16,7 +16,7 @@ If you encounter issues during the NTT deployment process, check the following c - **For EVM tokens** - confirm the token minter was set to the NTT Manager. Refer to the [set Token Minter to NTT Manager](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-evm/#set-token-minter-to-ntt-manager){target=\_blank} section for details - **Decimal configuration** - run `ntt pull` to correctly configure the decimals in your `deployment.json` file. More details in the [configure NTT](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-solana/#configure-ntt){target=\_blank} section - **Rate limit configuration** - increase your rate limits to a value greater than zero. A rate limit of zero can cause transactions to get stuck. Learn more on how to [configure rate limits](/docs/build/contract-integrations/native-token-transfers/deployment-process/deploy-to-evm/#configure-ntt){target=\_blank} -- **Docker environment based on Ubuntu 20.04 with all dependencies required for Wormhole NTT CLI development** - run `docker compose up -d` to start the container in your terminal from the directory containing the docker-compose.yml file +- **Docker environment based on Ubuntu 20.04 with all dependencies required for Wormhole NTT CLI development** - run `docker compose up -d` to start the container in your terminal from the directory containing the `docker-compose.yml` file ???- interface "Dockerfile"