Set up for Tutorials

Set up for Tutorials

Nodit Aptos 튜토리얼에서는 Aptos TypeScript SDK와 Aptos Faucet Client, Aptos CLI 등 다양한 라이브러리를 이용합니다. 이를 진행하기 위해 필요한 환경 설정은 다음과 같습니다.


Nodit 회원가입 및 Aptos Node 연결

아래 링크를 클릭하여 Nodit 회원가입을 진행할 수 있습니다. 신규 계정 만들거나 기존에 보유 중인 구글 계정을 이용하여 Nodit에 회원가입을 할 수 있습니다.

회원가입이 완료되었다면 온보딩 페이지로 이동하게 됩니다. 사용자가 원하는 블록체인 노드를 선택해 연결할 수 있습니다.

  • 본 튜토리얼을 진행하기 위해서는 Aptos Testnet 노드를 반드시 연결해야 합니다.
스크린샷 2024-07-15 오후 1.20.37.png

정상적으로 완료된 경우 위와 같이 Aptos 노드가 연결된 것을 확인할 수 있습니다.


실행 환경 설정

원활한 튜토리얼 진행을 위해 다음의 프로그램 설치가 필요합니다.

  • Node.js 설치

Javascript를 실행할 수 있는 런타임 환경으로 Typescript로 입력한 코드를 실행하기 위해 필요합니다.

터미널 창에 아래 명령어를 입력하여 Node.js 설치 완료 여부를 확인할 수 있습니다.

$ node -v
v20.11.0

  • 패키지 설치

Node.js 설치가 완료 되었다면 Typescript 실행을 위한 패키지 설치가 필요합니다. 패키지는 Node.js를 이용해 진행할 수 있으며 터미널 창에 아래의 명령어를 입력합니다.

$ npm init
$ npm install ts-node typescript -g
$ tsc --init

  • Aptos Typescript SDK 설치

Node.js를 이용하여 Aptos 재단에서 제공하는 Typescript SDK를 설치합니다. Typescript SDK를 이용하여 Aptos Account 생성, 트랜잭션 실행 등 Aptos를 더욱 편리하게 이용할 수 있습니다. 터미널 창에 아래의 명령어를 입력하여 설치할 수 있습니다.

$ npm install @aptos-labs/ts-sdk

  • Aptos faucet-client 설치

Node.js를 이용하여 Aptos 재단에서 제공하는 Aptos faucet client를 설치합니다. 사용자는 이를 이용하여 Aptos Testnet, Devnet 환경에서 Faucet을 받을 수 있습니다. 터미널 창에 아래의 명령어를 입력하여 설치할 수 있습니다.

$ npm install @aptos-labs/aptos-faucet-client

  • Aptos CLI 설치

Aptos는 다양한 운영 환경에 맞는 CLI 설치 방법을 제공하고 있습니다. 아래 링크를 클릭하여 자신의 운영 환경에 맞는 Aptos CLI를 설치해보세요.

설치가 정상적으로 완료 되었다면 터미널창에 다음과 같이 입력하여 도움말을 확인할 수 있습니다.

$ aptos --help
Command Line Interface (CLI) for developing and interacting with the Aptos blockchain

Usage: aptos <COMMAND>

Commands:
  account     Tool for interacting with accounts
  config      Tool for interacting with configuration of the Aptos CLI tool
  genesis     Tool for setting up an Aptos chain Genesis transaction
  governance  Tool for on-chain governance
  info        Show build information about the CLI
  init        Tool to initialize current directory for the aptos tool
  key         Tool for generating, inspecting, and interacting with keys
  move        Tool for Move related operations
  multisig    Tool for interacting with multisig accounts
  node        Tool for operations related to nodes
  stake       Tool for manipulating stake and stake pools
  update      Update the CLI or other tools it depends on
  help        Print this message or the help of the given subcommand(s)