Skip to content

Commit

Permalink
Add mainnet docs + refacto node running docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Besancon committed Jan 8, 2024
1 parent f1dbc4c commit 7cdfba5
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/config/link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"pattern": "^http://manpages.ubuntu.com"
},
{
"pattern": "^https://test.massa.net/api/v2"
"pattern": "^https://mainnet.massa.net/api/v2"
},
{
"pattern": "^https://buildnet.massa.net/api/v2"
Expand Down
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@ yarn-error.log*
.yarn
.pnp.*

# downlaoded files
# downloaded files
external/client/buildnet/config.toml
external/client/securnet/config.toml
external/client/testnet/config.toml
external/client/mainnet/config.toml
external/node/buildnet/config.toml
external/node/securnet/bootstrap_whitelist.json
external/node/securnet/config.toml
external/node/testnet/bootstrap_whitelist.json
external/node/testnet/config.toml
external/node/mainnet/bootstrap_whitelist.json
external/node/mainnet/config.toml

*.mdx-e

# IDE
.idea
.vscode
145 changes: 129 additions & 16 deletions docs/build/api/jsonrpc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,25 @@ Summary of the current state: time, last final blocks (hash, thread,
slot, timestamp), clique count, connected nodes count.

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_status",
"params": []
}'
```

</TabItem>

<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -174,10 +189,24 @@ Get information about the block
of the graph.

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_cliques",
"params": []
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -222,10 +251,24 @@ Get information about active
their roll counts for the current cycle.

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_stakers",
"params": [ {"offset": 0, "limit": 2 }]
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -268,10 +311,24 @@ Get information about
(es) (balances, block creation, \...).

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_addresses",
"params": [["AU12gAkmGeozFceJD4tQmbVvihYdX2KyWZcYLL8xdYZeP4EuWYdex"]]
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -361,10 +418,24 @@ Get information about block graph
within the specified time interval.

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_graph_interval",
"params": [{"start": 1678095527706, "end": 1678095529706}]
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -447,10 +518,24 @@ Get information about [block(s)](https://docs.massa.net/docs/learn/architecture/
associated to a given hash(s).

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_blocks",
"params": [["B122ByHzPVJ3QFwmuYcZ4vZYzq6rfkqx7BJSJdFNHWp9j2o5Fpxv"]]
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -551,10 +636,24 @@ Get information about
(s) information associated to a given operation(s) ID(s).

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_operations",
"params": [["O1LMr9xyL9fVSbUvZao4jy6t2Pj5UPtLG8x1fxvS6SD7dPb5S52"]]
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down Expand Up @@ -616,10 +715,24 @@ Get information about
(s) (content, finality \...)

<Tabs>
<TabItem value="json" label="cURL" default>
<TabItem value="json (Mainnet)" label="cURL (Mainnet)" default>

```shell
curl --location --request POST 'https://mainnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "get_endorsements",
"params": [["E12kB72Jz4iMWkVkckS2e6cUBm4e5XEW77biDjSysAWmQkNrvuJr"]]
}'
```

</TabItem>
<TabItem value="json (Buildnet)" label="cURL (Buildnet)">

```shell
curl --location --request POST 'https://test.massa.net/api/v2' \
curl --location --request POST 'https://buildnet.massa.net/api/v2' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
Expand Down
24 changes: 24 additions & 0 deletions docs/build/api/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,30 @@ Be aware that the latency you encounter may vary depending on the provider's geo
To enhance redundancy and facilitate load balancing, consider using multiple providers.

<Tabs>
<TabItem value="mainnet" label="👷 MainNet" default>
<table>
<thead>
<tr>
<th>Provider</th>
<th>Protocol</th>
<th>Endpoint URL</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="/docs/build/networks-faucets/public-networks">Massa Labs</a></td>
<td><code>JsonRPC</code></td>
<td><code>https://mainnet.massa.net/api/v2</code></td>
</tr>
<tr>
<td><a href="/docs/build/networks-faucets/public-networks">Massa Labs</a></td>
<td><code>gRPC</code></td>
<td><code>grpc://mainnet.massa.net:33037</code></td>
</tr>
</tbody>
</table>
</TabItem>

<TabItem value="buildnet" label="👷 BuildNet" default>
<table>
<thead>
Expand Down
20 changes: 0 additions & 20 deletions docs/build/massa-web3/massa-web3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ You can easily initialize a client instance using the ClientFactory class:

<Tabs>
<TabItem value="mainnet-client" label="Mainnet" default>

```typescript
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
Expand All @@ -158,27 +157,9 @@ const testnetClient: Client = await ClientFactory.createDefaultClient(
baseAccount // optional parameter
);
```

</TabItem>

<TabItem value="testnet-client" label="Testnet" default>

```typescript
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
);

const testnetClient: Client = await ClientFactory.createDefaultClient(
DefaultProviderUrls.TESTNET,
true, // retry failed requests
baseAccount // optional parameter
);
```

</TabItem>

<TabItem value="buildnet-client" label="Buildnet" default>

```typescript
const baseAccount: IAccount = await WalletClient.getAccountFromSecretKey(
privateKey
Expand All @@ -190,7 +171,6 @@ const testnetClient: Client = await ClientFactory.createDefaultClient(
baseAccount // optional parameter
);
```

</TabItem>

<TabItem value="labnet-client" label="Labnet" default>
Expand Down
23 changes: 23 additions & 0 deletions docs/build/networks-faucets/public-networks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ import VersionsTable from "@site/src/components/versions-table";
Here's a handy table containing all you need to know about the different Massa networks and their faucets.

<Tabs>
<TabItem value="mainnet" label="👷 MainNet" default>
<table>
<tr>
<td>🔗 Public API</td>
<td>
<a href="https://mainnet.massa.net/api/v2">
https://mainnet.massa.net/api/v2
</a>
</td>
</tr>
<tr>
<td>🕵️ Explorer</td>
<td>
<a href="https://explorer.massa.net">https://explorer.massa.net</a>
</td>
</tr>
</table>
</TabItem>

<TabItem value="buildnet" label="👷 BuildNet" default>
<table>
<tr>
Expand Down Expand Up @@ -62,6 +81,10 @@ Faucets play a crucial role in the blockchain ecosystem:

## What's Special About These Networks?

### Mainnet

The Massa Mainnet is the main network. It is the only Massa network for which MAS has a monetary value. As a result, no faucet is available for the Mainnet.

### Buildnet

The Massa Buildnet serves as your reliable playground for crafting and deploying smart contracts on the Massa blockchain. Buildnet follows a gradual upgrade cycle. This careful pace ensures its constant availability and stability - key factors that you, as a developer, rely on.
Expand Down
Loading

0 comments on commit 7cdfba5

Please sign in to comment.