# Welcome to StealthTest

The End-to-End Solution for Web3 Development

## What is StealthTest&#x20;

StealthTest is a meticulously designed, comprehensive infrastructure solution that specifically caters to the pivotal aspects of **smart contract development, testing, and deployments**. Nestled securely within **cloud-based, private testing environments**, our platform instantaneously provides blockchain infrastructure to service every phase of your product lifecycle.&#x20;

This allows developers to direct their energies toward crafting innovative applications, liberating them from the complexities of node deployments and environmental variables.&#x20;

Engineered for **optimal functionality**, StealthTest is designed to **minimize maintenance** and **maximize cost efficiency** via resource autoscaling and frictionless network upgrades. This is all accomplished through a proven, repeatable node deployment strategy and a hands-off management approach, eliminating the common headaches associated with self-managed node upkeep.

## Why we built StealthTest

Our core belief is that the process of developing, testing, and deploying smart contracts should be seamless and collaborative. In the world of public testnets, there's potential exposure to unnecessary risks. The hassles of faucets and test tokens can detract from the real work at hand. And the pressing question arises: How do you confidently test your work, in its entirety, prior to its grand reveal? Motivated by these challenges, we've pioneered a bespoke private test network infrastructure. With StealthTest, users can effortlessly establish environments, deploy contracts, fund accounts, and test applications. All of this, within a secure and intuitive ecosystem.&#x20;

### Our core product suite includes:

* A **fully functional mainnet replica node** that remains private, ensuring security and confidentiality during the development and testing phases. This allows for safe experimentation without risk to live systems.
* An **unlimited faucet and five pre-funded test wallets** ready for immediate use and importable into any popular wallet provider or CI/CD system, our platform allows clients to enjoy boundless testing without limitations.&#x20;
* A **repository of popular and verified smart contracts** that users can view, select, and deploy directly to their private environments. Instantly deploy contracts and protocols such as ERC-721, ERC-1115, Uniswap, and Chainlink.
* A **native real-time transaction log** and a **comprehensive block explorer**, enabling real-time viewing of any on-chain activity. Key steps in validating source code and functions, such as contract verification and read/write interfaces, are facilitated, enhancing transparency and insight.
* A **token viewer** allows our customers to test the complete minting process and view minted tokens in a marketplace-style preview, as they would in Opensea. This unique feature is designed to ensure the token, metadata, and media quality exceeds expectations, providing a confident and successful pathway to the go-live process.
* An **intuitive user interface**, we provide a **robust API** that allows for seamless integration, streamlining development, and deployment workflows.&#x20;
* A **smart contract compiler and deployer service** that empowers customers to upload, store, and deploy their own smart contracts effortlessly.&#x20;
* **Instant team creation** and **role-based access control**, our platform makes it effortless to invite and onboard teammates across diverse teams and projects. This enhances collaboration and streamlines the management of varying teams or projects.
* *(Coming soon!)* **Mainnet deployments** that revolutionize the transition from testing to live deployment with an optimized deploy flow that reduces deployment complexity by an astounding 70%. This will not only accelerate the funding process but also offer predictive gas fee calculations, allowing for a seamless and cost-effective mainnet launch.&#x20;
* *(Coming soon)* **Integrated analytics for both on and off-chain** activities providing valuable insights into the performance of environments. This allows for comprehensive performance tracking and data-driven optimization.

### EVM Network Support:

* Ethereum&#x20;
* Polygon
* Moonbeam
* Arbitrum One
* Arbitrum Nova&#x20;
* Optimism *(Coming soon)*
* Avalanche C-Chain *(Coming soon)*
* zkSync *(Coming soon)*
* Base *(Coming soon)*

### Environment URL breakdown

Each network comes with its own unique provider URL and chain ID. This URL is specific to your account and to the environment that it was generated.&#x20;

* RPC URL --> Users who wish to connect to a private test network must do so via the node's *RPC endpoint*. An RPC (remote procedure call) endpoint is like a node's address.
  * Your unique network URL is a gateway that allows you to easily connect directly to your own private StealthTest network.
* Chain ID --> A chain ID is a unique identifier representing your private test network.&#x20;
  * We use dynamic chain IDs to distinguish your different blockchain networks from each other and to ensure that transactions and messages are always sent to your specific private network.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2Fs07kZSnzWVUrjKVDtWva%2Fenv-links.jpg?alt=media&amp;token=63c0c45c-4bc8-4847-abfd-86d53fa8106a" alt=""><figcaption></figcaption></figure>

Ready to learn more? Check out the other features we offer with StealthTest!

{% content-ref url="/pages/yWRiFutBe9r7fm0yajwf" %}
[Test Wallets](/features-and-fundamentals/test-wallets)
{% endcontent-ref %}

{% content-ref url="/pages/DaTlDPP5NFmuLaHZPIWA" %}
[Faucet](/features-and-fundamentals/faucet)
{% endcontent-ref %}

{% content-ref url="/pages/O8838MkGsgpAGooF4Nku" %}
[Advanced Block Explorer](/features-and-fundamentals/logs/advanced-block-explorer)
{% endcontent-ref %}

{% content-ref url="/pages/rrfvnZLKSM0NFZbelRnB" %}
[Logs](/features-and-fundamentals/logs)
{% endcontent-ref %}

{% content-ref url="/pages/Ebtfyu5COJwT5qhakwgp" %}
[Teams & User Roles](/features-and-fundamentals/teams-and-user-roles)
{% endcontent-ref %}


# Faucet

A guide to understanding the StealthTest faucet.

Due to the many variables that can affect testing, you may need to replenish your test wallets with additional environment-specific tokens. Fortunately for you, we have built our own custom StealthTest faucet allowing you to do just that, instantly.

**What is a faucet?**

* A faucet is an easy-to-use tool that allows you to select your environment, choose your preferred environment and the specific network (Ex: Ethereum or Polygon) and input an address to receive between 1 and 100 test tokens, similar in functionality to a faucet you may use when working with public testnets such as Rinkeby or Goerli.

Along with the test wallets we provide, we have also made it possible for you to use your own wallet for testing purposes. In order to do this, simply enter your preferred wallet address into the required address field. More info on this can be found below!

{% hint style="danger" %}
**We will never ask you for your private key, nor will it ever be required at&#x20;*****any*****&#x20;step in the process.**
{% endhint %}

**There are two ways to access the faucet:**

1. From the **Environments** page, select your preferred environment and you can access the **faucet** within the **Dashboard**, below the transaction log preview. From there, please do the following:
   1. Input wallet address
   2. Enter your desired amount (Between 1 and 100)
   3. Click **Add Funds**

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2Fqc9CTQqRbxhsh11cLpus%2Ffaucet-dashboard.jpg?alt=media&amp;token=6ea1b86d-8010-43f1-abb3-3a934b6952a3" alt=""><figcaption></figcaption></figure>

2. Select the **Wallets** tab from selected **Environments** page. From there, you can:
   1. Fund any wallet (including wallets outside of the test wallets given with the environment) by doing the following steps:
      1. Input wallet address
      2. Enter your desired amount (Between 1 and 100)
      3. Click **Add Funds**

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FwTNYCIbM8azncwRKkxF5%2Ffaucet-1.jpg?alt=media&amp;token=64763fb4-f388-4a63-a340-9cb461b0aa1a" alt=""><figcaption><p>Faucet access via Environments page</p></figcaption></figure>

{% hint style="info" %}
At this time, you may only request up to 100 test tokens at once. However, you may perform that action as often as is necessary.&#x20;
{% endhint %}

2. Add **one token** to any of the listed test wallets immediately by clicking the **coin-plus icon** next to the wallet balance.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2Fz21FHHhrCs3DbbADSF1S%2Ffaucet-2.jpg?alt=media&amp;token=755bad1d-45b2-4caf-a6ff-5c8d0befe347" alt=""><figcaption></figcaption></figure>


# Logs

A brief overview of what you'll find in our transaction log

### Overview

Our transaction log is the first feature of our Block Explorer. You'll be able to see all of the wallet, contract, transaction, and block-level details of your private test network right here.

{% hint style="info" %}
Only transactions for the selected environment will be displayed in the logs.
{% endhint %}

{% hint style="warning" %}
Not all transactions will appear in the logs immediately. There may be a 30-second delay in some cases, but every transaction will be recorded and visible.
{% endhint %}

There are two ways to access the transaction logs

* From your expanded environment details, you can simply select the button that says **Logs**
* Once you have an **active** environment, a **Logs** tab will appear in your **Environments** page.&#x20;
* A small transaction log will populate on the **Dashboard** once transactions are created.&#x20;

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FQZkIuRCjxd4EQHacYt7d%2Flogs-dashboard.jpg?alt=media&amp;token=dcc95e5a-a2f5-4d39-8d1d-a5731be1aec7" alt=""><figcaption></figcaption></figure>

### Diving deeper into the details&#x20;

Below you'll find a list of data points that you'll be able to access about a specific StealthTest test network.

**Transaction Data**

