NEAR CLI - 기초
컨트랙트가 준비되면, 모든 사람이 사용할 수 있도록 NEAR 네트워크에 배포할 수 있습니다.
NEAR CLI를 사용하여 컨트랙트를 배포하고, 컨트랙트 내 메서드를 호출하는 방법을 안내해 드립니다.
정보
이 페이지에서는 NEAR CLI의 기본 사항만 다룹니다. 자세한 내용은 NEAR CLI 설명서 페이지를 참조하세요.
Deploying the Contract
NEAR CLI
덕분에 컨트랙트 배포는 다음과 같이 간단하게 수행될 수 있습니다.
- 컨트랙트를 wasm으로 컴파일합니다(템플릿 내
yarn build
를 통해 자동으로 수행됨). - Create an account and deploy the contract into it using
NEAR CLI
.
계정 생성 및 배포
- near-cli
- near-cli-rs
# Create a new account pre-funded by a faucet & deploy
near create-account <accountId> --useFaucet
near deploy <accountId> <route_to_wasm>
# Get the account name
cat ./neardev/dev-account
# Automatically deploy the wasm in a new account
near account create-account sponsor-by-faucet-service <my-new-dev-account>.testnet autogenerate-new-keypair save-to-keychain network-config testnet create
near contract deploy <my-new-dev-account>.testnet use-file <route_to_wasm> without-init-call network-config testnet sign-with-keychain
기존 계정에 배포
- near-cli
- near-cli-rs
# login into your account
near login
# deploy the contract
near deploy <accountId> <route_to_wasm>