diff --git a/blog/2024-06-05.md b/blog/2024-06-05.md index cb6f2fb2ac7..ff27a79e7b4 100644 --- a/blog/2024-06-05.md +++ b/blog/2024-06-05.md @@ -24,6 +24,11 @@ Scrolling down will reveal the option `Windows Subsystem for Linux`. Make sure i Now we will spend some time in either `PowerShell` or [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701), which is a modern terminal application that supports various command-line tools and shells. +```bash +# may be desirable for seamless integration between WSL2 distros of linux and docker with WSL backend +wsl --set-default-version 2 +``` + ``` wsl --install --d Ubuntu ``` diff --git a/blog/2024-08-13.md b/blog/2024-08-13.md new file mode 100644 index 00000000000..450d320cfa7 --- /dev/null +++ b/blog/2024-08-13.md @@ -0,0 +1,65 @@ +--- +title: Future of Pagoda Services +authors: [ewiner] +slug: 2024-08-13-pagoda-services +tags: [updates] +hide_table_of_contents: false +--- + +As the NEAR ecosystem continues to decentralize, Pagoda will cease operations within the next six months and decentralize its functions into NEAR ecosystem teams and committees. This document describes the transition plan for each of the services, activities, and tools that Pagoda develops or operates. + + + +### Critical NEAR Services + +The critical services below will continue to be operated and maintained by Pagoda until they are smoothly transitioned to new operators in the NEAR ecosystem during the second half of 2024: + +- [near.org RPC](https://docs.near.org/api/rpc/providers) +- [NEAR Lake](https://docs.near.org/concepts/advanced/near-lake-framework) +- [BigQuery Public Dataset](https://docs.near.org/build/data-infrastructure/big-query) +- [Node Snapshots](https://near-nodes.io/intro/node-data-snapshots) +- [State Sync](https://near-nodes.io/rpc/state-sync) +- Undocumented but critical services: + - KitWallet Indexer API + - near-cli Testnet Faucet + +Each transition will be independently planned and communicated on its own timeline and this page will be updated accordingly. + +The NEAR [Infrastructure Committee](https://dev.near.org/infrastructure-committee.near/widget/near-prpsls-bos.components.pages.app?page=about) will manage this transition process by soliciting proposals from the community for continued operation of these services, then will select, fund, and oversee the new operator. + +#### A Note About near.org RPC + +The Infrastructure Committee feels that Pagoda's fully-subsidized near.org RPC service is getting in the way of decentralization efforts and is preventing high-quality commercial RPC offerings from gaining traction. If a NEAR core team continues to support a free-to-use near.org RPC service, it will be required to gradually lower its rate limits over the coming months to prevent abuse. More details on this plan will be communicated by the end of September 2024. In light of this proposed change, **high-traffic near.org RPC users should start making plans to switch to other RPC providers**. + +### Chain Abstraction Services + +[Chain Signatures](https://docs.near.org/concepts/abstraction/chain-signatures), [Multichain Gas Relayer](https://docs.near.org/build/chain-abstraction/multichain-gas-relayer/overview), and [FastAuth](https://docs.near.org/build/chain-abstraction/fastauth-sdk) will continue to be developed by Pagoda, then will be taken over by the new Chain Abstraction / Multichain spinout from Pagoda and Proximity. More information will be shared in September or October 2024. + +### Pagoda Operations & Ecosystem Services + +Pagoda’s ecosystem services will transition as follows: + +- [Infrastructure Committee](https://dev.near.org/infrastructure-committee.near/widget/near-prpsls-bos.components.pages.app?page=about) administration, the recently rebooted Security Assessment Program, and management of the [near.org](http://near.org) website will move under the purview of NEAR Foundation. +- [Bug bounty](https://hackenproof.com/company/near/programs) triage will be transitioned to the protocol team at NEAR One. +- The [NEAR Helpdesk](https://help.near.org/) will be turned into self-service documentation. +- Pagoda's informal technical / smart contract advisory services for other ecosystem companies will wind down over the next few months. + +### Open-Source Libraries + +These open-source libraries and tools will be developed by Pagoda until they reach a logical completion or stopping point: + +- [Pagoda Metatransaction Relayer](https://github.com/near/pagoda-relayer-rs) +- [Chain Hosted UI](https://github.com/near/chain-hosted-ui) +- [Modularization and Refactor](https://t.me/neardev/53280) of near-api-js + +Once active development by Pagoda has ceased, it doesn't mean these tools have to languish. We encourage the NEAR community to continue this work. If you need funding to do so, you can submit proposals to [DevHub](https://dev.near.org/devhub.near/widget/app) or the [Infrastructure Committee](https://dev.near.org/infrastructure-committee.near/widget/near-prpsls-bos.components.pages.app?page=about). + +### Deprecated Services + +Between now and February 2025, Pagoda's development work will slow down or stop on the following products and services: + +- [QueryAPI](https://docs.near.org/build/data-infrastructure/query-api/intro) +- [Enhanced API](https://docs.near.org/pagoda/rpc/api) +- [Alerts & Triggers](https://docs.near.org/pagoda/alerts/intro) + +These are open-source services and we encourage the community to continue with their development and operation. If we can't identify new operators quickly, we will encourage remaining users of these services to switch to alternative solutions, then communicate a timeline for these services to be turned off. diff --git a/docs/1.concepts/3.advanced/indexers.md b/docs/1.concepts/3.advanced/indexers.md index e634f60dcb4..350d0b1196e 100644 --- a/docs/1.concepts/3.advanced/indexers.md +++ b/docs/1.concepts/3.advanced/indexers.md @@ -88,4 +88,4 @@ We hope this article gives you an understanding of the Indexer concept. Also, we ## What's next? We encourage you to learn more about the [Lake Indexer project](/build/data-infrastructure/lake-framework/near-lake). Please, proceed to [Tutorials](/build/data-infrastructure/lake-framework/near-lake-state-changes-indexer) section to learn how to build an indexer on practice. -Alternatively, there are a few other third-party indexers that are tightly integrated with the NEAR ecosystem. You can review all of your data sourcing options (including The Graph, Pagoda, Pipespeak, and SubQuery) under [data tools](/concepts/data-flow/data-storage#data-tools). +Alternatively, there are a few other third-party indexers that are tightly integrated with the NEAR ecosystem. You can review all of your data sourcing options (including The Graph, Pagoda, Pikespeak, and SubQuery) under [data tools](/concepts/data-flow/data-storage#data-tools). diff --git a/docs/1.concepts/web3/blockchain.md b/docs/1.concepts/web3/blockchain.md index 65fb7839f3d..aedd5c37411 100644 --- a/docs/1.concepts/web3/blockchain.md +++ b/docs/1.concepts/web3/blockchain.md @@ -153,7 +153,7 @@ There are a lot of blockchains out there and it might be hard to choose the most Historically, the first blockchain to introduce smart contracts was Ethereum. However, as the number of users grew, transaction speed and cost skyrocketed, and it became apparent that it couldn't handle the demand. So, a number of [scaling solutions](https://ethereum.org/en/developers/docs/scaling/) appeared - [layer 2 chains](https://ethereum.org/en/developers/docs/scaling/#layer-2-scaling), [sidechains](https://ethereum.org/en/developers/docs/scaling/sidechains/), and [plasma chains](https://ethereum.org/en/developers/docs/scaling/plasma/). However, they all use some kind of workarounds with their own unique drawbacks. Ethereum tries to fix the core problem and redesign its network - like switching to a Proof-of-stake consensus, which is ongoing for quite a long time, but exact timeline when all of the problems will be fixed is very unclear. -Meanwhile, a new generation of blockchains started to appear. They learned from the Etherium mistakes, and designed them from ground-up to be fast, cheap and scalable. +Meanwhile, a new generation of blockchains started to appear. They learned from the Ethereum mistakes, and designed them from ground-up to be fast, cheap and scalable. Choosing the right one is by no means an easy task, but for us we found the [NEAR](https://near.org/) blockchain to be an ideal solution, because of the following properties: - Transactions are cheap and very fast. - Designed to be extremely scalable from the beginning. This means we can count that transaction cost and speed will remain stable in the future. diff --git a/docs/1.concepts/web3/near.md b/docs/1.concepts/web3/near.md index 8fd15f32247..31974c7c2f4 100644 --- a/docs/1.concepts/web3/near.md +++ b/docs/1.concepts/web3/near.md @@ -148,7 +148,7 @@ As an alternative to building your own indexer with a database and an API server By now, we should be familiar with necessary concepts to start developing WEB 3.0 applications, so let’s explore the development tools available. -First of all, we need a development and testing environment. Of course, we could theoraticaly perform development and testing on the main blockchain network, but this would not be cheap. For this reason, NEAR provides [several networks](../../1.concepts/basics/networks.md) that can be used during development: +First of all, we need a development and testing environment. Of course, we could theoretically perform development and testing on the main blockchain network, but this would not be cheap. For this reason, NEAR provides [several networks](../../1.concepts/basics/networks.md) that can be used during development: - testnet - public NEAR network which is identical to mainnet and can be used for free. - localnet - you can deploy your personal NEAR network on your own environment. Because it’s owned by you, data and code can be kept private during development. More info on how you can run your own node can be [found here](https://near-nodes.io/validator/running-a-node). Alternatively, you can bootstrap an entire testing infrastructure in Docker on your local machine using Kurtosis - [guide is here](../../2.build/2.smart-contracts/testing/kurtosis-localnet.md). - workspaces - you can start your own local network to perform e2e testing. More info [here](../../2.build/2.smart-contracts/testing/integration-test.md). diff --git a/docs/1.concepts/web3/nfts.md b/docs/1.concepts/web3/nfts.md index 37b3b3b20d3..984a802ac7b 100644 --- a/docs/1.concepts/web3/nfts.md +++ b/docs/1.concepts/web3/nfts.md @@ -325,7 +325,7 @@ In the blockchain world, creation of new NFTs is usually called minting. And as -* Users can mint them directly. This can be done by either allowing creation of NFTs from scratch, or by using more complex processes, like breeding or upgrading. The most famous example of such process is breeding in [CrytoKitties](https://www.cryptokitties.co/) game - new NFTs are created by combining existing ones. With this approach users usually have to pay to cover the storage and gas cost of NFTs creation. +* Users can mint them directly. This can be done by either allowing creation of NFTs from scratch, or by using more complex processes, like breeding or upgrading. The most famous example of such process is breeding in [CryptoKitties](https://www.cryptokitties.co/) game - new NFTs are created by combining existing ones. With this approach users usually have to pay to cover the storage and gas cost of NFTs creation. * NFTs can be distributed by the developer to a set of users - it is usually called [NFTs airdrop](https://www.investopedia.com/terms/a/airdrop-cryptocurrency.asp). Most often this is used as a marketing strategy to kickstart NFTs usage in applications. Storage and gas costs in this case are covered by developers. * NFTs can be bought on a market or obtained from the lootbox. Depending on an exact strategy, costs can either be paid by a user or by developer. Also, in this case NFTs sometimes can be minted on-demand, to avoid paying upfront costs. @@ -516,7 +516,7 @@ Implementing an own Marketplace contract is more involved since there is no stan * [Basic marketplace example](../../3.tutorials/nfts/8-marketplace.md) * [Paras ](https://paras.id/)marketplace contract - [source](https://github.com/ParasHQ/paras-marketplace-contract/tree/master/paras-marketplace-contract/src). -As for third-party solutions, the most complete one is [Mintibase](https://www.mintbase.io/), which provides a full suite of components for NFTs integration - including contracts, indexer, API and a web client: +As for third-party solutions, the most complete one is [Mintbase](https://www.mintbase.io/), which provides a full suite of components for NFTs integration - including contracts, indexer, API and a web client: diff --git a/docs/2.build/1.chain-abstraction/fastauth-sdk.md b/docs/2.build/1.chain-abstraction/fastauth-sdk.md index b01a8e8a7dc..dfa58e4e6ed 100644 --- a/docs/2.build/1.chain-abstraction/fastauth-sdk.md +++ b/docs/2.build/1.chain-abstraction/fastauth-sdk.md @@ -75,7 +75,7 @@ service cloud.firestore { - Press the gear button next to "Project Overview", and go to "Project settings" - Under "Your apps", click on the `` button - Set the app nickname as `issuer-gcp` and hit "Register app" -- You should see the code needed for initilization and authentication of Firestore, such as: +- You should see the code needed for initialization and authentication of Firestore, such as: ```js // Import the functions you need from the SDKs you need import { initializeApp } from "firebase/app"; @@ -253,7 +253,7 @@ const onCLick = () => selector.then((selector: any) => selector.wallet('fast-aut }),); ``` -Wehenever the user tries to login, call `onClick`. +Whenever the user tries to login, call `onClick`. ### Getting added to the MPC recovery service diff --git a/docs/2.build/1.chain-abstraction/meta-transactions.md b/docs/2.build/1.chain-abstraction/meta-transactions.md index 7167cca077a..5816879abc2 100644 --- a/docs/2.build/1.chain-abstraction/meta-transactions.md +++ b/docs/2.build/1.chain-abstraction/meta-transactions.md @@ -86,7 +86,7 @@ In this method we are creating an arbitrary smart contract call, instantiating a As mentioned in the above note in order to be able to relay on the client side it's necessary to have access to signing transactions directly on the client. Luckily leveraging the near biometric library it's possible to do so in a non custodial way. -By calling this method and passing in the URL for the account creation endpoint (mentioned in the server section) as well as the `accoundId` everything is handled under the hood to successfully create an account. +By calling this method and passing in the URL for the account creation endpoint (mentioned in the server section) as well as the `accountId` everything is handled under the hood to successfully create an account. diff --git a/docs/2.build/1.chain-abstraction/wallet.md b/docs/2.build/1.chain-abstraction/wallet.md index 9843cec2f06..e85b42351bc 100644 --- a/docs/2.build/1.chain-abstraction/wallet.md +++ b/docs/2.build/1.chain-abstraction/wallet.md @@ -10,7 +10,7 @@ You'll also learn how to ensure that a signature on one chain is not used to tak ### Key derivation -When signing using [chain signatures](./chain-signatures.md) each account has an unlimited number of keys. Each key's public key is derived from the account name and the key extension which is an arbitrary string. +When signing using [chain signatures](./chain-signatures/chain-signatures.md) each account has an unlimited number of keys. Each key's public key is derived from the account name and the key extension which is an arbitrary string. User's keys can be described as follow: @@ -94,7 +94,7 @@ In the following examples, the messages are coming from the user's wallet fronte - [Using a personal Bitcoin key](#using-a-personal-bitcoin-key) - [Using a personal EVM key to sign a Binance transaction](#using-a-personal-evm-key-to-sign-a-binance-transaction) - [Using an untyped domain key](#using-an-untyped-domain-key) -- [Using another domains Bitcoin key](#using-another-domains-bitcoin-key) +- [Using another domain's Bitcoin key](#using-another-domains-bitcoin-key) :::tip Wallet developers should follow this user flow format. diff --git a/docs/2.build/2.smart-contracts/testing/kurtosis-localnet.md b/docs/2.build/2.smart-contracts/testing/kurtosis-localnet.md index 1c5c72d6fc3..a958378a90b 100644 --- a/docs/2.build/2.smart-contracts/testing/kurtosis-localnet.md +++ b/docs/2.build/2.smart-contracts/testing/kurtosis-localnet.md @@ -622,9 +622,9 @@ Once you've logged in, you can sign a message with an optional donation. --- -## Managing NEAR Pacakages +## Managing NEAR Packages -The Kurtosis NEAR Pacakages you create will continue to run on your local machine for as long as your Docker engine is running. This package runs inside of a Kurtosis "enclave" which is an environment isolated from both your computer and other enclaves. In practice, this means that you can have multiple independent local NEAR clusters running on your machine simply by rerunning the script we executed from the [setup instructions](#setup). +The Kurtosis NEAR Packages you create will continue to run on your local machine for as long as your Docker engine is running. This package runs inside of a Kurtosis "enclave" which is an environment isolated from both your computer and other enclaves. In practice, this means that you can have multiple independent local NEAR clusters running on your machine simply by rerunning the script we executed from the [setup instructions](#setup). ### View Package Status diff --git a/docs/2.build/5.primitives/ft.md b/docs/2.build/5.primitives/ft.md index 3ce1811eda0..cd9eb8d1a78 100644 --- a/docs/2.build/5.primitives/ft.md +++ b/docs/2.build/5.primitives/ft.md @@ -33,7 +33,7 @@ import CLICreateToken from "./ft/near-cli/create.md" import SmartContractSendToken from "./ft/smart-contract/send.md" import SmartContractAttachTokenToCall from "./ft/smart-contract/attach-to-call.md" -Besides the native NEAR token, NEAR accounts have access to a [multitude of tokens](https://guide.ref.finance/developers-1/cli-trading#query-whitelisted-tokens) to use thoughtout the ecosystem. Moreover, it is even possible for users to create their own fungible tokens. +Besides the native NEAR token, NEAR accounts have access to a [multitude of tokens](https://guide.ref.finance/developers-1/cli-trading#query-whitelisted-tokens) to use throughout the ecosystem. Moreover, it is even possible for users to create their own fungible tokens. In contrast with the NEAR native token, fungible token (FT) are **not stored** in the user's account. In fact, each FT lives in **their own contract** which is in charge of doing **bookkeeping**. This is, the contract keeps track of how many tokens each user has, and handles transfers internally. diff --git a/docs/2.build/6.data-infrastructure/lake-data-structures/state_change.mdx b/docs/2.build/6.data-infrastructure/lake-data-structures/state_change.mdx index 1af0fdcb5d9..4554f436e5c 100644 --- a/docs/2.build/6.data-infrastructure/lake-data-structures/state_change.mdx +++ b/docs/2.build/6.data-infrastructure/lake-data-structures/state_change.mdx @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem'; ## Definition -This entitiy from `nearcore` describes how account's state has changed and the reason +This entity from `nearcore` describes how account's state has changed and the reason ## `StateChangeWithCauseView` @@ -101,4 +101,3 @@ export type StateChange = { - diff --git a/docs/2.build/6.data-infrastructure/lake-data-structures/transaction.mdx b/docs/2.build/6.data-infrastructure/lake-data-structures/transaction.mdx index 093fec57137..34f941f9679 100644 --- a/docs/2.build/6.data-infrastructure/lake-data-structures/transaction.mdx +++ b/docs/2.build/6.data-infrastructure/lake-data-structures/transaction.mdx @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem'; ## Definition -Transaction is the main way of interraction between a user and a blockchain. Transaction contains: +Transaction is the main way of interaction between a user and a blockchain. Transaction contains: - Signer account ID - Receiver account ID - Actions diff --git a/docs/2.build/6.data-infrastructure/lake-framework/migrating-to-near-lake-framework.md b/docs/2.build/6.data-infrastructure/lake-framework/migrating-to-near-lake-framework.md index 44e00dda479..a954186dd4d 100644 --- a/docs/2.build/6.data-infrastructure/lake-framework/migrating-to-near-lake-framework.md +++ b/docs/2.build/6.data-infrastructure/lake-framework/migrating-to-near-lake-framework.md @@ -499,7 +499,7 @@ We are posting the complete diffs for the reference - /// Specify a custom download URL for the genesis file. - #[clap(long)] - pub download_genesis_url: Option, -- /// Download the verified NEAR config file automtically. +- /// Download the verified NEAR config file automatically. - #[clap(long)] - pub download_config: bool, - /// Specify a custom download URL for the config file. diff --git a/docs/2.build/6.data-infrastructure/lake-framework/running-near-lake/credentials.md b/docs/2.build/6.data-infrastructure/lake-framework/running-near-lake/credentials.md index 9c9e6ce033e..666bcca61d8 100644 --- a/docs/2.build/6.data-infrastructure/lake-framework/running-near-lake/credentials.md +++ b/docs/2.build/6.data-infrastructure/lake-framework/running-near-lake/credentials.md @@ -30,7 +30,7 @@ aws_secret_access_key= [AWS docs: Configuration and credential file settings](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) -#### Environment varibales +#### Environment variables Alternatively, you can provide your AWS credentials via environment variables with constant names: diff --git a/docs/4.tools/cli-rs.md b/docs/4.tools/cli-rs.md deleted file mode 100644 index baa8f452d33..00000000000 --- a/docs/4.tools/cli-rs.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -id: near-cli-rs -title: NEAR CLI RS ---- - -# NEAR-CLI-RS - -## Quick Start Guide - -The `near-cli-rs` tool is a human-friendly companion that helps you interact with the [NEAR Protocol](https://near.org/) from the command line. This has a guided prompt interface to help you make your own commands built in Rust. - -:::info note - -This is a separate tool from [near-cli](https://docs.near.org/tools/near-cli), a CLI tool of similar functionality without the guided prompts. - -::: - -## Install - -Download the pre-compiled version of `near-cli-rs` for your OS from [GitHub Releases Page](https://github.com/near/near-cli-rs/releases/) or install it with [Cargo](https://doc.rust-lang.org/cargo/) (Rust's package manager tool) with the following command: - -``` -$ cargo install near-cli-rs -``` - -## Getting Started - -To utilize the commands that involve transactions, sending tokens, deploying contracts, etc., you'll have to store a full access key to a given account on your machine. - -Run... - -``` -near -``` - -Using the arrow keys navigate to... - -``` -account -Manage accounts -``` - -Navigate to... - -``` -import-account -Import existing account (a.k.a. "sign-in") -``` - -choose any of the preferred sign-in methods. For this example, we'll choose the... - -``` -using-web-wallet -Import existing account using NEAR Wallet (a.k.a. "sign in") -### Account -- Gives you information on a specified account, near balance, storage, list of access keys, etc. -``` - -For this tutorial select `testnet` - -``` -What is the name of the network? -mainnet ->testnet -shardnet -``` - -You'll get redirected to `wallet.testnet.near.org`. Once there, grant authorization. Then in your terminal, you'll be asked to enter your account ID. Give it the name of the account you just authorized access to and a full access key. - -If you're on Mac you'll have the option to use the [Mac Keychain](https://support.apple.com/guide/keychain-access/what-is-keychain-access-kyca1083/mac) option. - -Either storage option is fine. Using the legacy storage option will save a file in your root directory in a hidden folder called `./near-credentials`. This storage option is compatable with the `near-cli` tool (a cli tool without the guided prompts but similar functionality). - -**Good Job!** -Now you can use `near-cli-rs` to it's full capacity. - ---- - -## Usage - -To use the `near-cli-rs` simply run the following in your terminal. - -```bash -$ near -``` - -You should then see the following. Use the arrow keys and hit `enter` or simply type out one of the available options to select an option - -![](/docs/assets/near-cli-rs.png) - -### Accounts - -This option will allow you to manage, control, and retrieve information on your accounts. - -| Option | Description | -| ---------------------- | ------------------------------------------ | -| `view-account-summary` | View properties for an account | -| `import-account` | Import existing account (a.k.a. "sign in") | -| `create-account` | Create a new account | -| `delete-account` | Delete an Account | -| `list-keys` | View a list of keys for an account | -| `add-key` | Add an access key to an account | -| `delete-key` | Delete an access key from an account | - -### Tokens - -This will allow you to manage your token assets such as NEAR, FTs and NFTs - -| Option | Description | -| ------------------- | --------------------------------------------------------------------- | -| `send-near` | Transfers NEAR to a specified recipient in units of NEAR or yoctoNEAR | -| `send-ft` | Transfer Fungible Tokens to a specified user | -| `send-nft` | Transfers NFTs between accounts | -| `view-near-balance` | View the balance of NEAR tokens | -| `view-ft-balance` | View the balance of Fungible Tokens | -| `view-nft-assets` | View the balance of NFT Tokens | - -### Contract - -This option allows you to manage and interact with your smart contracts - -| Option | Description | -| --------------- | ----------------------- | -| `call-function` | Execute Function | -| `deploy` | Add a new contract code | -| `download-wasm` | Download Wasm | - -### Transaction - -Operate Transactions - -| Option | Description | -| ---------------------- | --------------------------- | -| `view-status` | View a transaction status | -| `construct-tansaction` | Construct a new transaction | - -### Config - -Manage the connection parameters inside the `config.toml` file for `near-cli-rs` - -This will allow you to change or modify the network connections for your CLI. - -| Option | Description | -| ------------------- | ---------------------------------- | -| `show-connections` | Show a list of network connections | -| `add-connection` | Add a network connection | -| `delete-connection` | Delete a network Connection | - ---- diff --git a/docs/4.tools/cli.md b/docs/4.tools/cli.md index 53f1cc2cd98..36a7ceebc97 100644 --- a/docs/4.tools/cli.md +++ b/docs/4.tools/cli.md @@ -2,928 +2,625 @@ id: near-cli title: NEAR CLI --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; -The NEAR [Command Line Interface](https://github.com/near/near-cli) (CLI) is a tool that enables to interact with the NEAR network directly from the shell. Among other things, the NEAR CLI enables you to: +The NEAR [Command Line Interface](https://github.com/near/near-cli-rs) (CLI) is a tool that enables to interact with the NEAR network directly from the shell. Among other things, the NEAR CLI enables you to: - Login with a NEAR account - Deploy a contract - Interact and query information from a deployed contract -:::tip -Under the hood, NEAR CLI utilizes the [`NEAR JavaScript API`](https://github.com/near/near-api-js) -::: --- -:::info +## Installation -The NEAR CLI also comes with an implementation in Rust called [`near-cli-rs`](https://github.com/near/near-cli-rs). -If you want to use `near-cli` while you have `near-cli-rs` installed, prefix the following commands with `npx`. + -::: + -## Overview - -_Click on a command for more information and examples._ - -| Command | Description | -|-------------------------------------------------|-------------------------------------------------------------------------------------------| -| **ACCESS KEYS** | | -| [`near add-credentials`](#near-add-credentials) | Stores credentials for an account locally | -| [`near add-key`](#near-add-key) | adds a new access key to an account | -| [`near delete-key`](#near-delete-key) | deletes an access key from an account | -| [`near generate-key`](#near-generate-key) | generates a key pair and **optionally** stores it locally as credentials for an accountId | -| [`near list-keys`](#near-keys) | displays all access keys and their details for a given account | -| [`near login`](#near-login) | stores a full access key locally using [NEAR Wallet](https://wallet.testnet.near.org/) | -| **ACCOUNTS** | | -| [`near create-account`](#near-create-account) | creates a new account, either using a faucet to fund it, or an account saved locally | -| [`near delete-account`](#near-delete) | deletes an account and transfers remaining balance to a beneficiary account | -| [`near list-keys`](#near-keys) | displays all access keys for a given account | -| [`near send-near`](#near-send) | sends tokens from one account to another | -| [`near state`](#near-state) | shows general details of an account | -| **CONTRACTS** | | -| [`near call`](#near-call) | makes a contract call which can invoke `change` _or_ `view` methods | -| [`near deploy`](#near-deploy) | deploys a smart contract to the NEAR blockchain | -| [`near storage`](#near-storage) | Shows the storage state of a given contract, i.e. the data stored in a contract | -| [`near view`](#near-view) | makes a contract call which can **only** invoke a `view` method | -| **TRANSACTIONS** | | -| [`near tx-status`](#near-tx-status) | queries a transaction's status by `txHash` | + ```bash + npm install -g near-cli-rs@latest + ``` + + ---- + ``` + $ cargo install near-cli-rs + ``` -## Setup + + -### Installation + ```bash + curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh + ``` -> Make sure you have a current version of `npm` and `NodeJS` installed. + + -#### Mac and Linux + ```bash + irm https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.ps1 | iex + ``` -1. Install `npm` and `node` using a package manager like `nvm` as sometimes there are issues using Ledger due to how OS X handles node packages related to USB devices. [[click here]](https://nodejs.org/en/download/package-manager/) -2. Ensure you have installed Node version 12 or above. -3. Install `near-cli` globally by running: + + -```bash -npm install -g near-cli -``` - -For example, on Ubuntu 20.04 `near-cli` can be installed by running: -```bash -# Install nvm (https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating) -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -source ~/.bashrc - -# Install node -nvm install node +--- -# Install near-cli -npm install -g near-cli +## Configuration file +The directory with access keys and available connection networks are defined in the configuration file (`near-cli/config.toml`), which is located depending on the operating system in the following places: -# near-cli works! -near --help -``` +- macOS: `$HOME/Library/Application Support` (e.g. `/Users/Alice/Library/Application Support`) +- Linux: `$XDG_CONFIG_HOME` or `$HOME/.config` (e.g. `/home/alice/.config`) +- Windows: `{FOLDERID*RoamingAppData}` (e.g. `C:\Users\Alice\AppData\Roaming`) -#### Windows +You can learn more about working with the configuration file [here](https://github.com/near/near-cli-rs/blob/main/docs/GUIDE.en.md#config---manage-connections-in-a-configuration-file). -> For Windows users, we recommend using Windows Subsystem for Linux (`WSL`). -1. Install `WSL` [[click here]](https://docs.microsoft.com/en-us/windows/wsl/install-manual#downloading-distros) -2. Install `npm` [[click here]](https://www.npmjs.com/get-npm) -3. Install ` Node.js` [ [ click here ]](https://nodejs.org/en/download/package-manager/) -4. Change `npm` default directory [ [ click here ] ](https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory) - - This is to avoid any permission issues with `WSL` -5. Open `WSL` and install `near-cli` globally by running: +:::tip Custom RPC +You can setup a custom [RPC server](../api/rpc/providers) by changing the `rpc_url` parameter in `near-cli` settings: ```bash -npm install -g near-cli +near config edit-connection testnet --key rpc_url --value https://archival-rpc.testnet.near.org/ ``` +::: ---- -### Network selection +--- -> The default network for `near-cli` is `testnet`. +## Interactive mode -- You can change the network by prepending an environment variable to your command. +To use the `near-cli` simply run the following in your terminal. ```bash -NEAR_NETWORK=testnet near send ... +$ near ``` -- Alternatively, you can set up a global environment variable by running: +You should then see the following. Use the arrow keys and hit `enter` or simply type out one of the available options to select an option -```bash -export NEAR_NETWORK=mainnet -``` - -- All commands that interact with the network also allow to pass the `--networkId` option. +![](/docs/assets/near-cli-rs.png) -```bash -near send-near ... --networkId mainnet -``` +:::important +We provide examples only of the most used commands. Such commands may have two versions - a **full** one and a **short** one. If you want to explore all options provided by `near-cli` use the interactive mode described above. +::: --- -### Custom RPC server selection -You can set custom RPC server URL by setting these env variables: +## Account + +This option will allow you to manage, control, and retrieve information on your accounts. + +### Summary + +`view-account-summary` - view properties for an account. + + + + ```bash -NEAR_MAINNET_RPC -NEAR_TESTNET_RPC +export ACCOUNT_ID=bob.testnet +near account view-account-summary $ACCOUNT_ID network-config testnet now ``` -Clear them in case you want to get back to the default RPC server. + -Example: + ```bash -export NEAR_TESTNET_RPC= +export ACCOUNT_ID=bob.testnet +near state $ACCOUNT_ID --networkId testnet ``` ---- -## Access Keys + -All keys are stored locally at the root of your `HOME` directory: - - `~/.near-credentials` _(MAC / Linux)_ - - `C:\Users\YOUR_ACCOUNT\.near-credentials` _(Windows)_ + -Inside `.near-credentials`, access keys are organized in network subdirectories: `testnet`, and `mainnet`. +
-These network subdirectories contain `.JSON` objects with an: - - `account_id` - - `private_key` - - `public_key` +### Import -### `near add-credentials ` -> Stores credentials (full-access-key) locally for an already existing account. +`import-account` - import existing account (a.k.a. "sign in"). -- arguments: `accountId` -- options: `--seedPhrase` or `--secretKey` + -**Examples:** + ```bash -near add-credentials example-acct.testnet --seedPhrase "antique attitude say evolve ring arrive hollow auto wide bronze usual unfold" +near account import-account using-web-wallet network-config testnet ``` ---- + -### `near add-key` + -> Adds either a **full access** or **function access** key to a given account. +```bash +near login --networkId testnet +``` -> Optionally allows to sign with a Ledger: `--signWithLedger` `--ledgerPath` + -**Note:** You will use an _existing_ full access key for the account you would like to add a _new_ key to. ([`near login`](http://docs.near.org/docs/tools/near-cli#near-login)) + -#### 1) add a `full access` key +
-- arguments: `accountId` `publicKey` +### Export -**Example:** +`export-account` - export existing account. -```bash -near add-key example-acct.testnet Cxg2wgFYrdLTEkMu6j5D6aEZqTb3kXbmJygS48ZKbo1S -``` + -
-Example Response -

