> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/sdk7/blockchain/deploying-your-own-transactions-server.md). Agents can also search and read this documentation through its [MCP server](https://docs.decentraland.org/~gitbook/mcp).

# 트랜잭션 서버 배포

사용자에게 비용 없는 트랜잭션을 제공합니다

이 [transactions-server](https://github.com/decentraland/transactions-server/tree/1.8.0) 는 트랜잭션을 [Gelato](https://www.gelato.network/relay)로 전달하는 프록시 서버입니다. 클라이언트에서 서명된 트랜잭션을 받으면 백그라운드에서 적절한 네트워크로 전송합니다. 이를 통해 서버 소유자는 사용자에게 수수료 없는 트랜잭션을 제공할 수 있습니다.

트랜잭션 서버는 여러 네트워크를 사용할 때의 UX를 개선하고 사용자가 네트워크 제공자를 즉시 전환하지 않아도 되도록 하는 데 사용됩니다. 사용자는 [Ethereum](https://ethereum.org/en/) 에 계속 연결된 상태로 [Polygon](https://polygon.technology/) [과 상호작용할 수 있으며, 트랜잭션에 서명하기만 하면 됩니다.](https://docs.decentraland.org/blockchain-integration/transactions-in-polygon/)

Decentraland DAO는 몇 가지 [제한 사항](#restrictions)을 두고 일정 한도까지 비용을 부담하는, dapp에서 사용하는 서버를 설정했습니다. 이 문서에서는 [이 서버를 배포하는 방법](#running-the-server) 을 설명합니다. 필요한 제한 사항을 적용해 사용자가 트랜잭션을 릴레이할 수 있도록 할 수 있습니다.

## 제한 사항

모든 제한 사항은 사용자가 보내려는 트랜잭션마다 적용됩니다. 실제로는 서버에 대한 POST 요청 하나에 해당합니다.

서버에서 설정할 수 있는 제한 사항은 다음과 같습니다.

* 일일 최대 트랜잭션 수 할당량 확인. 자세한 내용은 [트랜잭션 섹션](#transactions) 자세한 내용은 참조하세요.
* 허용 목록에 있는 컨트랙트인지 확인합니다. 따라서 인식되지 않은 컨트랙트와 상호작용하려는 트랜잭션은 실패합니다. 이를 위해 다음을 사용합니다.
  * 배포된 컨트랙트와 컬렉션입니다. 자세한 내용은 [컨트랙트 및 컬렉션 섹션](#contracts-and-collections) 을 참조하세요.
* 판매 가격을 확인하고 임계값보다 낮으면 제한합니다. 자세한 내용은 [최소 판매 가치 섹션](#min-sale-value) 을 참조하세요.

## Gelato 구성

[Gelato](https://www.gelato.network/relay) 는 멀티체인 릴레이어 프로토콜입니다. 저희는 이 인프라를 사용해 수수료 없는 트랜잭션을 지원합니다. 즉, 트랜잭션을 보내려 할 때 실제로는 메시지에 서명해 Gelato에 전송합니다. Gelato 서비스가 대신 트랜잭션을 전송하고 응답(트랜잭션 해시)을 반환합니다.

트랜잭션을 전달할 컨트랙트가 필요하지만, 다행히 Decentraland에서 사용하는 컨트랙트를 재사용할 수 있습니다(아래 참조).

[Gelato](https://www.gelato.network/relay) 는 서버에 대한 API로 작동합니다. [구성하려면](#configuring-the-server) 먼저 API 키가 필요합니다. 이 키는 [나중에 사용합니다.](#gelato). 발급받으려면 다음 단계를 따르세요:

* [가입](https://app.gelato.network/relay) 서비스에
* 대상으로 삼으려는 네트워크에 새 dApp을 만드세요. Decentraland 설정을 모방하려면 다음과 같이 하세요:
  * 다음을 선택하세요: `Mainnets` 옵션
  * 적절한 `App name` 을 dApp에 설정하세요
  * 선택하세요 `Polygon` 의 네트워크로 `스마트 컨트랙트`
  * 다음 항목을 활성화하세요: `모든 컨트랙트` 토글 옵션
* 다음에서 API 키를 복사하세요: `API Key` 섹션

마지막으로, 새로 만든 dapp에 자금을 충전해야 합니다. 왼쪽 사이드바의 [1Balance](https://app.gelato.network/1balance) 섹션에서 지갑을 연결하면 됩니다. 연결하면 사용자가 보낼 트랜잭션에 필요한 자금을 충전할 수 있도록 [USDC](https://polygonscan.com/token/0x3c499c542cef5e3811e1192ce70d8cc03d5c3359) 를 입금할 수 있습니다. MATIC을 받아야 한다면 이 [게시물](https://docs.decentraland.org/blockchain-integration/transactions-in-polygon/#where-can-i-get-matic-to-pay-for-transaction-fees).

### 테스트넷

앱을 출시하기 전에 테스트하고 싶고 Polygon을 사용 중이라면 `Polygon Amoy`에서 테스트할 수 있습니다. Polygon 테스트넷입니다.

이렇게 하려면 [절차](#configuring-gelato) 를 반복하되 네트워크 필드에서 `Matic Testnet (Amoy)` 를 선택하세요.

dapp에 자금을 충전해야 하지만, 다음 [수도꼭지](https://sepoliafaucet.com/).

## 트랜잭션 서버 다운로드

먼저 Decentraland 트랜잭션 서버 코드를 복사해야 합니다. 코드는 [GitHub에서](https://github.com/decentraland/transactions-server/tree/v1)찾을 수 있습니다. 여기에는 두 가지 방법이 있습니다.

1. **코드 다운로드**: 코드를 다운로드하려면 먼저 녹색 `Code` 버튼을 클릭한 다음 다음 중 하나를 선택하세요.

* 다음을 클릭합니다: `Download ZIP`
* 다음 제목 아래의 URL을 복사합니다: `Clone` 그런 다음 다음 명령을 실행합니다: `$ git clone THE_URL_HERE`

2. **코드 포크하기**: 페이지 오른쪽 상단의 `fork` 버튼을 클릭하면 됩니다. 작업이 완료되면 첫 번째 방법과 같은 방식으로 코드를 다운로드할 수 있습니다. 이 방법을 사용하려면 GitHub 계정이 필요합니다. 저장소 포크에 대한 자세한 내용은 [여기](https://docs.github.com/en/enterprise-server@3.5/get-started/quickstart/fork-a-repo)

## 서버 구성

트랜잭션 서버는 [NodeJS](https://nodejs.org/en/) 와 [Typescript](https://www.typescriptlang.org/)를 사용해 작성되었습니다. 실행하기 전에 몇 가지 환경 변수를 설정해야 합니다.

설정 방법은 다음과 같습니다.

* 다음을 복사합니다: `.env.defaults` 파일을 복사한 다음 이름을 바꿔 붙여 넣습니다: `.env`
* 다음 `.env` 파일을 엽니다. 일부 변수에는 다음과 같은 기본값이 설정되어 있습니다: `HTTP_SERVER_PORT=5000` (서버를 실행할 포트)
* 대부분의 값은 그대로 두어도 되지만, 몇 가지 중요한 값을 확인해야 합니다:
  * [Gelato](#gelato)
  * [트랜잭션](#transactions)
  * [컨트랙트와 컬렉션](#contracts-and-collections)
  * [최소 판매 금액](#min-sale-value)

### Gelato

다음 단계에서 받은 API 키를 사용합니다: [Gelato 구성](#configuring-gelato).

```
GELATO_API_KEY=<YOUR_GELATO_API_KEY>
```

### 트랜잭션

새 트랜잭션 요청이 들어오면 **해당 주소가** 그날 보낸 트랜잭션 수를 확인합니다. 설정된 값을 초과하면 트랜잭션이 실패합니다.

```
MAX_TRANSACTIONS_PER_DAY=10
```

이 검사를 완전히 제거하려면 코드에서 다음

```ts
await checkQuota(components, transactionData)
```

메서드를 제거하면 됩니다. 이 메서드는 다음 함수에 있습니다: `async function checkData(transactionData: TransactionData): Promise<void> {` 파일 위치: `src/ports/transaction/component.ts`

### 컨트랙트와 컬렉션

서버는 컨트랙트 주소 URL에서 주소를 가져와 로컬에 저장하고 서브그래프를 쿼리합니다. 새 트랜잭션 요청이 들어오면 트랜잭션이 상호작용하는 컨트랙트가 URL에 있는 배포된 컨트랙트 또는 서브그래프에 있는 배포된 컬렉션에 속하는지 확인합니다.

자체 컨트랙트를 제공하려면 URL을 변경하고 현재 다음 주소의 데이터와 동일한 구조를 유지하세요: <https://contracts.decentraland.org/addresses.json> 사용할 네트워크는 COLLECTIONS\_CHAIN\_ID로 결정되며, 캐시를 다시 가져오는 주기는 COLLECTIONS\_FETCH\_INTERVAL\_MS로 설정합니다.

자체 컬렉션이 있다면 서브그래프 URL도 변경할 수 있습니다.

이 검사를 완전히 제거하려면 코드에서 다음 메서드를 제거하면 됩니다:

```ts
await checkContractAddress(components, transactionData)
```

메서드를 제거하면 됩니다. 이 메서드는 다음 함수에 있습니다: `async function checkData(transactionData: TransactionData): Promise<void> {` 파일 위치: `src/ports/transaction/component.ts`

```
CONTRACT_ADDRESSES_URL=https://contracts.decentraland.org/addresses.json
COLLECTIONS_FETCH_INTERVAL_MS=3600000
COLLECTIONS_CHAIN_ID=80002

COLLECTIONS_SUBGRAPH_URL=https://subgraph.decentraland.org/decentraland/collections-matic-amoy
```

### 최소 판매 금액

새 트랜잭션 요청이 들어오면 먼저 중계하려는 데이터를 파싱합니다. 판매(마켓플레이스 구매, 입찰 등)가 감지되면 금액을 MIN\_SALE\_VALUE\_IN\_WEI와 비교합니다. 금액이 이 값보다 낮으면 트랜잭션이 실패합니다.

```
MIN_SALE_VALUE_IN_WEI=1000000000000000000
```

관련 판매 메서드는 다음 파일에서 확인할 수 있습니다: `src/ports/transaction/validation/checkSalePrice.ts` 이 검사를 완전히 제거하려면 코드에서 다음 메서드를 제거하면 됩니다:

```ts
await checkSalePrice(components, transactionData)
```

메서드를 제거하면 됩니다. 이 메서드는 다음 함수에 있습니다: `async function checkData(transactionData: TransactionData): Promise<void> {` 파일 위치: `src/ports/transaction/component.ts`

## 서버 실행

이제 모든 구성이 완료되었으므로 서버를 실행하면 됩니다. 다음 문서를 참조할 수 있습니다: [README](https://docs.decentraland.org/creator/content-creator-ko/sdk7/blockchain/deploying-your-own-transactions-server.md) 간단히 요약하면 다음 작업이 필요합니다:

* 먼저 [NodeJS](https://nodejs.org/en/) 를 설치합니다.
* 원하는 터미널을 엽니다
* 다음 명령어를 실행합니다:

```bash
npm install
npm run migrate # only the first run
npm run start
```

물론, 이 서비스를 AWS와 같이 원하는 서비스에 배포하고 싶을 것입니다. [AWS](https://aws.amazon.com/) 등을 사용할 수 있습니다. 배포할 때 프로젝트의 [Dockerfile](https://github.com/decentraland/transactions-server/blob/master/Dockerfile) 을 사용할 수 있습니다.

## 서버 사용하기

이제 모든 설정이 완료되어 서버가 실행 중이니, 실제로 서버를 사용해 보겠습니다.

트랜잭션을 보내려면 `/transactions`에 POST 요청을 보내야 합니다. 요청에 필요한 스키마는 `transactionSchema` 의 `src/ports/transaction/types.ts`.

대신 미리 만들어진 라이브러리를 사용해 더 간편하게 처리하고 싶다면 다음을 사용해 보세요. [decentraland-transactions](https://github.com/decentraland/decentraland-transactions)이 라이브러리는 다음과 같은 디앱에서 [decentraland-dapps](https://github.com/decentraland/decentraland-dapps) 을 통해 사용됩니다. 예를 들어 [마켓플레이스](https://market.decentraland.org)에서는 다음 유틸리티를 사용합니다. [`sendTransaction`](https://github.com/decentraland/decentraland-dapps/blob/master/src/modules/wallet/utils.ts#L104)예시는 [이 코드](https://github.com/decentraland/marketplace/blob/a2191515c6ae7ede54a685cc2dd9f9fafa35366b/webapp/src/modules/vendor/decentraland/OrderService.ts#L33) 를 확인하세요.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-ko/sdk7/blockchain/deploying-your-own-transactions-server.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