* Transaction hash
* Status
* Block number&#x20;
* Timestamp
* From and To address
* Value
* Transaction fee
* Gas price
* Gas limit and usage by TXN
* Other attributes
* Input data&#x20;

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FLkhLHKXgXChqWNveViEg%2Ftxn%20details.png?alt=media&amp;token=fa336b86-b4a8-4986-9b38-3406c21ace62" alt=""><figcaption></figcaption></figure>

**Contract & Wallet Address Activity**&#x20;

* You can see all of the incoming and outgoing activity associated with a specific address by clicking on it. We will also display the current balance in the wallet for wallet addresses.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FRkxPn95sKHLU42yFncGh%2Flogs-2.jpg?alt=media&amp;token=bf756297-ae42-4845-a55d-89b5028311a2" alt=""><figcaption></figcaption></figure>

**Block Data**

* Block height
* Status&#x20;
* Timestamp
* Transactions
* Total difficulty&#x20;
* Size
* Gas used
* Gas limit&#x20;
* Extra aata
* Hash
* Parent hash
* State root
* Nonce

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FINC6ScbDrBd4AHo39AB5%2Fblock%20data.png?alt=media&amp;token=110de942-685d-4789-806a-6f7b2c7de92c" alt=""><figcaption></figcaption></figure>


# Advanced Block Explorer

A look into our advanced block explorer, an extension of our Logs feature

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F6kUI1yz8Y5Z7xs7Git60%2Ftop-half-welcome-dark.png?alt=media&amp;token=dafe6d11-24d1-4904-9ec9-ae5b61b1a830" alt=""><figcaption></figcaption></figure>

### Overview

Our advanced block explorer feature is a sophisticated and comprehensive explorer, offering users an in-depth view of all chain data, transactions, smart contracts, and beyond. This feature provides a wide range of capabilities, making it an essential tool for casual users and blockchain developers.

{% hint style="info" %}
This feature is only available for users who have upgraded to an **Enterprise** plan
{% endhint %}

You can access this feature once you've created an active StealthTest environment and navigated to the Logs page. As an Enterprise user, you are granted access to this feature, which is available at the top-right of the logs page. This will open up a new tab, with all chain data and transaction history immediately on display.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FJjcaxxzkBf9prOYD0bjj%2FExplorer_Selection.jpg?alt=media&amp;token=de147331-4492-41d6-af46-8cae271fa916" alt=""><figcaption><p>Advanced Explorer Selection</p></figcaption></figure>

