_section: Getting Started @ @priority<100> This is a very short introduction to Ethers, but covers many of the most common operations that developers require and provides a starting point for those newer to Ethereum. _heading: Getting Ethers If using NPM, you must first install Ethers. _code: installing via NPM @lang # Install ethers /home/ricmoo/test-ethers> npm install ethers@beta-exports _null: Everything in Ethers is exported from its root as well as on the ``ethers`` object. There are also ``exports`` in the ``package.json`` to facilitate more fine-grained importing. Generally this documentation will presume all exports from ethers have been imported in the code examples, but you may import the necessary objects any way you wish. _code: importing in Node.js @lang _subsection: Some Common Terminology @ To begin, it is useful to have a basic understanding of the types of objects available and what they are responsible for, at a high level. _heading: Provider A [[Provider]] is a read-only connection to the blockchain, which allows querying the blockchain state, such as accout, block or transaction details, querying event logs or evaluating read-only code using call. If you are coming from Web3.js, you are used to a **Provider** offering both read and write access. In Ethers, all write operations are further abstracted into another Object, the **Signer**. _heading: Signer A [[Signer]] wraps all operations that interact with an account. An account generally has a private key located //somewhere//, which can be used to sign a variety of types of payloads. The private key may be located in memory (using a [[Wallet]]) or protected via some IPC layer, such as MetaMask which proxies interaction from a website to a browser plug-in, which keeps the private key out of the reach of the website and only permits interaction after requesting permission from the user and receiving authorization. _heading: Transaction To make any state changes to the blockchain, a transaction is required, which requires a fee be paid, where the fee covers the associated costs with executing the transaction (such as reading the disk and performing maths) and storing the updated information. If a transaction reverts, a fee must still be paid, since the validator still had to expend resources to try running the transaction to determine that it reverted and the details of its failure are still be recorded. Transactions include sending ether from one user to another, deploying a **Contract** or executing a state-changing operation against a **Contract**. _heading: Contract A [[Contract]] is a program that has been deployed to the blockchain, which includes some code and has allocated storage which it can read from and write to. It may be read from when it is connected to a [[Provider]] or state-changing operations can be called when connected to a [[Signer]]. _heading: Receipt Once a **Transaction** has been submitted to the blockchain, it is placed in the memory pool (mempool) until a validator decides to include it. A transaction's changes are only made once it has been included in the blockchain, at which time a receipt is available, which includes details about the transaction, such as which block it was included in, the actual fee paid, gas used, all the events that it emitted and whether it was successful or reverted. _subsection: Connecting to Ethereum @ This very first thing needed to begin interacting with the blockchain is connecting to it using a [[Provider]]. _heading: MetaMask (and other injected providers) The quickest and easiest way to experiment and begin developing on Ethereum is to use [[link-metamask]], which is a browser extension that injects objects into the ``window``, providing: - read-only access to the Ethereum network (a [[Provider]]) - authenticated write access backed by a private key (a [[Signer]]) When requesting access to the authenticated methods, such as sending a transaction or even requesting the private key addess, MetaMask will show a pop-up to the user asking for permission. _code: @lang