> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/ko/getting-started-1/quickstart.md).

# 빠른 시작

5분 이내에 Rome에 첫 Solidity 계약을 배포하세요.

5분도 안 되어 Rome에서 첫 Solidity 컨트랙트를 배포해 보세요. 이 가이드는 [**Hadrian**](https://docs.rome.builders/ko/networks/hadrian.md), 공개 테스트넷 체인입니다. [Rubicon](https://docs.rome.builders/ko/networks/rubicon.md) 메인넷 체인으로, 가스가 실제 USDC입니다. 먼저 테스트 체인에서 모든 것을 시도해 보세요.

## 필수 조건

* [Node.js](https://nodejs.org/) v22.13+
* [MetaMask](https://metamask.io/) 브라우저 확장 프로그램
* 솔라나 지갑이 **Devnet**으로 설정된 경우에만 가능합니다(2단계). 솔라나 지갑에서 컨트랙트를 호출하려면 Solana v1 트랜잭션에 서명할 수 있는 지갑이 필요하며, 이는 [컨트랙트를 Solana 사용자에게 개방하기](https://docs.rome.builders/ko/developer-guides/open-to-solana-users.md).

## 1. MetaMask에 Hadrian 추가

수동으로 추가하세요(설정 → 네트워크 → 네트워크 추가):

| 필드      | 값                                               |
| ------- | ----------------------------------------------- |
| 네트워크 이름 | Rome Hadrian                                    |
| RPC URL | `https://hadrian.testnet.romeprotocol.xyz/`     |
| 체인 ID   | `200010`                                        |
| 통화 기호   | `USDC`                                          |
| 블록 탐색기  | `https://via-hadrian.testnet.romeprotocol.xyz/` |

## 2. 지갑에 자금 넣기

가스는 체인의 가스 토큰으로 지불되며, Hadrian에서는 USDC입니다. Hadrian에서는 Circle의 Solana Devnet USDC로 담보되어 있고(민트 `4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU`), 따라서 devnet SOL은 가스가 아닙니다. Rome에는 faucet이 없습니다. Hadrian에 USDC를 넣는 방법은 두 가지입니다:

**솔라나에서** — 다음에서 Solana Devnet USDC를 받으세요 [Circle faucet](https://faucet.circle.com/) (Solana Devnet 선택) 및 Solana 수수료용 devnet SOL도 조금을 [Solana faucet](https://faucet.solana.com/)솔라나 지갑을 Devnet으로 설정한 상태에서. 그런 다음 [Rome Bridge](https://docs.rome.builders/ko/rome-1/bridge-api.md) Hadrian을 대상으로 하고 Solana 경로를 사용하는 브리지를 사용하며, 수신자는 EVM 지갑의 주소로 지정하세요. 그러면 브리지가 해당 EVM 지갑에 Hadrian에서 클레임 트랜잭션에 서명하도록 요청하고, 그 결과 USDC가 가스로 전환됩니다.

**EVM 체인에서 브리징해서** — Ethereum Sepolia에서 테스트 USDC를 다음에서 민트한 다음 [Circle faucet](https://faucet.circle.com/)다음을 사용해 Rome으로 가져오세요 [Rome Bridge](https://docs.rome.builders/ko/rome-1/bridge-api.md) (CCTP). 소스 측 트랜잭션을 위해 Sepolia ETH가 조금 필요합니다 — [파우셋](https://docs.rome.builders/ko/resources/faucets.md) 각 faucet을 확인하세요.

**얼마나?** Rome에서의 쓰기는 Ethereum 직관보다 더 비싸게 느껴지는데, 대부분의 가스가 Solana 계정 생성에 쓰이기 때문입니다: 한 번도 사용되지 않은 수신자, 새 토큰 계정, 배포된 컨트랙트. standard tooling이 하는 것처럼 `eth_estimateGas`그리고 21,000을 하드코딩하지 마세요. 추정치는 계정 생성을 포함하며, Rome은 트랜잭션이 실제로 사용한 가스만 청구합니다(Hadrian 측정에서는 추정치를 넘은 적이 없었습니다). 또한 SDK의 `submitRomeTx` 가 추정치를 1.3배로 여유 있게 늘려주는데, 실제로 사용된 가스만 청구되므로 비용은 추가되지 않습니다. 최소 **0.5 USDC 상당의 가스**; 1 USDC면 여유가 충분합니다. 다음의 숫자들 [JSON-RPC 지원](https://docs.rome.builders/ko/reference/json-rpc.md) 각 개별 쓰기 비용을 보여줍니다.

Solana 측 예치가 자금이 충분한 지갑인데도 "insufficient SOL" 경고와 함께 실패하면, Solana 지갑을 Testnet Mode / Devnet으로 설정하세요(다음을 참고 [FAQ](https://docs.rome.builders/ko/resources/faq.md)).

## 3. Hardhat 프로젝트 만들기

```bash
mkdir rome-hello && cd rome-hello
npx hardhat --init
```

프롬프트가 나오면 기본값을 수락하세요 — Hardhat 3, 현재 디렉터리, 그리고 TypeScript + Node Test Runner + viem 템플릿 — 그리고 의존성 설치를 진행하세요. 이 템플릿에는 예시 `Counter` 컨트랙트와 테스트가 포함되어 있으며, 이 가이드와는 충돌하지 않습니다.

## 4. Rome용으로 Hardhat 설정

생성된 `hardhat.config.ts` 을 편집하고 `안에 Rome 네트워크를 추가하세요`:

```typescript
  네트워크: {
    hadrian: {
      type: "http",
      chainType: "l1",
      chainId: 200010,
      url: "https://hadrian.testnet.romeprotocol.xyz/",
      accounts: [configVariable("PRIVATE_KEY")],
    },
  },
```

`configVariable("PRIVATE_KEY")` 는 환경에서 확인되므로, MetaMask 개인 키를 내보내세요:

```bash
export PRIVATE_KEY="0xYOUR_PRIVATE_KEY"
```

(임시 키를 넘는 용도로는, 툴박스에 포함된 암호화된 keystore를 사용하는 것이 좋습니다: `npx hardhat keystore set PRIVATE_KEY`.)

## 5. 컨트랙트 작성

Create `contracts/HelloRome.sol`:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;

contract HelloRome {
    string public greeting = "Hello from Solana!";
    uint256 public counter;

    event Greeted(address indexed sender, uint256 count);

    function greet() external returns (string memory) {
        counter++;
        emit Greeted(msg.sender, counter);
        return greeting;
    }

    function setGreeting(string calldata _greeting) external {
        greeting = _greeting;
    }
}
```

## 6. 배포

Create `scripts/deploy.ts`:

```typescript
import hardhat from "hardhat";

async function main() {
  const { viem } = await hardhat.network.connect();
  const publicClient = await viem.getPublicClient();

  const hello = await viem.deployContract("HelloRome");
  console.log("HelloRome deployed to:", hello.address);

  const hash = await hello.write.greet();
  await publicClient.waitForTransactionReceipt({ hash });

  console.log("Counter:", (await hello.read.counter()).toString());
  console.log("Greeting:", await hello.read.greeting());
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});
```

Hadrian에 배포:

```bash
npx hardhat run scripts/deploy.ts --network hadrian
```

예상 출력(주소는 다를 것입니다):

```
HelloRome deployed to: 0x09c437e305eeb698e1776cff23ca16c1bb25aabd
Counter: 1
Greeting: Hello from Solana!
```

배포된 주소를 [탐색기](https://via-hadrian.testnet.romeprotocol.xyz/) 에서 열어 트랜잭션을 확인하고, 그 트랜잭션을 정산한 솔라나 트랜잭션으로 이어지는 "Settled in" 링크를 따라가세요. 이제 당신의 Solidity 컨트랙트가 솔라나에서 실행되고 있습니다.

## 다음은 무엇인가

* [Solidity 배포](https://docs.rome.builders/ko/developer-guides/deploy-solidity.md) — Hardhat 및 Foundry 배포 심층
* [EVM에서 Solana 호출](https://docs.rome.builders/ko/developer-guides/call-solana-from-evm.md) — CPI를 통해 Solidity에서 솔라나 프로그램 호출
* [아키텍처](https://docs.rome.builders/ko/getting-started-1/architecture.md) — Rome이 솔라나 안에서 EVM을 실행하는 방식

## 일반적인 오류

| 오류             | 원인                               | 해결                                                                                                        |
| -------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `자금 부족`        | 가스 한도 × 가스 가격에 비해 가스 토큰이 충분하지 않음 | 다음과 함께 최소 0.5 USDC 상당의 가스를 넣으세요(2단계 참고) [Rome Bridge](https://docs.rome.builders/ko/rome-1/bridge-api.md) |
| `nonce가 너무 낮음` | 트랜잭션 nonce 불일치                   | 계정을 초기화하세요(MetaMask → 설정 → 고급 → 활동 지우기)                                                                   |
| `실행이 되돌려짐`     | 컨트랙트 실행 실패                       | 컨트랙트 로직을 확인하세요; 다음을 사용해 `eth_call` 디버그하세요                                                                 |
| 연결 시간 초과       | RPC에 접근할 수 없음                    | RPC URL을 확인하세요                                                                                            |


---

# 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.rome.builders/ko/getting-started-1/quickstart.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.