+ +```bash +export ACCOUNT_ID=bob.testnet +near account export-account $ACCOUNT_ID using-web-wallet network-config testnet ``` - Adding full access key = Cxg2wgFYrdLTEkMu6j5D6aEZqTb3kXbmJygS48ZKbo1S to example-acct.testnet. - Transaction Id EwU1ooEvkR42HvGoJHu5ou3xLYT3JcgQwFV3fAwevGJg - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/EwU1ooEvkR42HvGoJHu5ou3xLYT3JcgQwFV3fAwevGJg -``` -

-
+ + +
-#### 2) add a `function call` key +
-- arguments: `accountId` `publicKey` `--contract-id` -- options: `--method-names` `--allowance` +### Create -> `accountId` is the account you are adding the key to -> -> `--contract-id` is the contract you are allowing methods to be called on -> -> `--method-names` are optional and if omitted, all methods of the `--contract-id` can be called. -> -> `--allowance` is the amount of Ⓝ the key is allowed to spend on gas fees _only_ (default: 0). +`create-account` - create a new account. -**Note:** Each transaction made with this key will have gas fees deducted from the initial allowance and once it runs out a new key must be issued. + -**Example:** + ```bash -near add-key example-acct.testnet GkMNfc92fwM1AmwH1MTjF4b7UZuceamsq96XPkHsQ9vi --contract-id example-contract.testnet --method-names example_method --allowance 30000000000 +export ACCOUNT_ID=bob.testnet +near account create-account sponsor-by-faucet-service $ACCOUNT_ID autogenerate-new-keypair save-to-keychain network-config testnet create ``` -
-Example Response -

+ -``` - Adding function call access key = GkMNfc92fwM1AmwH1MTjF4b7UZuceamsq96XPkHsQ9vi to example-acct.testnet. - Transaction Id H2BQL9fXVmdTbwkXcMFfZ7qhZqC8fFhsA8KDHFdT9q2r - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/H2BQL9fXVmdTbwkXcMFfZ7qhZqC8fFhsA8KDHFdT9q2r + + +```bash +export ACCOUNT_ID=bob.testnet +near create-account $ACCOUNT_ID --useFaucet --networkId testnet ``` -

