|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | + |
| 5 | +import Admonition from '@theme-original/Admonition'; |
| 6 | + |
| 7 | +# Getting Started |
| 8 | +This section will guide you through the necessary steps to set up and get started with the Devnet environment. By following these instructions, you'll be able to quickly configure your Devnet and start building data applications on Powerloom. |
| 9 | + |
| 10 | +## Minting the Devnet Slot |
| 11 | +To get started with Devnet, you'll need to mint a no-cost NFT slot on the Sepolia network. |
| 12 | + |
| 13 | +<Admonition type="tip" icon="📢" title="Ethereum Sepolia Faucet"> |
| 14 | +To mint the NFT slot, ETH on the Sepolia network is required. If your balance is insufficient, you can obtain Sepolia ETH through the following link: https://faucet.quicknode.com/drip |
| 15 | +</Admonition> |
| 16 | + |
| 17 | +Follow these steps: |
| 18 | + |
| 19 | +1. Visit https://devnet-mint.powerloom.dev to begin the minting process. You will be prompted to connect your wallet that contains Sepolia ETH. |
| 20 | + |
| 21 | +2. Click mint to being the minting process after connecting your wallet. |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +3. Once the NFT slot is minted, use one of the following options to locate your minted Slot ID for later use in the node setup. |
| 26 | + - Navigate to the [Devnet Dashboard](https://devnet-mint.powerloom.dev/dashboard) to see a list of your minted slots. |
| 27 | + |
| 28 | +  |
| 29 | + |
| 30 | + - Search for the transaction hash of your NFT mint on the [Sepolia block explorer](https://sepolia.etherscan.io/). |
| 31 | + - For Metamask: The transaction will be under the `Activity` section. |
| 32 | + - For other wallets: Search for your wallet address in the Sepolia block explorer and the mint will be the latest transaction. |
| 33 | + - Locate the minted Token ID under the `ERC-1155 Tokens Transferred` section. |
| 34 | + |
| 35 | +  |
| 36 | + |
| 37 | +After completing these steps, you'll be ready to start using Devnet. The next step is to configure and run our snapshotter node. |
| 38 | + |
| 39 | +## Setting up the Snapshotter Node |
| 40 | +A snapshotter peer, as part of the Powerloom Protocol, does exactly what the name suggests: It synchronizes with other snapshotter peers over a smart contract running on the Powerloom Prost chain. |
| 41 | + |
| 42 | +Whether you are developing your own application or extending our existing use cases, setting up your Snapshotter node is a crucial step. |
| 43 | + |
| 44 | + |
| 45 | +:::tip |
| 46 | +Here are some important topics you may want to check out: |
| 47 | +- [Understanding Epoch](../../Protocol/Specifications/Epoch.md) |
| 48 | +- [What are Data markets](../../Protocol/data-sources.md) |
| 49 | +- [Snapshotter Node Architecture](../snapshotter-node/architecture.md) |
| 50 | +- [Data Composition](../../Protocol/data-composition.md) |
| 51 | +::: |
| 52 | + |
| 53 | +### System Requirements |
| 54 | + |
| 55 | +- **RAM**: At least 4 GB. |
| 56 | +- **CPU Core**: Minimum of 2 Cores |
| 57 | +- **Disk Space**: A minimum of 40 GB. |
| 58 | +- **Python**: Ensure Python 3.11 is installed. |
| 59 | +- **Docker**: Latest version of `docker` (`>= 20.10.21`) and `docker-compose` (`>= v2.13.0`). If your system doesn't have docker installed, please follow the guide [here](https://www.baeldung.com/ops/docker-install-windows-linux-mac). |
| 60 | +- **RPC URL** URL for `Ethereum mainnet` or the chain you're working on. |
| 61 | + |
| 62 | +:::tip |
| 63 | +Your RPC usage depends on your specific use case. If your application requires a high volume of RPC calls, we recommend running your own RPC node to avoid potentially expensive third-party service costs. |
| 64 | + |
| 65 | +If you want to monitor your RPC usage, we recommend signing up with a provider like Alchemy, Infura or Quicknode. |
| 66 | +::: |
| 67 | + |
| 68 | +### Running the Snapshotter Node |
| 69 | +Follow the process outlined below to ensure a smooth setup |
| 70 | + |
| 71 | +#### Step 1: Clone the Snapshotter Deploy Repository |
| 72 | + |
| 73 | +Clone the repository against the respective branch (main by default). Open the terminal and run the below command to clone the deploy repo in a directory named `powerloom-deploy`. |
| 74 | + |
| 75 | +```bash |
| 76 | +git clone https://github.com/PowerLoom/deploy.git --single-branch powerloom_deploy --branch devnet && cd powerloom_deploy |
| 77 | +``` |
| 78 | + |
| 79 | +#### Step 2: Fork the Snapshotter Computes and Snapshotter Config Repositories |
| 80 | + |
| 81 | +Our system leverages the Git submodule architecture to seamlessly manage these components. To dive deeper into how these elements integrate and function within our larger system, check out the [architecture documentation](https://docs.powerloom.io/docs/build-with-powerloom/snapshotter-node/architecture). |
| 82 | + |
| 83 | +To optimize the development process, we recommend forking the templates for: |
| 84 | + |
| 85 | +- Snapshotter Configs: https://github.com/PowerLoom/snapshotter-configs |
| 86 | +- Snapshotter Computes: https://github.com/PowerLoom/snapshotter-computes |
| 87 | + |
| 88 | +:::info |
| 89 | +When forking the repository, ensure that the *"Copy the main branch only" * option is left unchecked. This will allow you to clone all the branches associated with the repository, not just the main branch. |
| 90 | +::: |
| 91 | + |
| 92 | +Once you have forked the above repositories, next step is to clone them on your local system. |
| 93 | + |
| 94 | +```bash |
| 95 | +git clone https://github.com/<your_github_username>/snapshotter-computes |
| 96 | +``` |
| 97 | +```bash |
| 98 | +git clone https://github.com/<your_github_username>/snapshotter-configs |
| 99 | +``` |
| 100 | + |
| 101 | +#### Step 3: Configure the environment variables |
| 102 | + |
| 103 | +1. In the deploy repo's directory, create a new file named `.env`. |
| 104 | + |
| 105 | +2. Copy the contents of [`env.example`](https://github.com/PowerLoom/deploy/blob/devnet/env.example) to `.env`. |
| 106 | + |
| 107 | +3. Fill in the required variables in the `.env` file: |
| 108 | + |
| 109 | +- `SOURCE_RPC_URL`: The URL for Source RPC (Local node/Infura/Alchemy) service. |
| 110 | + |
| 111 | +- `SIGNER_ACCOUNT_ADDRESS`: The address of the signer account. This should be an unused "burner" address that does not need to have any token balance. You can create a new burner wallet from [our tool](https://devnet-mint.powerloom.dev/burner). During later steps, this address will be registered against the `SLOT_ID` on the `PROTOCOL_STATE_CONTRACT` that is set in this `.env`. |
| 112 | +- `SIGNER_ACCOUNT_PRIVATE_KEY`: The private key corresponding to the burner wallet addresss |
| 113 | +- `SNAPSHOT_CONFIG_REPO`: https://github.com/your-username/snapshotter-configs [Change the username to your GitHub profile to point to your forked snapshotter-configs repository.] |
| 114 | +- `SNAPSHOT_CONFIG_REPO_BRANCH`: Change to your own branch or use the `devnet` branch if you are getting started. |
| 115 | +- `SNAPSHOTTER_COMPUTE_REPO`: https://github.com/your-username/snapshotter-computes [Change the username to your GitHub profile to point to your forked snapshotter-computes repository.] |
| 116 | +- `SNAPSHOTTER_COMPUTE_REPO_BRANCH`: Change to your own branch or use the `devnet` branch if you are getting started. |
| 117 | +- `PROST_RPC_URL`: The URL for the Powerloom Protocol Chain RPC service. |
| 118 | +- `PROTOCOL_STATE_CONTRACT`: The contract address for the protocol state. |
| 119 | + |
| 120 | +:::note |
| 121 | +Currently, there are two variations of Protocol State Contracts available. One where [Epoch](../../Protocol/Specifications/Epoch.md) size is set to 1 and other where epoch size is set to 10 blocks. |
| 122 | + |
| 123 | +You can find the latest Epoch Contracts in the [example.env](https://github.com/PowerLoom/deploy/blob/devnet/env.example) file. |
| 124 | + |
| 125 | +This should allow developers to build and experiment with a variety of use cases. If you have any custom needs, reach out to the [team](https://discord.com/invite/powerloom) |
| 126 | +::: |
| 127 | + |
| 128 | +- `RELAYER_HOST`: The relayer URL for the Powerloom Protocol Chain. |
| 129 | +- `NAMESPACE`: The unique key used to identify your project namespace. |
| 130 | +- `POWERLOOM_REPORTING_URL`: The URL for reporting to PowerLoom. |
| 131 | +- `PROST_CHAIN_ID`: Enter the Devnet chain ID |
| 132 | +- `SLOT_ID`: Enter your Devnet Slot ID. [You can find the slotID by visiting the [Devnet Dashboard](https://devnet-mint.powerloom.dev/dashboard), or on the [Sepolia block explorer](https://sepolia.etherscan.io/) by searching for the transaction hash of your node mint] |
| 133 | + |
| 134 | +Optional variables: |
| 135 | + |
| 136 | +- `IPFS_URL`: The URL for the IPFS (InterPlanetary File System) service in HTTP(s) (e.g., `https://ipfs.infura.io:5001`) or multiaddr format (e.g., `/dns4/ipfs.infura.io/tcp/5001/https`). |
| 137 | +- `IPFS_API_KEY`: The API key for the IPFS service (if required). |
| 138 | +- `IPFS_API_SECRET`: The API secret for the IPFS service (if required). |
| 139 | +- `SLACK_REPORTING_URL`: The URL for reporting to Slack. |
| 140 | + |
| 141 | +#### Step 4: Set Up the Codebase |
| 142 | + |
| 143 | +Set up the codebase by running the `bootstrap.sh` command in the terminal: |
| 144 | + |
| 145 | +```bash |
| 146 | +bash bootstrap.sh |
| 147 | +``` |
| 148 | + |
| 149 | +:::info |
| 150 | +This is a one-time step that resets the codebase to the latest version of the branch. |
| 151 | +After completing this one-time setup, you'll be ready to dive into the codebase and start building amazing data applications! |
| 152 | +::: |
| 153 | + |
| 154 | +#### Step 5: |
| 155 | + |
| 156 | +Install the required dependencies using pip: |
| 157 | + |
| 158 | +```bash |
| 159 | +pip install -r requirements.txt |
| 160 | +``` |
| 161 | + |
| 162 | +#### Step 6: Run the Snapshotter Node |
| 163 | + |
| 164 | +Run the command |
| 165 | + |
| 166 | +```bash |
| 167 | +bash build.sh |
| 168 | +``` |
| 169 | + |
| 170 | +#### Step 7: Assign your Burner Wallet |
| 171 | + |
| 172 | +```bash |
| 173 | +Do you want to assign a burner wallet to a slot? (yes/no): |
| 174 | +``` |
| 175 | + |
| 176 | +Enter yes and then enter your burner wallet address when prompted. |
| 177 | +- This is the `SIGNER_ACCOUNT_ADDRESS` that was set during [Step 3](#step-3-configure-the-environment-variables). |
| 178 | + |
| 179 | + |
| 180 | +Next, you will be prompted to enter a private key: |
| 181 | + |
| 182 | +```bash |
| 183 | +To assign a burner wallet to a slot, you need to sign a message with the private key of the Account holding the slot. |
| 184 | +Private Key: |
| 185 | +``` |
| 186 | + |
| 187 | +- Please note that this is *not* asking for the private key to your burner wallet. |
| 188 | +- Enter the private key of the wallet [**used to mint** the devnet slot](#minting-the-devnet-slot). |
| 189 | + |
| 190 | +### Troubleshooting Errors |
| 191 | + |
| 192 | +If the `.env` file is filled up correctly, all services will execute one by one. |
| 193 | + |
| 194 | + If you see the following error: |
| 195 | + |
| 196 | + ```bash |
| 197 | + powerloom_depoy-pooler-1 | Snapshotter identity check failed on protocol smart contract |
| 198 | + powerloom_depoy-pooler-1 exited with code 1 |
| 199 | +``` |
| 200 | + |
| 201 | +Make sure your snapshotter address is registered. Ensure that you have minted the Devnet Slot from the [devnet dashboard](https://mint-devnet.powerloom.network) and your burner wallet has been added correctly during Step 6. |
| 202 | + |
| 203 | +Refer to our [troubleshooting section](../../build-with-powerloom/snapshotter-node/full-node/troubleshooting.md) if you encounter any other issues with your node. |
| 204 | + |
| 205 | +### Stopping the Node |
| 206 | + |
| 207 | +1. To shutdown services, press `Ctrl+C` (and again to force). |
| 208 | + |
| 209 | +2. If you encounter issues with data, you can do a clean **reset** by running the following command before restarting from [Step 5](#step-5-run-the-snapshotter-node): |
| 210 | + |
| 211 | +```bash |
| 212 | +docker-compose --profile ipfs down --volumes |
| 213 | +``` |
| 214 | + |
| 215 | +--- |
| 216 | + |
| 217 | +## Quick Links |
| 218 | +- [Protocol Overview](../../category/protocol-overview) |
| 219 | +- [Use Cases](../../category/use-cases) |
| 220 | +- [Discord Support](https://discord.com/invite/powerloom) |
0 commit comments