Once you’ve accessed the explorer, the default homepage is a powerful dashboard that reveals so much right away. You’ll see **real-time transactions and blocks** on the blockchain. Each transaction displays hashes, send/recipient addresses, timestamps, gas fees, confirmations, and [transaction types](#transaction-types).

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F75mvl6H2bNoAeQlE145Z%2Fbetter_bottom_half_dark.png?alt=media&amp;token=01a288d1-14b6-439f-8d23-8f276158d18e" alt=""><figcaption></figcaption></figure>

#### Transaction Types

| Type              | Definition                                                                                                 |
| ----------------- | ---------------------------------------------------------------------------------------------------------- |
| Coin Transfer     | Value transfer, value >= 0, no tx input                                                                    |
| Contract Call     | Tx input is present (any value including 0)                                                                |
| Contract Creation | Creation of a smart-contract                                                                               |
| Token Burning     | Recognized token transfer of any of ERC-20, 721, 1155 token instance (single or bulk) to 0x0000... address |
| Token Creation    | Creation of token instance in ERC-1155                                                                     |
| Token Minting     | Token transfer of any of ERC-20, 721, 1155 token instance (single or bulk) from 0x0000... address          |
| Token Transfer    | Token transfer of any of ERC-20, 721, 1155 token instance (single or bulk)                                 |
| Transaction       | A contract call where the contract has not yet been identified by Blockscout                               |

***

### Key Features

Taking full advantage of this explorer, you can enjoy the following key features:

* **Real-Time Transaction Information**
  * Transactions are updated in real time - no page refresh is required. Infinite scrolling is also enabled.
* **Token Information**
  * Users can track various tokens issued on the blockchain, view token balances, and explore token transfer history.
* **Address Details**
  * This includes transaction history, token balances, and interactions with smart contracts.
* **Search Functionality**
  * The search feature simplifies finding specific transactions, blocks, or addresses by allowing users to input keywords or specific identifiers.
* **Network Statistics**
  * Users can access data related to the overall health and performance of the blockchain network, including transaction throughput, mining difficulty, and network hash rate.
* [**Smart Contract Insights and Interaction**](#smart-contracts)
  * Users can read, write and verify contracts, as well as take a deeper dive into the contract's source code, transaction history, token data, and more.&#x20;

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F5q9tm93f46X0FicuPYAD%2Ftransaction_details_dark.png?alt=media&amp;token=948d4802-491e-4d65-9d69-925ae36d0ed9" alt=""><figcaption></figcaption></figure>

#### **Transaction Details**

* Hash
* Status
* Block
* Timestamps
* Sender/Recipient Addresses
* Value
* Gas Fees

***

### Smart Contracts

Another great feature wrapped inside of this advanced explorer is smart contract analysis and interaction. Once the user has deployed a smart contract to their active StealthTest environment, they can open up the advanced explorer, find their contract, and explore all data associated with it. These features make it a powerful tool for both developers and users interested in exploring and interacting with smart contracts on a blockchain.

#### Key Features

* **Transactions**
  * Users can explore the complete transaction history for each contract, detailing inputs, outputs, transaction type, and status.
* **Token Transfers**
  * This provides a record of all token transfers executed via the smart contract, pertaining to transactions of ERC-20 or ERC-721 tokens.
* **Tokens**
  * Viewable list of tokens, including net worth, balance and filtering by token standards.
* **Internal Transactions**
  * Recorded secondary transactions initiated and executed between smart contracts.
* **Coin Balance History**
  * Coin balance is intuitively displayed using graphical visualization, providing more insight into transaction trends and block details.
* **Logs**
  * There are detailed logs as well, pulling transaction data, which can aid developers and users in tracking contract events.
* **Contract**
  * The contract section adds more visibility into the code itself, including creation bytecode and deployed bytecode, thus providing the ability to 'Verify & Publish'

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FL27gPoM317MudiUnPE4B%2Fcontract-details-dark.png?alt=media&amp;token=54491421-4bd0-4b72-898d-21cdf5830861" alt=""><figcaption></figcaption></figure>

***

Overall, our advanced block explorer serves as an indispensable tool for blockchain enthusiasts, researchers, developers, and anyone seeking to gain a deeper understanding of the blockchain's activities and functionalities. Its advanced features and user-friendly interface make it a fundamental part of the blockchain ecosystem.

{% hint style="info" %}
If you'd like to learn more about our advanced block explorer, powered by <img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F9ZbXAZwF5ZujM4P744Pl%2Fblockscout_logo.png?alt=media&amp;token=8adf8506-b2e8-4082-a0d6-6687dadc84ab" alt="" data-size="line">, please check out the documentation [here](https://docs.blockscout.com/).
{% endhint %}


# Test Wallets

Understanding network specific test wallets

Each private environment, and specifically each network within that environment, will include a set of pre-funded test wallets that will allow you to interact with the services.&#x20;

#### **PLEASE NOTE THE FOLLOWING:**

{% hint style="danger" %}
These accounts, and their private keys, are publicly known. Any funds sent to them on Mainnet or any other live network WILL BE LOST. Please only use these for development purposes.&#x20;
{% endhint %}

Now that we got that out of the way, let's dive deeper into the wallets:

You will be provided a set of five pre-funded test wallets, each preloaded with 100 test tokens. These test tokens are specific to your private environment and more importantly the specific network (chain ID).

**What does this mean?**

* In the same way that you can not use real ETH when connected to a public testnet (such as Goerli) or vice versa, the environment-specific test tokens will only be available for the specific private environments and networks they were generated for.&#x20;

These wallets can be accessed from the **Environments** page by opening up your preferred environment and clicking the tab labeled **Wallets**. You may also access these wallets quickly on any **Environment Dashboard** page.

**How do I access the private key to import my test wallets?**

* From the **Environments Dashboard**, scroll down to **Wallets** and click the **Key icon** to instantly copy the specific wallet's private key that you wish to import.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FsyCWEiXLP2Xr4k6foS2N%2Fwallet-dashboard.jpg?alt=media&amp;token=e04156d2-026e-417e-be5b-16ccd16e1599" alt=""><figcaption><p>Wallets page</p></figcaption></figure>

* Select the **Wallets** tab within the selected **Environment**, navigate to the specific wallet you wish to import and copy the private key by clicking the **Key icon** next to the wallet's balance.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FyaIilEwQWkBSAjAq3oJJ%2Fkey.jpg?alt=media&amp;token=1c4455d2-967b-4025-b2a6-674bb10610c1" alt=""><figcaption><p>Wallets via Environments page</p></figcaption></figure>

### **Ready to get testing? 🧪 Check out our guides on importing wallets.**

<details>

<summary><a data-mention href="/stealthtest-guides/test-wallet-import">Test Wallet Import</a></summary>

[Metamask Wallet Import](/stealthtest-guides/test-wallet-import/metamask-wallet-import)

</details>


# Teams & User Roles

A brief overview of teams and user roles within your StealthTest account

Users will be able to collaborate on projects and access shared environments in real time through **teams.** Teams feature three types of users: Owners, Admins, and Members, each with varying levels of access and control (roles are discussed further below).

StealthTest offers two unique plan options: Personal and Teams. Users will need to select a Teams plan in order to create a team and make use of all the features available with our new plan structure. After creating the team, the owner can now construct environments, invite new members, and assign user roles.

{% hint style="info" %}
To learn more about our new plans, including the pricing details for each plan level, be sure to check out our [pricing page](https://www.google.com/url?q=https://www.nameless.io/pricing\&sa=D\&source=editors\&ust=1683006832680022\&usg=AOvVaw31v6I2YI4OJ0Yw5gK6sa2B).
{% endhint %}

Users can quickly switch between accounts and choose which one they want to work with. This allows users to separate their personal and team data, with all data retained within each individual account. Users can switch between personal and team accounts, and even work on numerous team accounts at the same time, making it simple to manage and organize data according to their needs.

### Role-Based Access Control

<table><thead><tr><th width="194"> </th><th align="center">Owner</th><th align="center">Admin</th><th align="center">Member</th></tr></thead><tbody><tr><td>Team Management</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td></tr><tr><td>User Management</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td></tr><tr><td>Billing Access</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td></tr><tr><td>Team Deletion</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td></tr><tr><td>Create ENVs</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td></tr><tr><td>Delete ENVs</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td></tr><tr><td>Read-Only</td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="274c">❌</span></td><td align="center"><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td></tr></tbody></table>

* **Team Management**
  * Edit team name and URL
* **User Management**
  * Invite users&#x20;
  * Remove users
  * Assign roles
* **Billing Access**
  * Change subscription
  * Edit/Remove payment method
* **Read-Only**
  * Users cannot create or delete environments. They can only access environment information such as the RPC URL, chain ID, and wallet information.&#x20;
  * This user may also access the Logs and Faucet.&#x20;

### Now let's walk you through [how to create a team](broken://pages/Xj6kvxYEBBqA7ryrEFg8) :person\_running:


# How to Create a Team

A step-by-step guide for creating and accessing a team in StealthTest.

## How to Create a Team

1. To get started, select the **New Team** button in the sub-drawer menu from account select. Or you can click the **+** button in the accounts **View All** page.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F9i0iwwjiiLZ658zEAcyn%2Fteams-1.jpg?alt=media&amp;token=2e85c4af-576f-444e-8e86-650836473f0b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FSG2OStCffJdB61BCgsB0%2Fteams-2.jpg?alt=media&amp;token=e4cdb689-1b22-46eb-a0fb-669b37f7481e" alt=""><figcaption></figcaption></figure>

2. In the pop-out overlay, enter the team name. This will automatically generate a URL for the team in parallel.<br>

   <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F75A6Ydkd9vW56uufMhzn%2Fcreate%20team%20overlay.png?alt=media&amp;token=d93bf841-44ad-4071-9864-4da8c348e2cb" alt=""><figcaption><p>Create Team Overlay</p></figcaption></figure>
3. Next, you'll be prompted to enter your credit card details in order to subscribe to a Team plan.<br>

   <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FC4xRic3DCRsLxY9cdfJE%2Fteam%20checkout.png?alt=media&amp;token=18d1efc9-12ad-4c95-a137-6d25ac1550ff" alt=""><figcaption><p>Team checkout form</p></figcaption></figure>
4. Once you've successfully entered your credit card details, select **Create Team Plan**, and your team is now created!<br>

   <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FNWY7VYIKlxUCF5kBKjjn%2Fteams.jpg?alt=media&amp;token=66a105a6-19c1-490a-8f7d-12b8602a55c4" alt=""><figcaption></figcaption></figure>

That's all! You can quickly build your team and begin collaborating with just a few simple steps.&#x20;

After you've created the team, you'll be able to access the Team's Profile page and the Members page by selecting the new Team tile. From the Members page, you can easily invite new team members by entering an email address and clicking the **Send** button.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FIS1d98nztsibCttMdXEb%2Fmembers.jpg?alt=media&amp;token=82a7505e-f5d1-4930-8d9b-c16e924cd3c6" alt=""><figcaption><p>Member Management</p></figcaption></figure>


# Smart Contract Repository

A look into StealthTest's repository of smart contracts

### Overview

StealthTest now offers a repository of popular smart contracts ready for immediate deployment to your StealthTest environment. Choose from a growing collection of verified contracts and protocols, such as ERC-20, Uniswap, and Chainlink. With just one click, users can deploy these contracts, accessible both from the environment Dashboard and the Contracts page.

{% hint style="info" %}
*Verified* refers to source code verification, which is the process of matching the contract's source code to it's on-chain bytecode, ensuring transparency and security.&#x20;
{% endhint %}

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FnsDGmYfgBRxEnBCChDBd%2Frepo_shot.png?alt=media&amp;token=650e6e4b-b94b-4a67-9b1e-71601a8e3045" alt=""><figcaption><p>Contract Repository</p></figcaption></figure>

### Deployment

Deployment is truly as easy as the click of a button. Select 'DEPLOY' and our system will handle the rest. Once the contract has successfully deployed, it will show up in your list of deployed contracts on the Dashboard.&#x20;

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2Ffpaxn0twR8qmMY1iJKXB%2Fdeployed_list.png?alt=media&amp;token=7db94107-1963-4017-935b-c16118bc2e99" alt=""><figcaption><p>Dashboard Post-Deployment</p></figcaption></figure>

{% hint style="info" %}
Users are not limited to our repository for contract deployment. They can deploy their own custom contract using their unique StealthTest RPC, and upon successful deployment, the contract will be listed within the Dashboard.&#x20;
{% endhint %}

### Contract Details View

Selecting any contract repository tile will bring up the Contract Details view. From there, users can view and copy contract details including source code, ABI, and bytecode.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FJDsWgekjvSHlT15dDRcA%2Fcontract_details_view.png?alt=media&amp;token=5e518c97-8b14-41be-ba7d-fc84ca2c535d" alt=""><figcaption><p>Contract Details View</p></figcaption></figure>

### Repository Details

<table data-full-width="false"><thead><tr><th width="161">Contract</th><th width="486">Description</th><th>Status</th></tr></thead><tbody><tr><td><strong>Stealth Token (ERC-20)</strong></td><td>Stealth Token is an ERC-20 coin that can be traded or burned. This is perfect for beginner DeFi developers interested in testing a coin launch without the need for configuration.</td><td><mark style="background-color:green;">ACTIVE</mark></td></tr><tr><td><strong>Uniswap</strong></td><td>UniswapV3Factory protocol allows users to create and manage Uniswap V3 liquidity pools. This is ideal for the advanced DeFi developer interested in building lending pools on top of Uniswap protocol. </td><td><mark style="background-color:green;">ACTIVE</mark></td></tr><tr><td><strong>Chainlink VRF</strong></td><td>Chainlink VRF provides cryptographically secure randomness for your smart contracts. A major use case for VRF is randomizing an NFT mint, so the next minted token can’t be predicted. This is also helpful in gaming and gambling applications where randomness is a large factor.</td><td><mark style="background-color:green;">ACTIVE</mark></td></tr><tr><td><strong>ERC-721</strong></td><td>ERC-721 is a standard template contract for creating non-fungible tokens on Ethereum. This contract is a blank slate, which allows the user to customize their NFT with any attributes they want, perfect for an NFT developer at the start of their journey. </td><td><mark style="color:orange;background-color:yellow;">COMING SOON</mark></td></tr></tbody></table>


# StealthTest API Reference Overview

Learn about our StealthTest API and how to access your API key

The StealthTest API is a RESTful API designed to enable a seamless approach to managing and interacting with private environments. It facilitates the creation and deletion of environments, funding of wallets, and retrieval of essential information, allowing for streamlined integration with your existing infrastructure and processes.

\
The API returns JSON responses and provides comprehensive error messages to facilitate understanding of any issues or requirements for a successful request. To begin utilizing the StealthTest API, follow the steps outlined below to activate the API for your account and generate an API key.

{% hint style="info" %}
**In order to enable the API and generate a key you must be an active Enterprise plan subscriber and the owner of your team.**
{% endhint %}

Below are some use cases for how you can use the StealthTest API

* Integrate StealthTest API into your CI/CD workflow, automate the [creation of environments](/stealthtest-api/api-reference/create-environment) when you need to test changes from your application and [delete it](/stealthtest-api/api-reference/delete-environment) when done.
* Run tests against specific environments, and use the StealthTest API to [retrieve environment details](/stealthtest-api/api-reference/get-environments) to target specific existing environments or new ones that are part of your test strategy.
* Extend existing internal tools, and use the StealthTest API to connect to internal tools that can deploy environments and manage them outside of StealthTest for non-technical folks. No longer do you have to have an account to log in and manually provision new environments!

### How to Access Your API Key

1. Log in to your StealthTest account and navigate to your Team.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FemgdQ9Cr1I4xUEnYwc3J%2Flogin.png?alt=media&amp;token=cc184103-0100-4195-91bd-a3fae1346871" alt=""><figcaption></figcaption></figure>

2. Select **Settings**, then **API** to enable API Access for your account. By default, API access is disabled.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FqOby6No8aJv6eiuFwXrD%2Fapi-3.jpg?alt=media&amp;token=c242b07a-4d8d-465d-8a4f-1b8e52e552ec" alt=""><figcaption></figcaption></figure>

3. Click the toggle button to enable API Access. Upon activation, the toggle will turn green and automatically generate a unique API Key that only the owner can access.

<div align="left"><figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FNBqFa4qgQ6ffa4lqHGXv%2Fapi-disabled.png?alt=media&amp;token=c00c9aa8-c40d-4d48-8bb9-a79eda339d8a" alt=""><figcaption><p>Before enabling API</p></figcaption></figure> <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FZ9JwpodPNU4ZmiCVbjuX%2Fapi-enabled.jpg?alt=media&amp;token=ebf5231e-0c9f-42bb-9e69-885318c3e26f" alt=""><figcaption><p>After enabling API</p></figcaption></figure></div>

4. The owner can reset the API Key at any time, which will immediately disable the previous key and generate a new key.&#x20;

{% hint style="info" %}
Disabling the API will also invalidate the existing key, which will be permanently deleted. For security purposes, each generated API Key is unique and never reused.
{% endhint %}

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FLT0ohYuMOHa4l8gobtoI%2Fapi-resetkey.jpg?alt=media&amp;token=3d5f1fd5-5656-4639-9485-748efc540213" alt=""><figcaption><p>You can click on the "Reset API Key" to get a new key or select the green toggle to disable the API altogether</p></figcaption></figure>

Once you have the API Key, click to copy it and share it with team members or others in your organization who require access.

#### Now, let's make our first API call! We'll use the [Get Environments](/stealthtest-api/api-reference/get-environments) endpoint to retrieve a list of active environments.

#### Or if you want to see more of the endpoints checkout - [StealthTest API Reference](/stealthtest-api/api-reference)

<br>


# API Reference

StealthTest API is built to allow organizations that want to integrate StealthTest into their workflows.

<table data-header-hidden><thead><tr><th>Environment Endpoints</th><th>Wallet Endpoints</th><th data-hidden></th></tr></thead><tbody><tr><td><a href="/stealthtest-api/api-reference/get-environments">Get Environment Info</a></td><td><a href="/stealthtest-api/api-reference/get-wallet-information">Get Wallet Information</a></td><td></td></tr><tr><td><a href="/stealthtest-api/api-reference/create-environment">Create Environment</a></td><td><a href="/stealthtest-api/api-reference/fund-wallet">Fund a Wallet</a></td><td></td></tr><tr><td><a href="/stealthtest-api/api-reference/delete-environment">Delete Environment</a></td><td></td><td></td></tr></tbody></table>


# Get Environments

Returns a list of environments running currently for your Team.

{% openapi src="/files/narQA6IP5KoNr5lZAYqq" path="/environments" method="get" expanded="true" %}
[openapi.yaml](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FJAxOpFVTri3uPZAk7PBm%2Fopenapi.yaml?alt=media\&token=6a9badf7-2980-4a8d-afe0-d0247c3f770f)
{% endopenapi %}

{% tabs %}
{% tab title="Request" %}

```bash
curl --request GET 'https://api.nameless.io/v1/environments' \
--header 'x-api-key: <Your API Key>' \
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Response" %}

```bash
{
    "success": true,
    "data": [
        {
            "id": "97SjFDpPjxgkex0sOGJZW",
            "accountId": "sodM22-OIixbRuajh8hE0",
            "createdAt": 1684489830333,
            "chainId": 1234,
            "accountType": "organization",
            "name": "Nameless",
            "namespace": "e7d831a4-df3a-433e-85fe-0b815bf63ec5",
            "accounts": {
                "ethereum": [
                    {
                        "privateKey": "0xf5d82a795ec5c5751161334378841e7a765182a047ee071bdfb1184f67b78d76",
                        "address": "0x4559b1771b1d7C1846d91a91335273C3a28f9395",
                        "initialBalance": "100"
                    },
                    {
                        "privateKey": "0x996491130195a3dea4d3bad7dc252606cf77087ee82e905d9ba6d1d1f3f4cc9b",
                        "address": "0x930efAd00Bbd2f22431eE3d9816D8246C0D45826",
                        "initialBalance": "100"
                    },
                    {
                        "privateKey": "0xa09635b236df9be3485f4e63e0f5797509208a12c184ef18f1e81c9e1d0ff02d",
                        "address": "0x2181b50636dFcA9AfB94E49946a10CF7b87325b7",
                        "initialBalance": "100"
                    },
                    {
                        "privateKey": "0xe017b5d8ea60fa0b7494dcdca8a88862226fbfa2632ea8766a3a5d77476eba09",
                        "address": "0xb33587dBe9c27B0EFdff481f3e22Cb1B7e76835c",
                        "initialBalance": "100"
                    },
                    {
                        "privateKey": "0xb216bc274c0cf3683bf2fdbf2821fbd6e5d4b27f303b858653e51c96a5d5ad70",
                        "address": "0x4F881A74C5c42Dc63c6c91938dE640486701263b",
                        "initialBalance": "100"
                    }
                ]
            },
            "status": "SUCCESS",
            "updatedAt": 1684489876513,
            "networks": {
                "ethereum": {
                    "url": "https://e7d831a4-df3a-433e-85fe-0b815bf63ec5.ethereum.nameless.io",
                    "status": "SUCCESS"
                }
            }
        }
    ],
    "message": "Successfully read Environments for Account ID sodM22-OIixbRuajh8hE0."
}
```

{% endtab %}
{% endtabs %}


# Get Environment

Returns a specific environment running currently for your Team.

{% openapi src="/files/HPab6lqWZdvSN8cRygQi" path="/environments/{environmentId}" method="get" expanded="true" %}
[openapi.yaml](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FDBg85cbfNoMxZ00OY9TH%2Fopenapi.yaml?alt=media\&token=5bce0c57-07fa-418e-9122-f9ecf8a3ac95)
{% endopenapi %}

{% tabs %}
{% tab title="Request" %}

```bash
curl --location --request GET 'https://api.nameless.io/v1/environments/{environmentId}' \
--header 'x-api-key: <YOUR API KEY>'
```

{% endtab %}

{% tab title="Response" %}

```bash
{
    "success": true,
    "data": {
        "id": "97SjFDpPjxgkex0sOGJZW",
        "accountId": "sodM22-OIixbRuajh8hE0",
        "createdAt": 1684489830333,
        "chainId": 1234,
        "accountType": "organization",
        "name": "Nameless",
        "namespace": "e7d831a4-df3a-433e-85fe-0b815bf63ec5",
        "accounts": {
            "ethereum": [
                {
                    "privateKey": "0xf5d82a795ec5c5751161334378841e7a765182a047ee071bdfb1184f67b78d76",
                    "address": "0x4559b1771b1d7C1846d91a91335273C3a28f9395",
                    "initialBalance": "100"
                },
                {
                    "privateKey": "0x996491130195a3dea4d3bad7dc252606cf77087ee82e905d9ba6d1d1f3f4cc9b",
                    "address": "0x930efAd00Bbd2f22431eE3d9816D8246C0D45826",
                    "initialBalance": "100"
                },
                {
                    "privateKey": "0xa09635b236df9be3485f4e63e0f5797509208a12c184ef18f1e81c9e1d0ff02d",
                    "address": "0x2181b50636dFcA9AfB94E49946a10CF7b87325b7",
                    "initialBalance": "100"
                },
                {
                    "privateKey": "0xe017b5d8ea60fa0b7494dcdca8a88862226fbfa2632ea8766a3a5d77476eba09",
                    "address": "0xb33587dBe9c27B0EFdff481f3e22Cb1B7e76835c",
                    "initialBalance": "100"
                },
                {
                    "privateKey": "0xb216bc274c0cf3683bf2fdbf2821fbd6e5d4b27f303b858653e51c96a5d5ad70",
                    "address": "0x4F881A74C5c42Dc63c6c91938dE640486701263b",
                    "initialBalance": "100"
                }
            ]
        },
        "status": "SUCCESS",
        "updatedAt": 1684489876513,
        "networks": {
            "ethereum": {
                "url": "https://e7d831a4-df3a-433e-85fe-0b815bf63ec5.ethereum.nameless.io",
                "status": "SUCCESS"
            }
        }
    }
}
```

{% endtab %}
{% endtabs %}


# Create Environment

Creates an environment for your team to access and use within seconds.

{% openapi src="/files/bUOs1p5l5nEp4CFHfD7D" path="/environments" method="post" expanded="true" %}
[openapi.yaml](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FsgEbcXj6JnvBeb5sjgWF%2Fopenapi.yaml?alt=media\&token=de346313-5525-4d2b-afed-cd63535b7c18)
{% endopenapi %}

{% tabs %}
{% tab title="Request" %}

```bash
curl --location --request POST 'https://api.nameless.io/v1/environments' \
--header 'x-api-key: <YOUR API KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Nameless",
    "networks": ["ethereum"],
    "chainId": 1234
}'
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": {
        "id": "asBkqVqynvkJddXNc0Oog",
        "accountId": "sodM22-OIixbRuajh8hE0",
        "createdAt": 1683114747172,
        "chainId": 1234,
        "accountType": "organization",
        "name": "Nameless",
        "namespace": "[namespace]",
        "accounts": {},
        "status": "PENDING",
        "networks": {
            "ethereum": {
                "url": "https://8543fc0f-121c-452f-9628-925dccc108d9.ethereum.nameless.io",
                "status": "PENDING"
            }
        }
    },
    "message": "Environment \"Nameless\" (asBkqVqynvkJddXNc0Oog) is being created...",
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Delete Environment

Deletes an existing environment that is currently running. This endpoint should be used after you are running tests in CI/CD, or want to shutdown specific environments that are no longer needed.

{% openapi src="/files/narQA6IP5KoNr5lZAYqq" path="/environments/{environmentId}" method="delete" expanded="true" %}
[openapi.yaml](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FJAxOpFVTri3uPZAk7PBm%2Fopenapi.yaml?alt=media\&token=6a9badf7-2980-4a8d-afe0-d0247c3f770f)
{% endopenapi %}

{% tabs %}
{% tab title="Request" %}

```bash
curl --request DELETE 'https://api.nameless.io/v1/environments/<Environment ID>' \
--header 'x-api-key: <Your API Key>'
--header 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": {
        "environmentId": "eMwAw0mCj2TwQJBQooWm-",
        "messageId": "NztiPlNkbmyKpCAyOobl",
        "message": "Successfully deleted Environment ID eMwAw0mCj2TwQJBQooWm-."
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Get Wallet Information

Requests wallet information for a given network. Returns the token balance, public address. Can be executed to validate when wallets are used for transactions and to confirm balances after.

{% openapi src="/files/xMC1ZcSKS9lLUIEMrJtX" path="/environments/{environmentId}/wallet/{{walletAddress}}?network={{network}}" method="get" expanded="true" %}
[openapi.yaml](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FWXWblMNgexPTTxkjXPBB%2Fopenapi.yaml?alt=media\&token=2fb916e3-385d-4d33-9f40-4d9e1320bcc8)
{% endopenapi %}

{% tabs %}
{% tab title="Request" %}

```bash
curl 'https://api.nameless.io/v1/environments/{environmentId}/wallet/{walletAddress}?network={network}
--header 'x-api-key: <Your API Key>' \
--header 'Content-Type: application/json'

```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": {
        "walletAddress": "0x4559b1771b1d7C1846d91a91335273C3a28f9395",
        "privateKey": "0xf5d82a795ec5c5751161334378841e7a765182a047ee071bdfb1184f67b78d76",
        "balance": "100",
        "rpcUrl": "https://e7d831a4-df3a-433e-85fe-0b815bf63ec5.ethereum.nameless.io"
    },
    "success": true
}
```

{% endtab %}
{% endtabs %}


# Fund Wallet

Funds a wallet on an existing network that you currently have running.

{% openapi src="/files/aziWD56FaGXr08BXG1QJ" path="/environments/{environmentId}/wallet/{{walletAddress}}?network={{network}}\&amount={{amount}}" method="post" expanded="true" %}
[openapi.yaml](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FD2w5NXjbDLlHpzlqBhsH%2Fopenapi.yaml?alt=media\&token=07efbdb7-5575-40f6-a6c2-fe0b8cd679d3)
{% endopenapi %}

{% tabs %}
{% tab title="Request" %}
{% code overflow="wrap" %}

```bash
curl --location --request POST 'https://api.nameless.io/v1/environments/{environmentId}/wallet/{walletAddrress}?network={network}&amount=10' \
--header 'x-api-key: <YOUR API KEY>'
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

```json
{
    "data": "C0gIeAO42WYjXR93g7fw",
    "message": "Adding 10 Eth to Wallet 0x4559b1771b1d7C1846d91a91335273C3a28f9395.",
    "success": true
}
```

{% endtab %}
{% endtabs %}


# API Management

StealthTest provides an easy way to manage your API Access. This ensures you never have to worry about how the API is being accessed

**Accessing the Settings:**

In Settings, you now have a new panel of options to control which endpoints in the API are available to the program or user accessing it.&#x20;

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FlAF98u3d9PKYl6SI7wVO%2FScreen%20Shot%202023-10-19%20at%206.03.37%20AM.png?alt=media&amp;token=ae91d38f-8561-4d7e-9116-c5ad586bd791" alt=""><figcaption></figcaption></figure>

&#x20;**Understanding Endpoint Control:**

Within the API permissions panel, you'll find a list of endpoints that the StealthTestAPI provides. Endpoints are specific URLs (or URIs) that StealthTest exposes for interaction.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FkX7OQKURgUDvtz0Cmpi9%2FScreen%20Shot%202023-10-19%20at%205.57.35%20AM.png?alt=media&amp;token=3bbdbe03-68ed-47d7-836a-73287384ee67" alt=""><figcaption></figcaption></figure>

**Controlling Endpoint Access:**

* **Immediate Updates:** Any changes made to endpoint access are applied immediately without the need to regenerate the API Key. This ensures that your modifications take effect promptly.
* **Minimum Endpoint Requirement:** It's mandatory to have at least 1 endpoint always available. This ensures that if the API key is active there is 1 available endpoint.
* **Disabling Endpoints:** If you wish to restrict access to specific functionalities, you can disable corresponding endpoints. Disabling an endpoint means that it won't be accessible to any program or user.

**Disabling the API Key (Optional):**

* **Complete Access Restriction:** If you want to completely disable API access, you can choose to disable the API Key. This action revokes all access privileges, rendering the API inaccessible until re-enabled.

**Best Practices for API Permission Management:**

* **Regular Review:** Periodically review your API endpoints and access controls. Ensure that the permissions align with your current security policies and requirements.
* **Least Privilege Principle:** Follow the principle of least privilege, granting only the permissions necessary for specific tasks. Avoid giving unnecessary access to endpoints.
* **Audit Trails (coming soon):** Maintain logs and audit trails for API permission changes. This helps in tracking modifications and understanding who made the changes and when.


# Connecting to StealthTest Networks

Collection of guides for connecting to your private test networks based on your preferred web3 wallet provider.

{% content-ref url="/pages/k408NeSdRnaGMu2VCoV1" %}
[Metamask](/stealthtest-guides/connecting-to-stealthtest-networks/metamask)
{% endcontent-ref %}

{% content-ref url="/pages/ur3onxhOBSkCysFG77qR" %}
[Coinbase Wallet](/stealthtest-guides/connecting-to-stealthtest-networks/coinbase-wallet)
{% endcontent-ref %}


# Metamask

A quick step-by-step guide for connecting your private Stealthtest network to Metamask

{% embed url="<https://www.loom.com/share/d5d79302e7ac4fb38d9f13e46a342753>" %}

### **Connecting to your private test network**

1. First, open Metamask and select the network dropdown (Ex: Ethereum Mainnet) where you will then click **Add Network**
2. Scroll to the bottom of the page where you will select **Add a Network manually**
3. Enter the following information in the empty fields&#x20;
   * Network Name --> This can be any name of your choosing
     * Ex: "My Test Network"
   * New RPC URL&#x20;
     * Ex: `https://24092de2-aa2a-410c-b22e-7d17500b3ca8.ethereum.nameless.io`
   * Chain ID --> The chain ID associated with your specific network
     * Ex: `123578`
   * Currency Symbol --> The currency symbol the wallet will use for the network's native currency
     * Ex: ETH
4. Click **Save**&#x20;

{% hint style="success" %}
**Congratulations!** You are now connected to your private StealthTest network. 🔥&#x20;
{% endhint %}

<div><figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FM9W6NvCAwKhoLYQa1KB6%2Fstep%201.png?alt=media&amp;token=48d6f6e7-e4fd-4cf6-a241-ed2d0852b1c3" alt=""><figcaption><p>Step 1</p></figcaption></figure> <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2F7pYAtEFDR6tJ8UZDpahV%2Fstep%202.png?alt=media&amp;token=31453760-e32a-48b7-84f4-a7edf433c968" alt=""><figcaption><p>Step 2</p></figcaption></figure> <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FU8TXfPXg4RxFAA5cegPP%2FScreenshot%202023-01-31%20at%202.49.19%20PM.png?alt=media&amp;token=a641ef1b-a3f3-4410-a872-d6eedf305d49" alt=""><figcaption><p>Step 3</p></figcaption></figure></div>


# Thirdweb

A quick step-by-step guide for adding your private Stealthtest network to your Thirdweb dashboard.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FSK2D7Fl6kX5gmOdk65sN%2FScreenshot%202023-07-20%20at%2010.22.42%20AM.png?alt=media&amp;token=13b390fe-504b-41f4-9db5-590087ec6218" alt=""><figcaption></figcaption></figure>

### **Connecting StealthTest to Thirdweb Dashboard**

1. First, you will need to be signed in to your [Thirdweb Dashboard](https://thirdweb.com/dashboard) using your preferred wallet.
2. Once your wallet is connected, you can navigate to the **RPC** tab at the top then select **Add Network**
3. Enter the following information in the empty fields&#x20;
   * Network Name --> This can be any name of your choosing
     * Ex: "My Test Network"
   * Network ID --> This will auto-populate with your preferred network name.&#x20;
     * This value is customizable.
   * Chain ID --> The chain ID associated with your specific network
     * Ex: `123578`
   * Currency Symbol --> The currency symbol the wallet will use for the network's native currency
     * Ex: ETH&#x20;
   * Network Type&#x20;
     * You can choose either *Mainnet* or *Testnet*
   * Icon --> This is an optional field if you would like to associate an image with your custom network
   * RPC URL --> Your unique StealthTest RPC URL
     * Ex: `https://24092de2-aa2a-410c-b22e-7d17500b3ca8.ethereum.nameless.io`
4. Click **Add Network**&#x20;

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FLBRe6pqC91WS69Ev7QFT%2FScreenshot%202023-07-20%20at%2010.26.07%20AM.png?alt=media&amp;token=b873711b-70a8-430b-b50c-51f0dc08200e" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Congratulations!** You may now use your private StealthTest network in Thirdweb 🔥&#x20;
{% endhint %}


# Coinbase Wallet

A quick step-by-step guide for connecting Coinbase Wallet to your private StealthTest network

{% embed url="<https://www.loom.com/share/adcdb38489b0410a910bbf1d55d2e75d>" %}

### **Connecting to your private StealthTest network**

1. First, open Coinbase Wallet and select the **Settings** from the bottom nav bar
2. Scroll down to **Networks**
3. To the right of where it says Networks, select the plus sign (**+)**
4. Enter the following information in the empty fields
   * Network Name --> This can be any name of your choosing
     * Ex: "My Test Network"
   * RPC URL --> This is the provider URL you get when you create a new environment
     * Ex: <https://24092de2-aa2a-410c-b22e-7d17500b3ca8.ethereum.nameless.io>
   * Chain ID --> The chain ID associated with your specific private test network
   * Currency Symbol --> The currency symbol the wallet will use for the network's native currency
5. Click **Save**
6. When you navigate back to **Networks** under the Settings page
7. Under **Custom**, you'll now see "My Test Network".

{% hint style="success" %}
**Congratulations!** You are now connected to your private StealthTest network. 🔥&#x20;
{% endhint %}


# Test Wallet Import

Collection of guides for how to import a specific type of test wallet into popular solutions.

{% content-ref url="/pages/HJq8oSRVegqYwyMj8Fku" %}
[Metamask Wallet Import](/stealthtest-guides/test-wallet-import/metamask-wallet-import)
{% endcontent-ref %}


# Metamask Wallet Import

Importing your Ethereum and Polygon wallets.

### Importing a test wallet into Metamask

{% hint style="info" %}
Please review the [Wallets & Faucet](/features-and-fundamentals/test-wallets) section for more information on test wallets and how to fund your own wallet.
{% endhint %}

1. Choose the top right of MetaMask to open the Account dropdown then select **Import Wallet**
2. Enter the private key to one of your test wallets associated with your own StealthTest environment and click **Import**
3. Upon saving, the wallet will be ready for testing.
4. Make sure to have your new wallet selected by clicking the top right circle and choosing the correct address, if it's not already selected.

{% hint style="success" %}
**Congratulations!** You have successfully imported your test wallet. **🔥**&#x20;
{% endhint %}

![Import Screen on Metamask](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2Fxcm29ivAxalUGnwiPvdp%2FScreen%20Shot%202022-03-15%20at%201.40.23%20PM.png?alt=media\&token=1a5316a3-dc30-43df-9f62-79514d3ac4ac)


# Testing with Remix

A step-by-step guide showing how to configure and deploy a simple smart contract to your private StealthTest environment.

{% hint style="warning" %}
Please note that this guide is meant to serve as a simple way of testing against your newly deployed private EVM or EVM-compatible test network. It is not a detailed integration guide.&#x20;
{% endhint %}

#### Before you begin, please make sure to [add your private network and wallet](/stealthtest-guides/connecting-to-stealthtest-networks/metamask) to Metamask.

#### Quick Smart Contract Deploy & Test

{% hint style="info" %}
**Click** [**this link**](https://remix.ethereum.org/?#code=Ly9TUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogVW5saWNlbnNlCnByYWdtYSBzb2xpZGl0eSBeMC44LjA7Cgpjb250cmFjdCBHcmVldGVyIHsKICAgIHN0cmluZyBwcml2YXRlIGdyZWV0aW5nOwoKICAgIGNvbnN0cnVjdG9yKHN0cmluZyBtZW1vcnkgX2dyZWV0aW5nKSB7CiAgICAgICAgZ3JlZXRpbmcgPSBfZ3JlZXRpbmc7CiAgICB9CgogICAgZnVuY3Rpb24gZ3JlZXQoKSBwdWJsaWMgdmlldyByZXR1cm5zIChzdHJpbmcgbWVtb3J5KSB7CiAgICAgICAgcmV0dXJuIGdyZWV0aW5nOwogICAgfQoKICAgIGZ1bmN0aW9uIHNldEdyZWV0aW5nKHN0cmluZyBtZW1vcnkgX2dyZWV0aW5nKSBwdWJsaWMgewogICAgICAgIGdyZWV0aW5nID0gX2dyZWV0aW5nOwogICAgfQp9Cg\&optimize=false\&runs=200\&evmVersion=null\&version=soljson-v0.8.7+commit.e28d00a7.js) which takes you to Remix with a boilerplate contract loaded up. You do not need to be familiar with Remix but if you want to learn more about it, read [here](https://remix-ide.readthedocs.io/en/latest/).
{% endhint %}

1. Click the button titled **Solidity Compiler** on the side navigation bar
2. Click **Compile**
3. Navigate to the **Deploy and Run Transactions** on the side navigation bar
4. Open the **Environment** dropdown and select `Injected Provider - Metamask`. Directly below that field, you should see `Custom ##### network` where the number is replaced with the chain ID for your private network
5. Verify that the wallet address you are using for testing shows up under the **Account** dropdown
6. Verify that the **Contract** dropdown is displaying the `Greeter` contract
7. Navigate to the `string_greeting` text box and enter a message of your choice (Ex: Hello!) then click **Deploy.** The Metamask extension should open up with a prompt to confirm the transaction.&#x20;
8. Once your contract is deployed, you should see the new contract and address under **Deployed Contracts.** Then expand the contract to reveal the supported functions.&#x20;
9. Click `greet` and you should see your custom message appear directly below

{% hint style="success" %}
Congratulations! You have successfully deployed a simple smart contract to your own private EVM or EVM compatible test network on StealthTest!
{% endhint %}

![](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FS5yus5Kf2d79PasMmeZu%2FETH%20guide%201.png?alt=media\&token=4b6cabf2-a0ec-49a0-b18c-fbf202f5dabd)

![](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FcbhIOHDIRPfbpkHly2hA%2FETH%20docs%202.png?alt=media\&token=da2ae79d-7c97-498e-ba0e-265268ded586)

![](https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FF31Zx3PWjQpnCm2Ttvge%2FETH%20guide%203.png?alt=media\&token=d8fe4087-41cc-4cd3-be9f-8eb5781af506)


# Testing with Truffle

A step-by-step guide for creating a Truffle project and deploying it to your private StealthTest environment.

**Before you begin, please make sure to** [**create your StealthTest environment**](https://app.nameless.io/login) **and have access to the RPC URL and chain ID.**&#x20;

This document is intended to act as a quick-start integration guide for new Truffle projects. If you already have an established Truffle project, skip to step 3.

For more information on Truffle, please access the documentation here: [Truffle documentation](https://trufflesuite.com/docs/truffle/)

{% hint style="danger" %}
**We will never ask you for your private key, nor will it ever be required at&#x20;*****any*****&#x20;step in the process of creating a StealthTest environment.**
{% endhint %}

1. **Install Truffle**
   1. `npm install -g truffle`
2. **Create a new Truffle project**
   1. `truffle unbox metacoin truffle-tutorial`
   2. This is an example project that creates a new token called `MetaCoin`
   3. Important directories include
      1. `contracts/`: Directory for Solidity contracts
      2. `migrations/`: Directory for scriptable deployment files
      3. `test/`: Directory for test files for testing your application and contracts
      4. `truffle-config.js`: Truffle configuration file
      5. Output from creating your new Truffle project:

{% code overflow="wrap" %}

```
truffle unbox metacoin truffle-tutorial
Starting unbox...
✓ Preparing to download box ✓ Downloading ✓ Cleaning up temporary files ✓ Setting up box
Unbox successful, sweet!
Commands:
Compile contracts: truffle compile
Migrate contracts: truffle migrate
Test contracts: truffle test
```

{% endcode %}

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FfDdCp3mwfod9XbGJKaSQ%2FScreen%20Shot%202023-05-02%20at%2011.46.05%20AM.png?alt=media&amp;token=58c0ec9d-aa2a-40cc-8ecc-4bd5f9b7480c" alt=""><figcaption><p>Your new Truffle project will have the above file structure</p></figcaption></figure>

3. **Ensure your contracts are working properly by running the test suite**
   1. `truffle test`
   2. Output from successful tests

{% code overflow="wrap" %}

```
TestMetaCoin
  ✔ testInitialBalanceUsingDeployedContract
  ✔ testInitialBalanceWithNewMetaCoin

Contract: MetaCoin
  ✔ should put 10000 MetaCoin in the first account
  ✔ should call a function that depends on a linked library
  ✔ should send coin correctly (52ms)ode
```

{% endcode %}

4. **Compile your contracts**
   1. `truffle compile`

```
Compiling your contracts...
===========================
> Compiling ./contracts/ConvertLib.sol
> Compiling ./contracts/MetaCoin.sol
> Artifacts written to /workspace/truffle-tutorial/build/contracts
> Compiled successfully using:
   - solc: 0.8.13+commit.abaa5c0e.Emscripten.clang
```

5. **Configure your Truffle project**
   1. `npm i @truffle/hdwallet-provider`
   2. Using your StealthTest URL, update `truffle-config.js`
      1. `*` will match any network ID
      2. Use any private key provided by StealthTest and remove the 0x prefix.
      3. **Note:** Each StealthTest environment comes with 5 pre-funded wallets, but please **never use these on mainnet**. You may also quickly fund your own wallet with our [Faucet](/features-and-fundamentals/faucet) but please **never share your private key with us or anyone you don't know.**&#x20;
   3. Example `truffle-config.js` below

{% code overflow="wrap" %}

```
const HDWalletProvider = require("@truffle/hdwallet-provider");
const privateKey = "996491130195a3dea4d3bad7dc252606cf77087ee82e905d9ba6d1d1f3f4cc9b"; // Remove 0x prefix

module.exports = {
  networks: {
    development: {
     provider: function() {
      return new HDWalletProvider(privateKey, "https://18d22e6b-3d6f-4d6a-9ca3-32c135ee98a4.ethereum.staging-42.nameless.io");
    },
     network_id: "*",
    },
  },
  compilers: {
    solc: {
      version: "0.8.13",
    }
  }
};
```

{% endcode %}

6. **Deploy your contracts**
   1. `truffle migrate`
   2. Contract addresses will be output in the console.

```
Starting migrations...
======================
> Network name:    'development'
> Network id:      148073
> Block gas limit: 30000000 (0x1c9c380)


1_deploy_contracts.js
=====================

   Replacing 'ConvertLib'
   ----------------------
   > transaction hash:    0xb87152784dc8c9a1e6727ab9b0cde8abc9d6be55dc2151ff928dd614a3bb29d2
   > Blocks: 0            Seconds: 4
   > contract address:    0x253fADFDbc3356B85332FFcBFdD148DefF854f30
   > block number:        491
   > block timestamp:     1683048102
   > account:             0xe2E6Eb5BcCBC10Fe7cE002E4b91D709250139b8F
   > balance:             904625697166532776746648320380374280103671755200316906058.258445736816203202
   > gas used:            157568 (0x26780)
   > gas price:           2.500000007 gwei
   > value sent:          0 ETH
   > total cost:          0.000393920001102976 ETH


   Linking
   -------
   * Contract: MetaCoin <--> Library: ConvertLib (at address: 0x253fADFDbc3356B85332FFcBFdD148DefF854f30)

   Replacing 'MetaCoin'
   --------------------
   > transaction hash:    0x6e99bb6ea33efa49b5b1a357d321e115aa4b2ba27513795e66eaa6c5b78bdadf
   > Blocks: 0            Seconds: 8
   > contract address:    0x33ef020f130c5dC023b85340D4826e56aC069762
   > block number:        492
   > block timestamp:     1683048114
   > account:             0xe2E6Eb5BcCBC10Fe7cE002E4b91D709250139b8F
   > balance:             904625697166532776746648320380374280103671755200316906058.257404251813287044
   > gas used:            416594 (0x65b52)
   > gas price:           2.500000007 gwei
   > value sent:          0 ETH
   > total cost:          0.001041485002916158 ETH

   > Saving artifacts
   -------------------------------------
   > Total cost:     0.001435405004019134 ETH

Summary
=======
> Total deployments:   2
> Final cost:          0.001435405004019134 ETH 
```

### And that's it! You're now testing in private using StealthTest! :muscle:


# Testing with Hardhat

A step-by-step guide for creating a Hardhat project and deploying it to your private StealthTest environment.

**Before you begin, please make sure to** [**create your StealthTest environment**](https://app.nameless.io/login) **and have access to the RPC URL and chain ID.**&#x20;

This document is intended to act as a quick start integration guide for new Hardhat projects. If you already have an established Hardhat project, skip to step 3.

For more information on Hardhat please access the documentation here: [Hardhat documentation](https://hardhat.org/hardhat-runner/docs/getting-started)

{% hint style="danger" %}
**We will never ask you for your private key, nor will it ever be required at&#x20;*****any*****&#x20;step in the process of creating a StealthTest environment.**
{% endhint %}

1. **Create a new Hardhat project.**

   1. `npm init -y`
   2. `npm install --save-dev hardhat`
   3. `npx hardhat`
   4. You will be provided with a default project containing: a smart contract, tests, and a deploy script.

   <figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FYL11gdmS2n6GghhWqOkN%2Fimage.png?alt=media&amp;token=a1a2ef7a-711f-4a93-99e8-649d78016ee6" alt=""><figcaption><p><em>Here is what you will see when creating your project</em></p></figcaption></figure>
2. **Compile your contracts**
   1. Contracts are located at `./contracts`
   2. `npx hardhat compile`
3. **Configure your Hardhat project for StealthTest**
   1. Within your `hardhat.config.js`
   2. Add an object called `networks`
   3. Inside that object, create an entry for `stealthtest`
   4. Add the `url`, `chainId`, and a list of `accounts` private keys you would like to use.
      1. **Note:** Each StealthTest environment comes with 5 pre-funded wallets, but please **never use these on mainnet**. You may also quickly fund your own wallet with our [Faucet](/features-and-fundamentals/faucet) but please **never share your private key with us or anyone you don't know.**&#x20;
   5. As an option, you can add `stealthtest` as your `defaultNetwork` so it will always be used.

:brain: **Example** `hardhat.config.js`&#x20;

```javascript
require("@nomicfoundation/hardhat-toolbox");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: "0.8.18",
  defaultNetwork: "stealthtest",
  networks: {
    stealthtest: {
      url: "https://5937ec2d-1c79-41b8-a5d1-c288e0e2efc7.ethereum.staging-42.nameless.io",
      chainId: 148073,
      accounts: ["0xf5d82a795ec5c5751161334378841e7a765182a047ee071bdfb1184f67b78d76"],
    },
  },
};

```

4. **Deploy your contracts**
   1. `npx hardhat run scripts/deploy.js`
   2. `stealthtest` is your `defaultNetwork`, so your deployment(s) will be sent there

### And that's it! You're now testing in private using StealthTest! :muscle:


# Testing with Brownie

A step-by-step guide for creating a Brownie project and deploying it to your private StealthTest environment.

**Before you begin, please make sure to** [**create your StealthTest environment**](https://app.nameless.io/login) **and have access to the RPC URL and chain ID.**&#x20;

This document is intended to act as a quick start integration guide for new Brownie projects. If you already have an established Brownie project, skip to step 3.

For more information on Hardhat please access the documentation here:[ Brownie documentation](https://eth-brownie.readthedocs.io/en/stable/)

{% hint style="danger" %}
**We will never ask you for your private key, nor will it ever be required to create a StealthTest environment.**
{% endhint %}

1. **Install Brownie.**
   1. `python3 -m pip install --user pipx`
   2. `python3 -m pipx ensurepath`
   3. `pipx install eth-brownie`
   4. Run the command `brownie` to ensure the installation was successful.

```
user % brownie
Brownie v1.19.3 - Python development framework for Ethereum

Usage:  brownie <command> [<args>...] [options <args>]

Commands:
  init               Initialize a new brownie project
  bake               Initialize from a brownie-mix template
  pm                 Install and manage external packages
  compile            Compile the contract source files
  console            Load the console
  test               Run test cases in the tests/ folder
  run                Run a script in the scripts/ folder
  accounts           Manage local accounts
  networks           Manage network settings
  gui                Load the GUI to view opcodes and test coverage
  analyze            Find security vulnerabilities using the MythX API

Options:
  --help -h          Display this message
  --version          Show version and exit

Type 'brownie <command> --help' for specific options and more information about
each command.
```

2. **Create a new Brownie project.**
   1. Create a new directory for your project: `mkdir my-brownie-project`
   2. Initialize your new project, we'll start from an ERC-20 template by running `brownie bake-token`
   3. You'll now have a folder called `token`, navigate there to compile your contracts.

```
my-brownie-project % cd token
token % ls
LICENSE			contracts		scripts
README.md		interfaces		tests
brownie-config.yaml	reports
build			requirements.txt
```

3. **Compile your contracts**
   1. Contracts are located at `./contracts`
   2. `brownie compile`

```
token % brownie compile
Brownie v1.19.3 - Python development framework for Ethereum

Compiling contracts...
  Solc version: 0.6.12
  Optimizer: Enabled  Runs: 200
  EVM Version: Istanbul
Generating build data...
 - SafeMath
 - Token

Project has been compiled. Build artifacts saved at /Users/stealthtestuser/my-brownie-project/token/build/contracts
```

4. **Configure your project for StealthTest**
   1. Add StealthTest RPC URL and ChainID as a new network

```
brownie networks add Ethereum stealthtest-eth host=https://<namespace>.ethereum.nameless.io chainid=12345
```

5. **Deploy your contract to StealthTest**
   1. Run the following command:

<pre><code><strong>token % brownie run token.py --network stealthtest-eth
</strong>Brownie v1.19.3 - Python development framework for Ethereum

TokenProject is the active project.

Running 'scripts/token.py::main'...
Transaction sent: 0xa862fd95830279bb09d1599ee08433f9e66fc481e39fbfd3866ecfafc18f6a20
  Gas price: 40.0 gwei   Gas limit: 573532   Nonce: 5
  Token.constructor confirmed   Block: 110   Gas used: 521393 (90.91%)
  Token deployed at: 0xB5f03cAb4f294096940B7bb0097B034a05D0e1f5
</code></pre>

### And that's it! You're now testing in private using StealthTest! :muscle:


# Testing with Web3.js + Cypress

A step-by-step guide for creating an E2E automation project and using your private StealthTest environment.

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FX2FbsoHqI1REeVlr1fce%2FScreen%20Shot%202023-08-18%20at%208.32.50%20AM.png?alt=media&amp;token=bd1f9792-2aba-4342-9633-700d5394122b" alt=""><figcaption></figcaption></figure>

**Before you begin, please make sure to**[ **create your StealthTest environment**](https://app.nameless.io/login) **and have access to the RPC URL and chain ID.**

{% hint style="warning" %}
This document is intended to act as a guide on how to implement a strategy with Web3.js , Cypress, and Synpress for automation projects. It is not an out-of-the-box implementation of the frameworks. These frameworks change weekly and everyone is different in regards to how they approach writing tests.&#x20;
{% endhint %}

For more information on Web3.js please access the documentation here: [web3.js documentation](https://web3js.readthedocs.io/en/v1.10.0/)

## Framework Overview

There are multiple tools available for use with web3.js that, when used together, create an excellent framework for interacting with dapps and ensuring successful end-to-end (E2E) tests. Some of the tools we will be using are :

[Synpress](https://github.com/Synthetixio/synpress)

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FsmsVXtdKaJnNziXPD3nT%2Fimage.png?alt=media&amp;token=92dbf0e1-ea58-473d-9a80-6e1812f25fd1" alt=""><figcaption><p>“<a href="https://github.com/Synthetixio/synpress">Synpress</a> is E2E testing framework based on <a href="https://www.cypress.io/">Cypress</a> and <a href="https://playwright.dev/">Playwright</a> with support for <a href="https://metamask.io/">MetaMask</a>.”</p></figcaption></figure>

\
Synpress is an excellent tool for interacting with Metamask during automated tests. It effectively ensures compatibility between the latest version of Metamask and the framework, thereby guaranteeing stable and reliable test results.

[Cypress](https://www.cypress.io/)

<figure><img src="https://2391062109-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftln9hCx1JKXPoGd1FusM%2Fuploads%2FwszZfjkIc1navd6DmNHu%2FScreen%20Shot%202023-09-22%20at%2012.11.40%20PM.png?alt=media&amp;token=78392501-c970-4c1f-8285-c972de82d9e1" alt=""><figcaption><p>“Cypress is a very popular automation framework that can be used to test anything that runs in a browser.”</p></figcaption></figure>

\
Cypress is highly focused on E2E testing, as well as Component Testing, and is widely regarded as the standard for all E2E testing nowadays. It boasts impressive speed and power, offering a comprehensive set of tools to build resilient automation frameworks.

### **Overview**

Now that we have examined some of the frameworks and tools at our disposal, let's discuss the possibilities that arise when we utilize them collectively.

Cypress will be the primary framework we'll be using, coupled with Synpress and web3.js.\
\
Cypress will be used to open a browser and act as if it is a user interacting with the Daap.\
\
Then, a transaction will be triggered using a Metamask wallet. The triggering of the Metamask wallet will be facilitated by a helper provided by Synpress. Subsequently, the transaction will be confirmed with the wallet, and we will utilize web3.js to directly validate with the blockchain that the transaction was successful.

\
At this point, you might be thinking:&#x20;

* ***“Well, can’t I just trust my Dapp, to ensure the transaction was successful?”***&#x20;

In web3, blockchains function as independent services or databases that manage themselves. While you can interact with a blockchain, particularly testnets, you cannot directly control their state to guarantee the proper functioning of your Daap.

This is where StealthTest comes to the rescue.&#x20;

With StealthTest, you can execute tests in isolation without concerns about exposing transactions, smart contracts, and other sensitive data when testing on a Testnet.

StealthTest also offers a faucet that provides unlimited tokens for each running environment. This enables you to repeatedly simulate transactions and different scenarios without concerns about costs and waiting time for testing.

### Getting Started

**Prerequisites:**

1\. Node.js and npm installed (<https://nodejs.org/>).

2\. Familiarity with Ethereum, smart contracts, and basic JavaScript.

**Step 1: Set Up Your Project:**

1\. Create a new directory for your project and navigate to it in your terminal.

2\. Run `npm init` to initialize your project and follow the prompts.

3\. Install the required dependencies:

```bash
   npm install cypress web3 @synthetixio/synpress@3.7.1
```

* OR you can jumpstart by checking out the code here: <https://github.com/synpress-io/synpress-examples/>

**Step 2: Configure Synpress:**

1\. Create a `synpress.config.js` file in your project directory.

2\. Configure Synpress by specifying the Ethereum network you want to use for testing. You can also set up a local blockchain for testing using Ganache.

```javascript
   module.exports = {
     networks: {
       development: {
         provider: new Web3.providers.HttpProvider('http://localhost:8545'),
         accounts: {
           mnemonic: 'your mnemonic here', // Use a mnemonic for your test accounts
         },
       },
     },
   };

```

**Step 3: Write Cypress Tests:**

1\. Create a `cypress` directory in your project root.

2\. Inside the `cypress` directory, create a `integration` folder to hold your test files.

3\. Write Cypress tests using Web3.js and Synpress within your test files.

* For example, create a test file named `sample-test.js`:

```javascript
 describe("connect wallet spec", () => {
  beforeEach(() => {
    cy.visit("/");
  });

  afterEach(() => {
    cy.disconnectMetamaskWalletFromAllDapps();
    cy.resetMetamaskAccount();
  });

  it("should connect wallet with success", () => {
    cy.get("#connectButton").click();
    cy.acceptMetamaskAccess();
    cy.get("#accounts").should(
      "have.text",
      "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
    );
  });

  it("import private key and connect wallet using imported metamask account", () => {
    cy.importMetamaskAccount(
      "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97"
    );
    cy.get("#connectButton").click();
    cy.acceptMetamaskAccess();
    cy.get("#accounts").should(
      "have.text",
      "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f"
    );
  });
});

   // Perform interactions and assertions
   
   //Get current balance of wallet
  web3.eth.getBalance(address, (err, wei) => { balance = web3.utils.fromWei(wei, 'ether') }).then(console.log)
       });
     });
   });

  //Perform 
```

This is just one of the ways you can confirm the balance from the blockchain. You can make this test cleaner by putting it in its own file and calling it from the test, vs. having all the code within the spec file for Cypress. \
\
This will allow you to keep the web3.js code and Cypress/Synpress logic separated and more maintainable.

**Step 4: Run Your Tests:**

1\. Ensure you have the SteathTest environment running or make sure you're connected to the desired Ethereum network.

2\. In your terminal, run the following command to start the Cypress test runner:

```
   npx cypress open
```

3\. Click on the `sample-test.js` file in the Cypress test runner to run your test.

After the test has finished running, you now have a way to validate not only from your web dapp that things are working visually, but you can confirm it directly with the blockchain. <br>