-
+
---- +
-### `near delete-key` +
-> Deletes an existing key for a given account. -> Optionally allows to sign with a Ledger: `--signWithLedger` `--ledgerPath` +### Delete -- arguments: `accountId` `publicKey` -- options: `--networkId`, `force` +`delete-account` - delete an account. -**Note:** You will need separate full access key for the account you would like to delete a key from. ([`near login`](http://docs.near.org/docs/tools/near-cli#near-login)) + -**Example:** + ```bash -near delete-key example-acct.testnet Cxg2wgFYrdLTEkMu6j5D6aEZqTb3kXbmJygS48ZKbo1S -``` +export ACCOUNT_ID=bob.testnet +export BENEFICIARY_ID=alice.testnet -
-Example Response -

- -``` - Transaction Id 4PwW7vjzTCno7W433nu4ieA6FvsAjp7zNFwicNLKjQFT - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/4PwW7vjzTCno7W433nu4ieA6FvsAjp7zNFwicNLKjQFT +near account delete-account $ACCOUNT_ID beneficiary $BENEFICIARY_ID network-config testnet sign-with-keychain send ``` -

-
+
---- -### `near generate-key` - -> Displays a key-pair and seed-phrase and optionally stores it locally in `.near-credentials`. + -- arguments: `accountId` or `none` -- options: `--fromSeedPhrase`, `--saveImplicit`, `--queryLedgerPK` - -**Note:** There are several ways to use `generate-key` that return very different results. Please reference the examples below for further details. +```bash +export ACCOUNT_ID=bob.testnet +export BENEFICIARY_ID=alice.testnet ---- +near delete-account $ACCOUNT_ID $BENEFICIARY_ID --networkId testnet +``` -#### 1a) `near generate-key` + -> Creates and displays a key pair +
-```bash -near generate-key -``` +--- -
-Example Response -

