> 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).

# 트랜잭션 서버 배포

사용자에게 비용 없는 트랜잭션을 제공하세요

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

트랜잭션 서버는 여러 네트워크를 사용하는 UX를 개선하고, 사용자가 즉석에서 네트워크 제공자를 전환하지 않도록 돕기 위해 사용됩니다. 사용자는 계속해서 [Ethereum](https://ethereum.org/en/) 에 연결된 상태를 유지하면서 [폴리곤](https://polygon.technology/) [거래에 서명하는 것만으로 상호작용할 수 있습니다](https://docs.decentraland.org/blockchain-integration/transactions-in-polygon/)

Decentraland DAO는 우리 dapp에서 사용하는 서버를 설정했으며, 몇 가지 [제한](#restrictions). 이 문서는 여러분이 어떻게 [이 서버를 배포하여](#running-the-server) 필요하다면 필요한 제한과 함께 사용자가 거래를 릴레이할 수 있도록 할 수 있는지 설명합니다.

## 제한

모든 제한은 사용자가 전송하려는 거래 단위로 적용됩니다. 실제로는 서버로의 POST 요청으로 해석됩니다.

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

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

## Gelato 설정하기

[Gelato](https://www.gelato.network/relay) 는 멀티체인 릴레이어 프로토콜입니다. 우리는 수수료 없는 거래를 가능하게 하기 위해 이 인프라를 사용합니다. 이는 실제로 거래를 전송하려고 할 때 메시지에 서명해서 Gelato로 보내는 것을 의미합니다. 이 서비스가 대신 거래를 전송하고, 응답(트랜잭션 해시)을 돌려줍니다.

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

[Gelato](https://www.gelato.network/relay) 서버용 API로 동작합니다. [설정하려면](#configuring-the-server) 먼저 API KEY가 필요하며, 우리는 [나중에 사용할 것입니다](#gelato). 이를 얻으려면:

* [서비스에](https://app.gelato.network/relay) 등록하세요
* 타깃으로 삼을 네트워크에 대해 새 dapp을 생성하세요. Decentraland 설정을 모방하려면:
  * 다음 `메인넷` 옵션
  * 적절한 `앱 이름` 을 dApp에 설정하세요
  * 선택하고 `폴리곤` 을 네트워크로 `스마트 컨트랙트`
  * 다음을 활성화하세요 `모든 컨트랙트` 토글 옵션을
* 에서 API KEY를 복사하세요 `API 키` 섹션

마지막으로, 새로 만든 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에 자금을 충전해야 하지만, 다음에서 Sepolia ETH 토큰을 받아 쉽게 할 수 있습니다 [파우셋](https://sepoliafaucet.com/).

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

먼저 Decentraland의 transactions-server 코드 사본이 필요합니다. 이것은 [github에서](https://github.com/decentraland/transactions-server/tree/v1)찾을 수 있습니다. 거기서 두 가지 방법이 있습니다:

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

* 클릭하세요 `Download ZIP`
* 아래의 URL을 복사하세요 `복제` 제목을 복사한 뒤 다음을 실행하세요 `$ 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

Gelato 설정 시 얻은 API KEY를 사용하세요 [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](/creator/content-creator-ko/sdk7/blockchain/deploying-your-own-transactions-server.md) 를 참고하되, 요약하면 다음이 필요합니다:

* 설치되어 [NodeJS](https://nodejs.org/en/) 있어야 합니다
* 원하는 터미널을 여세요
* 다음 명령을 실행하세요:

```bash
npm install
npm run migrate # 첫 실행에서만
npm run start
```

물론 이것을 다음과 같은 원하는 서비스에 배포하고 싶을 것입니다 [AWS](https://aws.amazon.com/) 예를 들어. 프로젝트의 [Dockerfile](https://github.com/decentraland/transactions-server/blob/master/Dockerfile) 을 사용하면 됩니다.

## 서버 사용하기

이제 모든 것이 설정되고 실행되었으니, 실제로 서버를 사용할 시간입니다.

실제로 거래를 보내려면 다음으로 POST 요청을 해야 합니다 `/transactions`. 요청에 필요한 스키마는 다음에서 정의됩니다 `transactionSchema` 에서 `src/ports/transaction/types.ts`.

대신, 미리 만들어진 라이브러리를 사용해 더 쉽게 작업하고 싶다면 다음을 시도해 볼 수 있습니다 [decentraland-transactions](https://github.com/decentraland/decentraland-transactions). 이는 다음을 통해 사용됩니다 [decentraland-dapps](https://github.com/decentraland/decentraland-dapps) 우리 dapp들에서 사용되며, 예를 들어 [마켓플레이스](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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
