Skip to content

Commit

Permalink
Merge pull request #224 from massalabs/refactor_networks
Browse files Browse the repository at this point in the history
Split in two pages (public vs local), Testnet > Securnet
  • Loading branch information
damip authored Oct 30, 2023
2 parents 0e11dac + 554d846 commit b0e936b
Show file tree
Hide file tree
Showing 8 changed files with 7,975 additions and 34 deletions.
8 changes: 4 additions & 4 deletions docs/build/api/providers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ To enhance redundancy and facilitate load balancing, consider using multiple pro
</thead>
<tbody>
<tr>
<td><a href="/docs/build/networks-faucets">Massa Labs</a></td>
<td><a href="/docs/build/networks-faucets/public-networks">Massa Labs</a></td>
<td><code>JsonRPC</code></td>
<td><code>https://buildnet.massa.net/api/v2</code></td>
</tr>
<tr>
<td><a href="/docs/build/networks-faucets">Massa Labs</a></td>
<td><a href="/docs/build/networks-faucets/public-networks">Massa Labs</a></td>
<td><code>gRPC</code></td>
<td><code>grpc://buildnet.massa.net:33037</code></td>
</tr>
Expand All @@ -47,12 +47,12 @@ To enhance redundancy and facilitate load balancing, consider using multiple pro
</thead>
<tbody>
<tr>
<td><a href="/docs/build/networks-faucets">Massa Labs</a></td>
<td><a href="/docs/build/networks-faucets/public-networks">Massa Labs</a></td>
<td><code>JsonRPC</code></td>
<td><code>https://test.massa.net/api/v2</code></td>
</tr>
<tr>
<td><a href="/docs/build/networks-faucets">Massa Labs</a></td>
<td><a href="/docs/build/networks-faucets/public-networks">Massa Labs</a></td>
<td><code>gRPC</code></td>
<td><code>grpc://test.massa.net:33037</code></td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/hello-world-dapp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ This command compiles your `main.ts` contract into a `main.wasm` file generated
#### Step 3: Deploy the Smart Contract
Now that your smart contract is compiled and ready, let's deploy it to the Massa blockchain.
You first need some funds in your wallet that you can request from the [faucet](/docs/build/networks-faucets).
You first need some funds in your wallet that you can request from the [faucet](/docs/build/networks-faucets/public-networks).
You can then run the following command in your project directory:
```bash
Expand Down Expand Up @@ -359,7 +359,7 @@ We are using the `DefaultProviderUrls.BUILDNET` constant as our provider URL. Th
The boolean is a flag that indicates whether or not we want to provide an wallet account to sign transactions. Here it is set to false because we are not going to sign any transactions. Finally, we are setting the client object to the `web3client` state variable using the `setWeb3client` function, so that the web3 client is available to the rest of our application.
:::info
The buildnet is a test network that is used to test smart contracts before deploying them to the mainnet. It is similar to the Ethereum Sepolia network. You can learn more about Massa networks [here](/docs/build/networks-faucets).
The buildnet is a test network that is used to test smart contracts before deploying them to the mainnet. It is similar to the Ethereum Sepolia network. You can learn more about Massa networks [here](/docs/build/networks-faucets/public-networks).
:::
Expand Down
2 changes: 1 addition & 1 deletion docs/build/home.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Whether you're a novice or unfamiliar with smart contract technology, rest assur
icon="👛"
/>
<Feature
url="./networks-faucets"
url="./networks-faucets/public-networks"
title="Networks & Faucets"
content="Chose the right network."
icon="🌐"
Expand Down
100 changes: 100 additions & 0 deletions docs/build/networks-faucets/local-network.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
id: local-network
sidebar_label: Local network (sandbox)
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import VersionsTable from "@site/src/components/versions-table";

# Local network generation
Here, you will learn how to launch a local network with custom settings, initial coins and rolls distribution.

This may be useful for instance if you want to build and test your integration on the latest version of the nodes.

Clone massa:

```bash
git clone [email protected]:massalabs/massa.git
```

Compile it with the sandbox feature enabled:

```bash
cd massa && cargo build --release --features sandbox
```

Create a keypair in massa-client:

```bash
cd massa-client && cargo run
wallet_generate_secret_key
```

For the rest of the tutorial we will use theses abbreviations:

- `SECRETK`: The secret you just generated
- `PUBK`: The public key corresponding to SECRETK
- `ADDR`: The address corresponding to PUBK

Setup your node to use the secret you just generated as its public key and staking key:
- modify or create the file `massa-node/config/node_privkey.key`:

```bash
{"secret_key":"SECRETK","public_key":"PUBK"}
```

- modify the file `massa-node/base_config/initial_ledger.json`:

```javascript
{
"ADDR": {
"balance": "80000000",
"datastore": {},
"bytecode": []
}
}
```

- CLEAR and modify the file `massa-node/base_config/initial_rolls.json`:

```javascript
{
"ADDR": 100
}
```

- CLEAR content of `massa-node/base_config/initial_vesting.json`:

```javascript
{}
```


- modify the file `massa-node/base_config/initial_ledger.json`:

```javascript
{
"ADDR": {
"balance": "80000000",
"datastore": {},
"bytecode": []
}
}
```

- optionally, if you need a non-standard configuration, you can modify the file `massa-node/base_config/config.toml` depending on what you are trying to do.

You can now launch your node:
```bash
cd massa-node && cargo run --features sandbox
```

On your client run the following command to add your secret key as staking key:

```bash
cd massa-client && cargo run node_start_staking ADDR
```

The local network and your node will start after 10 seconds. Once it is started, you can interact with it using the CLI
client as you would with a node on a public network.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: networks-faucets
sidebar_label: Networks & Faucets
id: public-networks
sidebar_label: Public networks & Faucets
---

import Tabs from "@theme/Tabs";
Expand Down Expand Up @@ -34,12 +34,12 @@ Here's a handy table containing all you need to know about the different Massa n
<tr>
<td>🕵️ Explorer</td>
<td>
<a href="https://buildnet.massa.net">https://buildnet.massa.net</a>
<a href="https://buildnet-explorer.massa.net">https://buildnet-explorer.massa.net</a>
</td>
</tr>
</table>
</TabItem>
<TabItem value="testnet" label="🧑‍🔬 TestNet">
<TabItem value="securnet" label="🧑‍🔬 SecurNet">
<table>
<tr>
<td>🔗 Public API</td>
Expand All @@ -53,7 +53,7 @@ Here's a handy table containing all you need to know about the different Massa n
<td>🪙 Faucet</td>
<td>
<a href="https://discord.com/channels/828270821042159636/866190913030193172">
#testnet-faucet
#securnet-faucet
</a>{" "}
Discord channel
</td>
Expand Down Expand Up @@ -89,26 +89,28 @@ Faucets play a crucial role in the blockchain ecosystem:

## What's Special About These Networks?

### Testnet
### Securnet

The Massa Testnet serves as the vital sandbox in the Massa ecosystem, designed for robust testing and experimentation.
The Massa Securnet serves as a security playground in the Massa ecosystem.

At Massa, we are continually pushing the boundaries of performance, decentralization, and security, introducing significant and groundbreaking features regularly.
With such relentless innovation, it's crucial that we ensure everything functions perfectly, even at scale. This is where Testnet comes into play.
A Bug Bounty program lets anyone try and find security holes, of different types. Securnet allows anyone to run a node and actively participate in the network,
trying to break things related to:

Testnet allows anyone to run a node and actively participate in the network, trying out these innovative features, testing applications, and experimenting with smart contracts.
What makes Testnet even more appealing is that all this can be done without the worry of using real assets or affecting the main network.
Think of Testnet as our proving ground - a place where we can confidently explore and experiment with the future of blockchain technology.
- [The node](https://github.com/massalabs/massa)
- [Massa standards](https://github.com/massalabs/massa-standards)
- [Massa Station wallet](/docs/massaStation/home)

More information about the Bug Bounty will be available soon.

### Buildnet

The Massa BuilderNet serves as your reliable playground for crafting and deploying smart contracts on the Massa blockchain.
The Massa Buildnet serves as your reliable playground for crafting and deploying smart contracts on the Massa blockchain.

While we regularly push new, groundbreaking features to Testnet, BuilderNet follows a more gradual upgrade cycle. This careful pace ensures its constant availability and stability - key factors that you, as a developer, rely on.
While we regularly push new, groundbreaking features to Securnet, Buildnet follows a more gradual upgrade cycle. This careful pace ensures its constant availability and stability - key factors that you, as a developer, rely on.

At MassaLabs, we put significant effort into the careful maintenance of BuilderNet. Our goal is to provide you with a platform where you can build robust, innovative applications.
At MassaLabs, we put significant effort into the careful maintenance of Buildnet. Our goal is to provide you with a platform where you can build robust, innovative applications.

Leveraging BuilderNet's unique features and capabilities, you can navigate the forefront of blockchain technology with confidence and peace of mind, knowing you have a stable and dependable environment for your projects.
Leveraging Buildnet's unique features and capabilities, you can navigate the forefront of blockchain technology with confidence and peace of mind, knowing you have a stable and dependable environment for your projects.

## Are There Any Requirements for Using Faucets?

Expand Down
13 changes: 11 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,18 @@ const sidebars = {
],
},
{
type: "doc",
id: "build/networks-faucets",
type: "category",
label: "Networks & Faucets",
items: [
{
type: "doc",
id: "build/networks-faucets/public-networks",
},
{
type: "doc",
id: "build/networks-faucets/local-network",
}
],
},
{
type: "doc",
Expand Down
18 changes: 9 additions & 9 deletions static/json/versions-tooling.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"title": "Massa Tools Versions Compatibilities",
"networks": ["Buildnet", "Testnet"],
"networks": ["Buildnet", "Securnet"],
"projects": [
{
"title": "sc-project-initializer",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/project-initializer",
"npmLink": "https://www.npmjs.com/package/@massalabs/sc-project-initializer?activeTab=versions"
Expand All @@ -15,7 +15,7 @@
"title": "massa-as-sdk",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/massa-as-sdk",
"npmLink": "https://www.npmjs.com/package/@massalabs/massa-as-sdk?activeTab=versions"
Expand All @@ -24,7 +24,7 @@
"title": "massa-web3",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/massa-web3",
"npmLink": "https://www.npmjs.com/package/@massalabs/massa-web3?activeTab=versions"
Expand All @@ -33,7 +33,7 @@
"title": "wallet-provider",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/wallet-provider",
"npmLink": "https://www.npmjs.com/package/@massalabs/wallet-provider?activeTab=versions"
Expand All @@ -42,7 +42,7 @@
"title": "as-types",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/as-types",
"npmLink": "https://www.npmjs.com/package/@massalabs/as-types?activeTab=versions"
Expand All @@ -51,7 +51,7 @@
"title": "as-proba",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/as-proba",
"npmLink": "https://www.npmjs.com/package/@massalabs/as-proba?activeTab=versions"
Expand All @@ -60,7 +60,7 @@
"title": "as-transformer",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/as-transformer",
"npmLink": "https://www.npmjs.com/package/@massalabs/as-transformer?activeTab=versions"
Expand All @@ -69,7 +69,7 @@
"title": "sc-deployer",
"compatibilities": [
{ "network": "Buildnet", "version": "buildnet" },
{ "network": "Testnet", "version": "latest" }
{ "network": "Securnet", "version": "latest" }
],
"install": "npm install @massalabs/massa-sc-deployer",
"npmLink": "https://www.npmjs.com/package/@massalabs/massa-sc-deployer?activeTab=versions"
Expand Down
Loading

0 comments on commit b0e936b

Please sign in to comment.