+## Keys -```bash -Seed phrase: antique attitude say evolve ring arrive hollow auto wide bronze usual unfold -Key pair: {"publicKey":"ed25519:BW5Q957u1rTATGpanKUktjVmixEmT56Df4Dt9hoGWEXz","secretKey":"ed25519:5StmPDg9xVNzpyudwxT8Y72iyRq7Fa86hcpsRk6Cq5eWGWqwsPbPT9woXbJs9Qe69crZJHh4DMkrGEPGDDfmXmy2"} -Implicit account: 9c07afc7673ea0f9a20c8a279e8bbe1dd1e283254263bb3b07403e4b6fd7a411 -``` +Showing, adding and removing account keys. -

-
+### List keys ---- +`list-keys` - view a list of keys for an account. -#### 1b) `near generate-key --saveImplicit` + -> Creates and displays a key pair, saving it locally in `.near-credentials` as an implicit account. + ```bash -near generate-key --saveImplicit +export ACCOUNT_ID=bob.testnet +near account list-keys $ACCOUNT_ID network-config testnet now ``` -
-Example Response -

+ -```bash -Seed phrase: antique attitude say evolve ring arrive hollow auto wide bronze usual unfold -Key pair: {"publicKey":"ed25519:BW5Q957u1rTATGpanKUktjVmixEmT56Df4Dt9hoGWEXz","secretKey":"ed25519:5StmPDg9xVNzpyudwxT8Y72iyRq7Fa86hcpsRk6Cq5eWGWqwsPbPT9woXbJs9Qe69crZJHh4DMkrGEPGDDfmXmy2"} -Implicit account: 9c07afc7673ea0f9a20c8a279e8bbe1dd1e283254263bb3b07403e4b6fd7a411 + -Storing credentials for account: 9d6e4506ac06ab66a25f6720e400ae26bad40ecbe07d49935e83c7bdba5034fa (network: testnet) -Saving key to '~/.near-credentials/testnet/9d6e4506ac06ab66a25f6720e400ae26bad40ecbe07d49935e83c7bdba5034fa.json' +```bash +export ACCOUNT_ID=bob.testnet +near list-keys $ACCOUNT_ID --networkId testnet ``` -

-
+
---- +
-#### 2) `near generate-key accountId` +
-> Creates a key pair locally in `.near-credentials` with an `accountId` that you specify. +### Add key -**Note:** This does NOT create an account with this name. +`add-key` - add an access key to an account. -```bash -near generate-key example.testnet -``` + -
-Example Response -

+ ```bash -Seed phrase: antique attitude say evolve ring arrive hollow auto wide bronze usual unfold -Key pair: {"publicKey":"ed25519:BW5Q957u1rTATGpanKUktjVmixEmT56Df4Dt9hoGWEXz","secretKey":"ed25519:5StmPDg9xVNzpyudwxT8Y72iyRq7Fa86hcpsRk6Cq5eWGWqwsPbPT9woXbJs9Qe69crZJHh4DMkrGEPGDDfmXmy2"} -Implicit account: 9c07afc7673ea0f9a20c8a279e8bbe1dd1e283254263bb3b07403e4b6fd7a411 - -Storing credentials for account: example.testnet (network: testnet) -Saving key to '~/.near-credentials/testnet/example.testnet.json' +export ACCOUNT_ID=bob.testnet +near account add-key $ACCOUNT_ID grant-full-access use-manually-provided-public-key ed25519:CXqAs8c8kZz81josLw82RQsnZXk8CAdUo7jAuN7uSht2 network-config testnet sign-with-keychain send ``` -

-
- ---- - -#### 3a) `near generate-key --fromSeedPhrase="your seed phrase"` + -> Uses a seed phrase to display a public key and [implicit account](../1.concepts/protocol/account-id.md#implicit-accounts-implicit-accounts) + ```bash -near generate-key --seedPhrase="antique attitude say evolve ring arrive hollow auto wide bronze usual unfold" +export ACCOUNT_ID=bob.testnet +near add-key $ACCOUNT_ID ed25519:CXqAs8c8kZz81josLw82RQsnZXk8CAdUo7jAuN7uSht2 --networkId testnet ``` -
-Example Response + -``` -Seed phrase: antique attitude say evolve ring arrive hollow auto wide bronze usual unfold -Key pair: {"publicKey":"ed25519:BW5Q957u1rTATGpanKUktjVmixEmT56Df4Dt9hoGWEXz","secretKey":"ed25519:5StmPDg9xVNzpyudwxT8Y72iyRq7Fa86hcpsRk6Cq5eWGWqwsPbPT9woXbJs9Qe69crZJHh4DMkrGEPGDDfmXmy2"} -Implicit account: 9c07afc7673ea0f9a20c8a279e8bbe1dd1e283254263bb3b07403e4b6fd7a411 -``` + -
+
---- +### Delete key -#### 3b) `near generate-key accountId --seedPhrase="your seed phrase"` +`delete-keys` - delete an access key from an account. -Will store the key pair corresponding to the seedPhrase in `.near-credentials` with an `accountId` that you specify. + -
-Example Response -

+ +```bash +export ACCOUNT_ID=bob.testnet +near account delete-keys $ACCOUNT_ID public-keys ed25519:HdkFZFEPoWfgrrLK3R4t5dWtNoLC8WymBzhCXoP3zrjh network-config testnet sign-with-keychain send ``` -Seed phrase: antique attitude say evolve ring arrive hollow auto wide bronze usual unfold -Key pair: {"publicKey":"ed25519:BW5Q957u1rTATGpanKUktjVmixEmT56Df4Dt9hoGWEXz","secretKey":"ed25519:5StmPDg9xVNzpyudwxT8Y72iyRq7Fa86hcpsRk6Cq5eWGWqwsPbPT9woXbJs9Qe69crZJHh4DMkrGEPGDDfmXmy2"} -Implicit account: 9c07afc7673ea0f9a20c8a279e8bbe1dd1e283254263bb3b07403e4b6fd7a411 -``` - -

