Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deploy.md #1476

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions docs/2.develop/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ Thanks to the `NEAR CLI` deploying a contract is as simple as:
#### Create an Account and Deploy
```bash
# Automatically deploy the wasm in a new account
near dev-deploy <route_to_wasm>
near account create-account sponsor-by-faucet-service <my-new-dev-account>.testnet autogenerate-new-keypair save-to-keychain network-config testnet create

# Get the account name
cat ./neardev/dev-account

near contract deploy <my-new-dev-account>.testnet use-file <route_to_wasm> without-init-call network-config testnet sign-with-keychain
```

#### Deploy in an Existing Account
```bash
# login into your account
near login
near account import-account using-web-wallet network-config testnet

# deploy the contract
near deploy <accountId> <route_to_wasm>
```
near contract deploy <accountId> use-file <route_to_wasm> without-init-call network-config testnet sign-with-keychain send```

:::tip
You can overwrite a contract by deploying another on top of it. In this case, the account's logic
Expand All @@ -64,7 +63,7 @@ initialize the state. This is not necessary if your contract implements `default

```bash
# Call the initialization method (`init` in our examples)
near call <contractId> <initMethod> [<args>] --accountId <accountId>
near contract call-function as-transaction <contractId> <initMethod> json-args [<args>] prepaid-gas '30 TeraGas' attached-deposit '0 NEAR' sign-as <accountId> network-config testnet sign-with-keychain send
```

:::info
Expand All @@ -82,7 +81,7 @@ Once your contract is deployed you can interact with it right away using [NEAR C
View methods are those that perform **read-only** operations. Calling these methods is free, and do not require to specify which account is being used to make the call:

```bash
near view <contractId> <methodName>
near contract call-function as-read-only <contractId> <methodName> text-args '' network-config testnet now
```

:::tip
Expand All @@ -96,5 +95,5 @@ Change methods are those that perform both read and write operations. For these
since that account will expend GAS in the call.

```bash
near call <contractId> <methodName> <jsonArgs> --accountId <yourAccount> [--deposit <amount>] [--gas <GAS>]
near contract call-function as-transaction <AccountId> <MethodName> json-args <JsonArgs> prepaid-gas <PrepaidGas> attached-deposit <AttachedDeposit> sign-as <AccountId> network-config testnet sign-with-keychain send
```