πŸ‘Ά Beginner's Guide to Getting Started (for Macs)

Everything you need to get started using Alchemy on a Mac.

Get access to Alchemy for free here.

For a quick start, you can interact with Ethereum nodes using JSON RPC shell commands. This can be quite manual, and you can write POST requests, GET requests, or others. See examples here.

Rather than writing out requests manually, you can use Web3 to interact with the Ethereum blockchain. Web3 is a collection of libraries that allow you to connect to a node using HTTP, WebSockets, or IPC. You can use Web3 libraries in whichever language you are most comfortable with, the most common being Javascript, Java, and Python.

1. Install Node and NPM

First, install Homebrew. Open Terminal and run:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Next, install NodeJS and npm using Homebrew:

brew install node

You can now run Javascript in Terminal:

node

2. Install Alchemy.js

Use Web3 libraries plus Alchemy API! Learn more here.

We recommend that you install Alchemy.js. In Terminal on the command line:

npm install @alch/alchemy-web3

3. Install WebSockets

Learn more about WebSockets through the Using WebSockets page. To use WebSockets, first install WebSocket cat.

npm install -g wscat

Now connect to Alchemy's blockchain infrastructure using WebSockets:

Using Alchemy's demo:

wscat -c wss://eth-mainnet.ws.alchemyapi.io/ws/demo

Using your own key:

wscat -c wss://eth-mainnet.alchemyapi.io/ws/<api-key>

Create a Web3 instance and set your provider as Alchemy:

const web3 = new Web3("wss://eth-mainnet.ws.alchemyapi.io/ws/demo");

4. Start Building!

Now that you have everything you need installed, start building your first app!

​