-
- ---- -#### 4a) `near generate-key --queryLedgerPK` +
-> Uses a connected Ledger device to display a public key and [implicit account](http://docs.near.org/integrations/implicit-accounts) using the default HD path (`"44'/397'/0'/0'/1'"`) + ```bash -near generate-key --queryLedgerPK +export ACCOUNT_ID=bob.testnet +near delete-key $ACCOUNT_ID ed25519:HdkFZFEPoWfgrrLK3R4t5dWtNoLC8WymBzhCXoP3zrjh --networkId testnet ``` -You should then see the following prompt to confirm this request on your Ledger device: + -``` - Make sure to connect your Ledger and open NEAR app - Getting Public Key from Ledger... -``` +
-After confirming the request on your Ledger device, a public key and implicit accountId will be displayed. +--- -
-Example Response -

+## Tokens -```bash -Using public key: ed25519:B22RP10g695wyeRvKIWv61NjmQZEkWTMzAYgdfx6oSeB2 -Implicit account: 42c320xc20739fd9a6bqf2f89z61rd14efe5d3de234199bc771235a4bb8b0e1 -``` +This will allow you to manage your token assets such as NEAR, FTs and NFTs. -

-
+### Send NEAR ---- +`send-near` - transfers NEAR to a specified recipient in units of NEAR or yoctoNEAR. -#### 3b) `near generate-key --queryLedgerPK --ledgerPath="HD path you specify"` + -> Uses a connected Ledger device to display a public key and [implicit account](http://docs.near.org/integrations/implicit-accounts) using a custom HD path. + ```bash -near generate-key --queryLedgerPK --ledgerPath="44'/397'/0'/0'/2'" -``` - -You should then see the following prompt to confirm this request on your Ledger device: - -``` - Make sure to connect your Ledger and open NEAR app - Waiting for confirmation on Ledger... +export ACCOUNT_ID=bob.testnet +export RECEIVER_ID=alice.testnet +near tokens $ACCOUNT_ID send-near $RECEIVER_ID '0.5 NEAR' network-config testnet sign-with-keychain send ``` -After confirming the request on your Ledger device, a public key and implicit accountId will be displayed. + -
-Example Response -

+ ```bash -Using public key: ed25519:B22RP10g695wye3dfa32rDjmQZEkWTMzAYgCX6oSeB2 -Implicit account: 42c320xc20739ASD9a6bqf2Dsaf289z61rd14efe5d3de23213789009afDsd5bb8b0e1 +export ACCOUNT_ID=bob.testnet +export RECEIVER_ID=alice.testnet + +near send-near $ACCOUNT_ID $RECEIVER_ID 0.5 --networkId testnet ``` -

-
+ +
---- +
-### `near list-keys` +### Send FT -> Displays all access keys for a given account. +`send-ft` - transfer Fungible Tokens to a specified user. -- arguments: `accountId` + -**Example:** + ```bash -near list-keys client.chainlink.testnet -``` - -
- Example Response -

+export ACCOUNT_ID=bob.testnet +export RECEIVER_ID=alice.testnet +export FT_CONTRACT_ID=0c97251cd1f630c444dbusdt.testnet -``` -Keys for account client.chainlink.testnet -[ - { - public_key: 'ed25519:4wrVrZbHrurMYgkcyusfvSJGLburmaw7m3gmCApxgvY4', - access_key: { nonce: 97, permission: 'FullAccess' } - }, - { - public_key: 'ed25519:H9k5eiU4xXS3M4z8HzKJSLaZdqGdGwBG49o7orNC4eZW', - access_key: { - nonce: 88, - permission: { - FunctionCall: { - allowance: '18483247987345065500000000', - receiver_id: 'client.chainlink.testnet', - method_names: [ 'get_token_price', [length]: 1 ] - } - } - } - }, - [length]: 2 -] +near tokens $ACCOUNT_ID send-ft $FT_CONTRACT_ID $RECEIVER_ID amount-ft '1 USDT' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' network-config testnet sign-with-keychain send ``` -

-
+
---- +
-### `near login` +
-> locally stores a full access key of an account you created with [MyNEARWallet](https://testnet.mynearwallet.com/). +### Send NFT -- arguments: `none` -- options: `--networkId` +`send-nft` - transfers NFTs between accounts. -**Example:** + -```bash -near login -``` - -**Custom wallet url:** - -The default wallet URL is `https://testnet.mynearwallet.com/`. However, if you want to change to a different wallet URL, you can set the environmental variable `NEAR_MAINNET_WALLET` or `NEAR_TESTNET_WALLET`. + ```bash -export NEAR_TESTNET_WALLET=https://wallet.testnet.near.org/ -near login +export ACCOUNT_ID=bob.testnet +export RECEIVER_ID=alice.testnet +export NFT_CONTRACT_ID=nft.examples.testnet + +near tokens $ACCOUNT_ID send-nft $NFT_CONTRACT_ID $RECEIVER_ID 1 --prepaid-gas '100.0 Tgas' --attached-deposit '1 yoctoNEAR' network-config testnet sign-with-keychain send ``` ---- + -## Accounts + -### `near create-account` +
-> Creates an account using an existing account or a faucet service to pay for the account's creation and initial balance. +### View NEAR balance -- arguments: `accountId` -- options: `--initialBalance`, `--useFaucet`, `--useAccount`, `--seedPhrase`, `--publicKey`, `--signWithLedger`, `--ledgerPath`, `--useLedgerPK`, `--PkLedgerPath` +`view-near-balance` - view the balance of NEAR tokens. -**Examples:**: + -```bash -# Creating account using `example-acct.testnet` to fund it -near create-account new-acc.testnet --useAccount example-acct.testnet -``` + ```bash -# Creating account using the faucet to fund it -near create-account new-acc.testnet --useFaucet +export ACCOUNT_ID=bob.testnet +near tokens $ACCOUNT_ID view-near-balance network-config testnet now ``` -```bash -# Creating a pre-funded account that can be controlled by the Ledger's public key -near create-account new-acc.testnet --useFaucet --useLedgerPK -``` + -```bash -# Creating an account using a Ledger account -near create-account new-acc.testnet --useAccount ledger-acct.testnet --signWithLedger -``` + -**Subaccount example:** +
-```bash -# Using an account to create a sub-account -near create-account sub-acct.example-acct.testnet --useAccount example-acct.testnet -``` +### View FT balance -```bash -# Creating a sub-account using the Ledger that can also be controlled by the ledger -near create-account sub.acc.testnet --useAccount sub.acc.testnet --signWithLedger --useLedgerPK -``` +`view-ft-balance` - view the balance of Fungible Tokens. + + -**Example using `--initialBalance`:** + ```bash -near create-account sub-acct2.example-acct.testnet --useAccount example-acct.testnet --initialBalance 10 +export ACCOUNT_ID=bob.testnet +export FT_CONTRACT_ID=0c97251cd1f630c444dbusdt.testnet +near tokens $ACCOUNT_ID view-ft-balance $FT_CONTRACT_ID network-config testnet now ``` -
-Example Response -

+ -``` - Saving key to '/HOME_DIR/.near-credentials/default/sub-acct2.example-acct.testnet.json' - Account sub-acct2.example-acct.testnet for network "default" was created. -``` + -

-
+
---- - -### `near delete-account` +### View NFT balance -> Deletes an account and transfers remaining balance to a beneficiary account. +`view-nft-assets` - view the balance of NFT tokens. -- arguments: `accountId` `beneficiaryId` -- options: `force`, `--signWithLedger`, `--ledgerPath` + -**Example:** + ```bash -near delete-account sub-acct2.example-acct.testnet example-acct.testnet +export ACCOUNT_ID=bob.testnet +export NFT_CONTRACT_ID=nft.examples.testnet +near tokens $ACCOUNT_ID view-nft-assets $NFT_CONTRACT_ID network-config testnet now ``` -
-Example Response -

- -``` - Deleting account. Account id: sub-acct2.example-acct.testnet, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, beneficiary: example-acct.testnet - Transaction Id 4x8xohER1E3yxeYdXPfG8GvXin1ShiaroqE5GdCd5YxX - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/4x8xohER1E3yxeYdXPfG8GvXin1ShiaroqE5GdCd5YxX - Account sub-acct2.example-acct.testnet for network "default" was deleted. -``` + -

-
+
--- +## Contract -### `near send-near` +This option allows you to manage and interact with your smart contracts. -> Sends NEAR tokens (Ⓝ) from one account to another. +### Call -- arguments: `senderId` `receiverId` `amount` -- options: `--signWithLedger`, `--ledgerPath` +`call-function` - execute function (contract method). -**Note:** You will need a full access key for the sending account. ([`near login`](http://docs.near.org/docs/tools/near-cli#near-login)) + -**Example:** + ```bash -near send-near sender.testnet receiver.testnet 10 +# View method +export CONTRACT_ID=nft.examples.testnet +near contract call-function as-read-only $CONTRACT_ID nft_tokens json-args '{"from_index": "0", "limit": 2}' network-config testnet now + +# Call method +export ACCOUNT_ID=bob.testnet +near contract call-function as-transaction $CONTRACT_ID nft_mint json-args '{"metadata": {"copies": 1, "description": "The Team Goes", "media": "https://bafybeidl4hjbpdr6u6xvlrizwxbrfcyqurzvcnn5xoilmcqbxfbdwrmp5m.ipfs.dweb.link/", "title": "GO TEAM"}, "receiver_id": "bob.testnet", "token_id": "5895"}' prepaid-gas '100.0 Tgas' attached-deposit '0.1 NEAR' sign-as $ACCOUNT_ID network-config testnet sign-with-keychain send ``` -
-Example Response -

+ -``` - Sending 10 NEAR to receiver.testnet from sender.testnet - Transaction Id BYTr6WNyaEy2ykAiQB9P5VvTyrJcFk6Yw95HPhXC6KfN - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/BYTr6WNyaEy2ykAiQB9P5VvTyrJcFk6Yw95HPhXC6KfN + + +```bash +# View method +export CONTRACT_ID=nft.examples.testnet +near view $CONTRACT_ID nft_tokens '{"from_index": "0", "limit": 2}' --networkId testnet + +# Call method +export ACCOUNT_ID=bob.testnet +near call $CONTRACT_ID nft_mint '{"metadata": {"copies": 1, "description": "The Team Goes", "media": "https://bafybeidl4hjbpdr6u6xvlrizwxbrfcyqurzvcnn5xoilmcqbxfbdwrmp5m.ipfs.dweb.link/", "title": "GO TEAM"}, "receiver_id": "bob.testnet", "token_id": "5896"}' --deposit 0.1 --useAccount $ACCOUNT_ID --networkId testnet ``` -

-
+
---- +
-### `near state` +
-> Shows details of an account's state. +### Deploy -- arguments: `accountId` +`deploy` - add a new contract code. -**Example:** + + + ```bash -near state example.testnet +export CONTRACT_ID=contract.testnet +near contract deploy $CONTRACT_ID use-file ../target/near/contract.wasm without-init-call network-config testnet sign-with-keychain send ``` -
-Example Response -

+ -```json -{ - "amount": "99999999303364037168535000", - "locked": "0", - "code_hash": "G1PCjeQbvbUsJ8piXNb7Yg6dn3mfivDQN7QkvsVuMt4e", - "storage_usage": 53528, - "storage_paid_at": 0, - "block_height": 21577354, - "block_hash": "AWu1mrT3eMJLjqyhNHvMKrrbahN6DqcNxXanB5UH1RjB", - "formattedAmount": "99.999999303364037168535" -} -``` + -

-
+```bash +export CONTRACT_ID=contract.testnet +near deploy $CONTRACT_ID ../target/near/contract.wasm --networkId testnet +``` ---- +
-## Contracts +
-### `near call` +
-> makes a contract call which can modify _or_ view state. +### Inspect -**Note:** Contract calls require a transaction fee (gas) so you will need an access key for the `--accountId` that will be charged. ([`near login`](http://docs.near.org/docs/tools/near-cli#near-login)) +`inspect` - get a list of available function names. -- arguments: `contractName` `method_name` `{ args }` `--accountId` -- options: `--gas` `--deposit` `--signWithLedger` `--ledgerPath` + -**Example:** + ```bash -near call guest-book.testnet addMessage '{"text": "Aloha"}' --account-id example-acct.testnet +export CONTRACT_ID=nft.examples.testnet +near contract view-storage $CONTRACT_ID all as-text network-config testnet now ``` -
-Example Response -

+ + + ```bash - Scheduling a call: guest-book.testnet.addMessage({"text": "Aloha"}) - Transaction Id FY8hBam2iyQfdHkdR1dp6w5XEPJzJSosX1wUeVPyUvVK - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/FY8hBam2iyQfdHkdR1dp6w5XEPJzJSosX1wUeVPyUvVK - '' +export CONTRACT_ID=nft.examples.testnet +near storage $CONTRACT_ID --finality final --utf8 --networkId testnet ``` -

-
+
+ +
--- -### `near deploy` +## Transaction + +Operate transactions. -> Deploys a smart contract to a given accountId. +### View status -- arguments: `accountId` `.wasmFile` -- options: `initFunction` `initArgs` `initGas` `initDeposit` +`view-status` - view a transaction status. -**Note:** You will need a full access key for the account you are deploying the contract to. ([`near login`](http://docs.near.org/docs/tools/near-cli#near-login)) + -**Example:** + ```bash -near deploy example-contract.testnet out/example.wasm +near transaction view-status BFrVVtjqD2p1zYX1UCvn4nJpy7zPHpY5cTgQaKCZjBvw network-config testnet ``` -**Initialize Example:** + + + ```bash -near deploy example-contract.testnet out/example.wasm --initFunction new --initArgs '{"owner_id": "example-contract.testnet", "total_supply": "10000000"}' +near tx-status BFrVVtjqD2p1zYX1UCvn4nJpy7zPHpY5cTgQaKCZjBvw --networkId testnet ``` -
-Example Response -

+ -``` - Starting deployment. Account id: example-contract.testnet, node: https://rpc.testnet.near.org, helper: https://helper.testnet.near.org, file: main.wasm - Transaction Id G8GhhPuujMHTRnwursPXE1Lv5iUZ8WUecwiST1PcKWMt - To see the transaction in the transaction explorer, please open this url in your browser - https://testnet.nearblocks.io/txns/G8GhhPuujMHTRnwursPXE1Lv5iUZ8WUecwiST1PcKWMt - Done deploying to example-contract.testnet -``` - -

-
+
--- -### `near storage` +## Config -> Shows the storage state of a given contract, i.e. the data stored in a contract. +Manage the connection parameters inside the `config.toml` file for `near-cli`. -- arguments: `contractName` -- options: `--finality`, `--utf8`, `--blockId`, `--prefix` +This will allow you to change or modify the network connections for your CLI. -**Example:** +### Show connections -```bash -near storage hello.near-examples.testnet --finality optimistic --utf8 -``` +`show-connections` - show a list of network connections. + + -
-Example Response + ```bash -[ { key: 'STATE', value: '\x10\x00\x00\x00Passei por aqui!' } ] +near config show-connections ``` -
+
+
---- - -### `near view` +
-> Makes a contract call which can **only** view state. _(Call is free of charge)_ +### Edit connection -- arguments: `contractName` `method_name` `{ args }` -- options: `default` +`edit-connection` - edit a network connection. -**Example:** - -```bash -near view guest-book.testnet getMessages '{}' -``` + -
-Example Response -

+ ```bash - View call: guest-book.testnet.getMessages({}) - [ - { premium: false, sender: 'waverlymaven.testnet', text: 'TGIF' }, - { - premium: true, - sender: 'waverlymaven.testnet', - text: 'Hello from New York 🌈' - }, - { premium: false, sender: 'fhr.testnet', text: 'Hi' }, - { premium: true, sender: 'eugenethedream', text: 'test' }, - { premium: false, sender: 'dongri.testnet', text: 'test' }, - { premium: false, sender: 'dongri.testnet', text: 'hello' }, - { premium: true, sender: 'dongri.testnet', text: 'hey' }, - { premium: false, sender: 'hirokihori.testnet', text: 'hello' }, - { premium: true, sender: 'eugenethedream', text: 'hello' }, - { premium: false, sender: 'example-acct.testnet', text: 'Aloha' }, - [length]: 10 - ] +near config edit-connection testnet --key rpc_url --value https://test.rpc.fastnear.com ``` -

-
- ---- + -## Transactions - -### `near tx-status` - -> Queries transaction status by hash and accountId. - -- arguments: `txHash` `--accountId` -- options: `default` - -**Example:** - -```bash -near tx-status FY8hBam2iyQfdHkdR1dp6w5XEPJzJSosX1wUeVPyUvVK --accountId guest-book.testnet -``` - -
-Example Response -

- -```json -Transaction guest-book.testnet:FY8hBam2iyQfdHkdR1dp6w5XEPJzJSosX1wUeVPyUvVK -{ - status: { SuccessValue: '' }, - transaction: { - signer_id: 'example-acct.testnet', - public_key: 'ed25519:AXZZKnp6ZcWXyRNdy8FztYrniKf1qt6YZw6mCCReXrDB', - nonce: 20, - receiver_id: 'guest-book.testnet', - actions: [ - { - FunctionCall: { - method_name: 'addMessage', - args: 'eyJ0ZXh0IjoiQWxvaGEifQ==', - gas: 300000000000000, - deposit: '0' - } - }, - [length]: 1 - ], - signature: 'ed25519:5S6nZXPU72nzgAsTQLmAFfdVSykdKHWhtPMb5U7duacfPdUjrj8ipJxuRiWkZ4yDodvDNt92wcHLJxGLsyNEsZNB', - hash: 'FY8hBam2iyQfdHkdR1dp6w5XEPJzJSosX1wUeVPyUvVK' - }, - transaction_outcome: { - proof: [ [length]: 0 ], - block_hash: '6nsjvzt6C52SSuJ8UvfaXTsdrUwcx8JtHfnUj8XjdKy1', - id: 'FY8hBam2iyQfdHkdR1dp6w5XEPJzJSosX1wUeVPyUvVK', - outcome: { - logs: [ [length]: 0 ], - receipt_ids: [ '7n6wjMgpoBTp22ScLHxeMLzcCvN8Vf5FUuC9PMmCX6yU', [length]: 1 ], - gas_burnt: 2427979134284, - tokens_burnt: '242797913428400000000', - executor_id: 'example-acct.testnet', - status: { - SuccessReceiptId: '7n6wjMgpoBTp22ScLHxeMLzcCvN8Vf5FUuC9PMmCX6yU' - } - } - }, - receipts_outcome: [ - { - proof: [ [length]: 0 ], - block_hash: 'At6QMrBuFQYgEPAh6fuRBmrTAe9hXTY1NzAB5VxTH1J2', - id: '7n6wjMgpoBTp22ScLHxeMLzcCvN8Vf5FUuC9PMmCX6yU', - outcome: { - logs: [ [length]: 0 ], - receipt_ids: [ 'FUttfoM2odAhKNQrJ8F4tiBpQJPYu66NzFbxRKii294e', [length]: 1 ], - gas_burnt: 3559403233496, - tokens_burnt: '355940323349600000000', - executor_id: 'guest-book.testnet', - status: { SuccessValue: '' } - } - }, - { - proof: [ [length]: 0 ], - block_hash: 'J7KjpMPzAqE7iX82FAQT3qERDs6UR1EAqBLPJXBzoLCk', - id: 'FUttfoM2odAhKNQrJ8F4tiBpQJPYu66NzFbxRKii294e', - outcome: { - logs: [ [length]: 0 ], - receipt_ids: [ [length]: 0 ], - gas_burnt: 0, - tokens_burnt: '0', - executor_id: 'example-acct.testnet', - status: { SuccessValue: '' } - } - }, - [length]: 2 - ] -} -``` - -

-
+
--- -## Global Options - -| Option | Description | -|-----------------------------|-------------------------------------------------------------------------------------------------| -| `--help` | Show help [boolean] | -| `--version` | Show version number [boolean] | -| `-v, --verbose` | Prints out verbose output [boolean] [default: false] | +:::important +We provide examples only of the most used commands. If you want to explore all options provided by `near-cli` use [the interactive mode](#interactive-mode). +::: \ No newline at end of file diff --git a/docs/4.tools/near-api-js/quick-reference.md b/docs/4.tools/near-api-js/quick-reference.md index 333df1e91f8..d8de49d4789 100644 --- a/docs/4.tools/near-api-js/quick-reference.md +++ b/docs/4.tools/near-api-js/quick-reference.md @@ -245,7 +245,7 @@ const provider = new FailoverRpcProvider(jsonProviders); await connect({ networkId: 'mainnet', provider: provider, - // this isn't used if `provider` is specified, but is still required for backward compativility + // this isn't used if `provider` is specified, but is still required for backward compatibility nodeUrl: 'https://rpc.mainnet.near.org', }); ``` diff --git a/docs/6.integrations/errors/error-implementation.md b/docs/6.integrations/errors/error-implementation.md index 7e511c6abe4..803bd37c68f 100644 --- a/docs/6.integrations/errors/error-implementation.md +++ b/docs/6.integrations/errors/error-implementation.md @@ -441,6 +441,13 @@ pub enum ReceiptValidationError { NumberInputDataDependenciesExceeded { number_of_input_data_dependencies: u64, limit: u64 }, /// An error occurred while validating actions of an ActionReceipt. ActionsValidation(ActionsValidationError), + /// Receipt is bigger than the limit. + /// ReceiptSizeExceeded means that there was a receipt above the size limit (currently 4MiB). + /// NEAR will refuse to execute receipts that are above the size limit. + /// The most likely source of such receipts would be cross-contract calls with a lot of large actions + /// (contract deployment, function call with large args, etc). + /// This error means that the user has to adjust their contract to generate smaller receipts. + ReceiptSizeExceeded { size: u64, limit: u64 }, } ``` @@ -466,6 +473,9 @@ ReceiptValidationError::NumberInputDataDependenciesExceeded { number_of_input_da "The number of input data dependencies {} exceeded the limit {} in an ActionReceipt" ReceiptValidationError::ActionsValidation(e) + +ReceiptValidationError::ReceiptSizeExceeded { size, limit } +"The size of the receipt exceeded the limit: {} > {}", ``` diff --git a/docs/pagoda/alerts/setup.md b/docs/pagoda/alerts/setup.md index 4219694557c..83ed926be7d 100644 --- a/docs/pagoda/alerts/setup.md +++ b/docs/pagoda/alerts/setup.md @@ -42,7 +42,7 @@ Follow the steps above to begin setting-up telegram alerts. When selecting the d ### Private Message Alerts -1. On the device that is logged into the telegram aclick "Open Telegram" or scan the QR code. +1. On the device that is logged into the telegram click "Open Telegram" or scan the QR code. diff --git a/docs/pagoda/alerts/webhooks.md b/docs/pagoda/alerts/webhooks.md index 7a7d9f47425..61c82ebc2dc 100644 --- a/docs/pagoda/alerts/webhooks.md +++ b/docs/pagoda/alerts/webhooks.md @@ -140,7 +140,7 @@ copy that entire line and head on over to console.pagoda.co ## Step 5: Integrating Webhook into Pagoda Console -Once at console.pagoda.co, you should be greeted by the log-in page. Select the Non-funcable Token (NFT) project to start exploring the NFT contract +Once at console.pagoda.co, you should be greeted by the log-in page. Select the Non-fungible Token (NFT) project to start exploring the NFT contract @@ -181,12 +181,12 @@ But for now, we'll keep it easy and select any Successful Action. We're almost done! Under destination select webhooks. Now that webhook we created earlier go ahead and copy and paste it into here. Then hit "Create" :::tip -Don't forget to remove the `{}` around the name of your event! `ifttt.com/trigger/...`, not `ifftt.com/{trigger}/...` +Don't forget to remove the `{}` around the name of your event! `ifttt.com/trigger/...`, not `ifttt.com/{trigger}/...` ::: -Remember to hit the "+ Create Alert" button on this page... +Remember to hit the "+ Create Alert" button on this page... @@ -210,6 +210,6 @@ Select the `new_default_metadata` function (we are choosing this one because we And that's it! You've just triggered something in the real world with an event that happened on the NEAR Blockchain. Hopefully this inspires you to create your own webhook using IFTTT and the Pagoda Console. -We'd love to see what you create! Tag [@PagodaPlatform](https://twitter.com/PagodaPlatform) on Twitter with a novel implementation of a webhhook and trigger and we might retweet it. +We'd love to see what you create! Tag [@PagodaPlatform](https://twitter.com/PagodaPlatform) on Twitter with a novel implementation of a webhook and trigger and we might retweet it. Happy hacking! diff --git a/docs/pagoda/rpc/intro.md b/docs/pagoda/rpc/intro.md index 1e252efddab..6fc91453125 100644 --- a/docs/pagoda/rpc/intro.md +++ b/docs/pagoda/rpc/intro.md @@ -19,7 +19,7 @@ The Pagoda RPC provides you with instant access to maintenance free, scalable NE Developers can interact with on-chain data and send different types of transactions to the network by utilizing the RPC endpoints. -In addition to the powerful node infrastructure, we also created the Pagoda RPC Stats page so that you can have visibility into your RPC usage and performances and take control of your project from the infrastructure level. What’s more? You can subscribe to the alerts from our Status page so that you can follow the health of Pagoda RPC real time. All accesible via [Pagoda Console](https://console.pagoda.co/). +In addition to the powerful node infrastructure, we also created the Pagoda RPC Stats page so that you can have visibility into your RPC usage and performances and take control of your project from the infrastructure level. What’s more? You can subscribe to the alerts from our Status page so that you can follow the health of Pagoda RPC real time. All accessible via [Pagoda Console](https://console.pagoda.co/). ## Setup diff --git a/docs/pagoda/rpc/setup.md b/docs/pagoda/rpc/setup.md index 493500a7b61..486a5577247 100644 --- a/docs/pagoda/rpc/setup.md +++ b/docs/pagoda/rpc/setup.md @@ -37,7 +37,7 @@ With a dedicated API key, developers are able to: - Access higher request throughput and increased concurrent requests - Query data from [Enhanced APIs](api.md), gaining access to free processed data for NFT, FT and NEAR balances, ownership, and metadata -- Utlize dedicated, individualized usage metrics +- Utilize dedicated, individualized usage metrics ### Test your API keys diff --git a/docs/pagoda/rpc/stats.md b/docs/pagoda/rpc/stats.md index 1f80b174c3a..e780bd9693a 100644 --- a/docs/pagoda/rpc/stats.md +++ b/docs/pagoda/rpc/stats.md @@ -28,7 +28,7 @@ Aggregated key metrics available at the top of the dashboard are ## Set a Time Period -Data is sent with UTC time to the browser and the browser adjusts to the user’s timezon. +Data is sent with UTC time to the browser and the browser adjusts to the user’s timezone. - Last 15 Minutes is the last complete 15 minutes. This updates every few seconds. - Last 1 Hour is the last fully completed hour; from 00 to 59 minutes and 59 seconds. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 1498da55386..1b0e6cd6c42 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -90,9 +90,9 @@ const config = { themeConfig: { image: 'docs/assets/welcome-pages/protocol.png', announcementBar: { - id: 'id-0005', + id: 'id-0006', content: - 'New blog post: An update on the near.org / RPC outage on July 11, 2024', + 'New blog post: Future of Pagoda Services', backgroundColor: '#fafbfc', textColor: '#333', isCloseable: true, diff --git a/website/sidebars.js b/website/sidebars.js index 8f0522a6c3a..48518615c8e 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -545,11 +545,7 @@ const sidebar = { ] }, "tools/sdk", - { - "type": "category", - "label": "Command Line Tools (CLI)", - "items": ["tools/near-cli", "tools/near-cli-rs"] - }, + "tools/near-cli", { "type": "category", "label": "BOS Web Editors",