Skip to content

Update rpc endpoints #71

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pages/evm/foundry.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Auto EVM is compatible with most EVM versions but doesn't support some features
To make our lives easier, let’s create a new `Makefile` as well as a `.env` file at the root of our project. `.env` files are typically used to store environment variables for your application. They are particularly useful for managing settings that change between deployment environments (e.g., development, testing, staging, and production), and for storing sensitive information. Environment variables can include database connection details, API keys, external resource URIs, or other configuration variables that might change depending on the environment in which the application is running. In our case, we would use it to point to our Auto-EVM RPC URL:

```bash
RPC_URL=https://nova-0.taurus.subspace.network/ws
RPC_URL=https://auto-evm.taurus.autonomys.xyz/ws
```

And then set a private key for the EVM-compatible wallet:
Expand Down
2 changes: 1 addition & 1 deletion pages/evm/hardhat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ solidity: {
},
networks: {
subspace: {
url: "https://nova-0.taurus.subspace.network/ws",
url: "https://auto-evm.taurus.autonomys.xyz/ws",
accounts: ["private_key_to_your_account"]
}
}
Expand Down
2 changes: 1 addition & 1 deletion pages/evm/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Auto EVM is compatible with most EVM versions but doesn't support some features

```
Network Name: Autonomys EVM
New RPC URL: https://auto-evm-0.taurus.subspace.network/ws
New RPC URL: https://auto-evm.taurus.autonomys.xyz/ws
Chain ID: 490000
Currency Symbol: tAI3
```
Expand Down
2 changes: 1 addition & 1 deletion pages/evm/metamask.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This guide will help you set up a [**MetaMask**](https://metamask.io/) wallet (a

```
Network Name: Autonomys EVM
New RPC URL: https://auto-evm-0.taurus.subspace.network/ws
New RPC URL: https://auto-evm.taurus.autonomys.xyz/ws
Chain ID: 490000
Currency Symbol: tAI3
```
Expand Down
3 changes: 1 addition & 2 deletions pages/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ To start using the Auto EVM, refer to our [guides and manuals](/evm/introduction
- `wss://rpc.taurus.autonomys.xyz/ws`

### Auto EVM
- `wss://auto-evm-0.taurus.subspace.network/ws`
- `wss://auto-evm-1.taurus.subspace.network/ws`
- `wss://auto-evm.taurus.autonomys.xyz/ws`

### Auto ID

Expand Down
203 changes: 195 additions & 8 deletions pages/llm_friendly_docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ Auto EVM is compatible with most EVM versions but doesn't support some features
To make our lives easier, let’s create a new \`Makefile\` as well as a \`.env\` file at the root of our project. \`.env\` files are typically used to store environment variables for your application. They are particularly useful for managing settings that change between deployment environments (e.g., development, testing, staging, and production), and for storing sensitive information. Environment variables can include database connection details, API keys, external resource URIs, or other configuration variables that might change depending on the environment in which the application is running. In our case, we would use it to point to our Auto-EVM RPC URL:

\`\`\`bash
RPC_URL=https://nova-0.taurus.subspace.network/ws
RPC_URL=https://auto-evm.taurus.autonomys.xyz/ws
\`\`\`

And then set a private key for the EVM-compatible wallet:
Expand Down Expand Up @@ -745,7 +745,7 @@ solidity: \{
\},
networks: \{
subspace: \{
url: "https://nova-0.taurus.subspace.network/ws",
url: "https://auto-evm.taurus.autonomys.xyz/ws",
accounts: ["private_key_to_your_account"]
\}
\}
Expand Down Expand Up @@ -809,7 +809,7 @@ Auto EVM is compatible with most EVM versions but doesn't support some features

\`\`\`
Network Name: Autonomys EVM
New RPC URL: https://auto-evm-0.taurus.subspace.network/ws
New RPC URL: https://auto-evm.taurus.autonomys.xyz/ws
Chain ID: 490000
Currency Symbol: tAI3
\`\`\`
Expand Down Expand Up @@ -1005,7 +1005,7 @@ This guide will help you set up a [**MetaMask**](https://metamask.io/) wallet (a

\`\`\`
Network Name: Autonomys EVM
New RPC URL: https://auto-evm-0.taurus.subspace.network/ws
New RPC URL: https://auto-evm.taurus.autonomys.xyz/ws
Chain ID: 490000
Currency Symbol: tAI3
\`\`\`
Expand Down Expand Up @@ -1155,7 +1155,195 @@ With The Graph, developers can benefit from:
- GraphQL Queries: Provides a powerful GraphQL interface for querying indexed data, making data retrieval super simple.
- Customization: Define your own logic for transforming & storing blockchain data. Reuse subgraphs published by other developers on The Graph Network.

Follow this [quick-start](https://thegraph.com/docs/en/quick-start/) guide to create, deploy, and query a subgraph within 5 minutes.
Follow this quick-start guide to create, deploy, and query a subgraph within 5 minutes.

### Benefits

Indexers like The Graph create a queryable data layer specifically tracking events and state changes from your smart contract. By monitoring and organizing this contract data, they enable complex queries that would be impossible through direct blockchain calls. This allows your dApp to efficiently access historical transactions, track relationships between entities, and analyze patterns over time - all without multiple RPC calls.

### Prerequisites

- A crypto wallet
- A smart contract address on a supported network
- Node.js⁠ installed
- A package manager of your choice (npm, yarn or pnpm)

### Quick Start guide

1. Proceed to the [Subgraph Studio](https://thegraph.com/studio) and login via one of the supported wallets.

![the-graph-1](/developers/the-graph-1.png)

2. Confirm the sign and sign a message to use Studio.

![the-graph-2](/developers/the-graph-2.png)

![the-graph-3](/developers/the-graph-3.png)

3. Click on **Create a Subgraph** on the main dashboard.

![the-graph-4](/developers/the-graph-4.png)

4. Specify the **Subgraph Name**.

![the-graph-5](/developers/the-graph-5.png)

5. Upon creating a Subgraph, you will see its dashboard, where you can a project description, source code URL, and a website URL.

![the-graph-6](/developers/the-graph-6.png)

6. On the right side, click on **Select a network** and pick **Autonomys** from the dropdown list.

![the-graph-7](/developers/the-graph-7.png)

7. Install **Graph CLI** using provided commands. You can use \`yarn\`, \`npm\`, \`pnpm\`, or \`bun\`.

8. Initialize the subgraph by running \`graph init autonomys-subgraph\`. This will create a boilerplate subgraph project.
During the initialization, you will need to specify a few things:
- Network (Autonomys)
- Subgraph slug (feel free to use the default name)
- Directory to create the subgraph in (feel free to use the default directory)
- Smart contact address (the address of your smart contract deployed on Autonomys Taurus EVM domain)
- ABI file (path)
- Start block (feel free to use the default value)
- Contract name
- Index contract events as entities (true or false value)

![the-graph-8](/developers/the-graph-8.png)

> Tip: you can find the contract ABI by looking at the \`token_metadata\` file.
E.g. if you're using Remix IDE, find your contract metadata file, collapse it on the \`abi\` line 7, copy the entire \`abi\` including the square brakets **[]** and save it into a \`json\` file on your PR.

![the-graph-9](/developers/the-graph-9.png)

![the-graph-10](/developers/the-graph-10.png)

9. Run \`graph auth\` to authenticate the project and provide your deploy key which you can find on the **Subgraph Dashboard**.

10. Enter the directory with \`cd project_name\` and run \`graph codegen && graph build\` to build the project, you will see the \`build/subgraph.yaml\` file being created.

![the-graph-11](/developers/the-graph-11.png)

11. Deploy your subgraph by running \`graph deploy subgraph-autonomys\`. You will be asked to specify the version of the subgraph, e.g. v0.0.1.

![the-graph-12](/developers/the-graph-12.png)

12. Proceed back to the **Graph Studio**, the status will change to **Deployed**.

![the-graph-13](/developers/the-graph-13.png)

13. The new tabs **Playground**, **Endpoints**, **Logs** will now be accessible to you! You can find usage examples of querying the data, accessing the data via API, and can test queries in the **Playground** without leaving the studio!

![the-graph-14](/developers/the-graph-14.png)

Congratulations, you've successfully setup and configured a subgraph for your application!

### Querying data in your smart contract

Subgraphs are primarily designed to index and query events emitted by smart contracts.

1. Let's make some slight changes to the \`Counter\` contract we introduced in the [Foundry guide](/evm/foundry.mdx) and modify functions to emit events.


\`\`\`solidity
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

contract Counter \{
uint256 public number;

event NumberSet(uint256 newNumber);
event NumberIncremented(uint256 newNumber);
event NumberDecremented(uint256 newNumber);

function setNumber(uint256 newNumber) public \{
number = newNumber;
emit NumberSet(number);
\}

function increment() public \{
number++;
emit NumberIncremented(number);
\}

function decrement() public \{
number--;
emit NumberDecremented(number);
\}
\}
\`\`\`

> Note: This will affect the contract ABI, make sure to change it and upgrade your Subgraph application.

2. Then we'll change the \`Counter\` contract state and set the number to \`5\` by running \`cast send YOUR_CONTRACT_ADDRESS "setNumber(uint256)" 5 --rpc-url https://auto-evm.taurus.autonomys.xyz/ws --private-key YOUR_KEY\`

3. Let's trigger one more event in the \`Counter\` contract by calling the \`increment()\` function. We can do that by running \`cast send YOUR_CONTRACT_ADDRESS "increment()" --rpc-url https://auto-evm.taurus.autonomys.xyz/ws --private-key YOUR_KEY\`

4. With two events emitted, let's proceed to **The Graph** playground and **query them**!

5. Open the **Graph Playground** tab where you try running the following queries:

#### Query to Get All NumberSet Events
\`\`\`bash
\{
numberSets(first: 10, orderBy: blockTimestamp, orderDirection: desc) \{
id
newNumber
blockTimestamp
blockNumber
transactionHash
\}
\}
\`\`\`

#### Query to Get All Increment Events

\`\`\`bash
\{
numberIncrementeds(first: 10, orderBy: blockTimestamp, orderDirection: desc) \{
id
newNumber
blockTimestamp
blockNumber
transactionHash
\}
\}
\`\`\`

#### Get All Events (Set, Increment, Decrement) in Chronological Order

\`\`\`bash
\{
numberSets(orderBy: blockTimestamp) \{
id
newNumber
blockTimestamp
blockNumber
transactionHash
__typename
\}
numberIncrementeds(orderBy: blockTimestamp) \{
id
newNumber
blockTimestamp
blockNumber
transactionHash
__typename
\}
numberDecrementeds(orderBy: blockTimestamp) \{
id
newNumber
blockTimestamp
blockNumber
transactionHash
__typename
\}
\}
\`\`\`

> Tip: you can also run queries directly from the terminal using \`cURL\` or \`gql\`. You can find **Example Usage** under the **Endpoints** tab.



---

Expand Down Expand Up @@ -1376,8 +1564,7 @@ To start using the Auto EVM, refer to our [guides and manuals](/evm/introduction
- \`wss://rpc.taurus.autonomys.xyz/ws\`

### Auto EVM
- \`wss://auto-evm-0.taurus.subspace.network/ws\`
- \`wss://auto-evm-1.taurus.subspace.network/ws\`
- \`wss://auto-evm.taurus.autonomys.xyz/ws\`

### Auto ID

Expand Down Expand Up @@ -1458,7 +1645,7 @@ Many functions in the \`auto-consensus\` package require an \`api\` object as a
import \{ createConnection \} from '@autonomys/auto-utils';

async function getApiInstance() \{
const endpoint = 'wss://rpc-0.taurus.subspace.network/ws';
const endpoint = 'wss://rpc.taurus.autonomys.xyz/ws';
const api = await createConnection(endpoint);
return api;
\}
Expand Down
2 changes: 1 addition & 1 deletion pages/sdk/auto-consensus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Many functions in the `auto-consensus` package require an `api` object as a para
import { createConnection } from '@autonomys/auto-utils';

async function getApiInstance() {
const endpoint = 'wss://rpc-0.taurus.subspace.network/ws';
const endpoint = 'wss://rpc.taurus.autonomys.xyz/ws';
const api = await createConnection(endpoint);
return api;
}
Expand Down