CARV 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 21쪽 중 17쪽

-nodes/how-to-purchase-nodes) **Participation Options:** * [Try delegation](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/delegation-tutorial) * [Operate your own node](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node) # Prerequisites In this tutorial, we will guide you through creating a new test wallet. We'll use MetaMask as an example, but feel free to use any wallet of your choice. ## Create a wallet #### **Step 1 - Install the wallet plugin of your choice.** MetaMask: <https://metamask.io/download/> OKX: <https://www.okx.com/help/use-the-okx-wallet-web-extension-to-easily-play-stader> WalletConnect: <https://walletconnect.com/> #### **Step 2 - Create a test wallet** Follow the instruction to create a wallet For guidance on setting up a MetaMask wallet, visit the [MetaMask Getting Started Guide](https://support.metamask.io/getting-started/getting-started-with-metamask/). Once you complete the setup, you should be able to view the details of your wallet in MetaMask. <figure><img src="https://758822945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6A1MZN6YkMg4U1B64H4g%2Fuploads%2FSHfiCZ5amcN5SIkThpIz%2Fimage.png?alt=media&amp;token=1cf57616-3960-461d-b31d-6db5fba232a1" alt=""><figcaption><p>Create a new MetaMask wallet</p></figcaption></figure> ## Own a Verifier License NFT Please refer to [How to Purchase Nodes](/carv-ecosystem/verifier-nodes/how-to-purchase-nodes). # Delegation Tutorial ## Video Tutorial {% embed url="<https://youtu.be/RYbQ1mG8Ou8>" %} ## Quick Start Before you begin the delegation process, please ensure that you have created a wallet and received a Verifier License NFT. If you do not have one yet, visit [this ](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/prerequisites)page to complete the necessary prerequisites. ### Delegate License&#x20; Once you're ready, you can proceed to <https://explorer.carv.io/verifiers>. Here, you can delegate your License in one of the two ways: 1. Choose a verifier from the list and click 'Delegate' next to the verifier. <figure><img src="https://758822945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6A1MZN6YkMg4U1B64H4g%2Fuploads%2Fe6JrohRjIWnqLsYnklGY%2Fimage.png?alt=media&amp;token=6ad1190d-dc8c-4d18-bfc7-5c59518570e6" alt=""><figcaption></figcaption></figure> 2. If you know the address of the Verifier Node you'd like to delegate to, click 'Delegate My License'. <div align="left"><figure><img src="https://758822945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6A1MZN6YkMg4U1B64H4g%2Fuploads%2FOO0LmI5HJsRmeNyyGxTS%2Fimage.png?alt=media&amp;token=1d962d84-b2a7-49f0-914e-347e2c8c2b39" alt=""><figcaption></figcaption></figure></div> Enter the address of the Verifier. <div align="left"><figure><img src="https://758822945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6A1MZN6YkMg4U1B64H4g%2Fuploads%2FKs63YberHtG80vdx2afL%2Fimage.png?alt=media&amp;token=e379de0e-ccd8-4fb7-81e5-524b630e0119" alt="" width="375"><figcaption></figcaption></figure></div> Then confirm the delegate address and sign the transaction in your wallet. Note you need to pay for the gas for this transaction. ### Manage Delegation If you'd like to revoke your delegation. You can do so in `My Delegates` and click `Revoke` next to the delegate. <figure><img src="https://758822945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6A1MZN6YkMg4U1B64H4g%2Fuploads%2F35ybMc9mPo8b6a4lFuzO%2Fimage.png?alt=media&amp;token=7a3a82ea-0c61-47bc-a6c7-47fe7cf3817c" alt=""><figcaption></figcaption></figure> # Operating a Verifier Node If you prefer not to delegate your node (See [Delegation](/carv-ecosystem/verifier-nodes/delegation)), there are several ways you can operate your own CARV nodes: 1. **Verifier Client CLI**: You can run the nodes on your own machine by downloading the appropriate software for your operating system. By keeping the software running for at least 6 hours per day, you can earn your expected rewards. (See [Running in CLI](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli)) 2. **Verifier Client App**: We offer a browser version of the verifier nodes. By running the verifiers in your browser and keeping it open, you can generate rewards without needing to download any software. This solution is convenient and works on any OS, including mobile devices, as long as the browser remains active. (See [Running in Desktop App](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-desktop-app)) 3. **Virtual Private Servers (VPS)**: If you have difficulty keeping your node up and running on your local environment, you can use a VPS, such as AWS, Ali Cloud, or Google Cloud. A VPS provides a managed execution environment, allowing you to keep your node operational 24/7. Note that using a VPS may incur additional fees and require manual management of the installed software. (See [Running in VPS](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-vps)) 4. **Node-as-a-Service (NaaS)**: NaaS providers handle everything for you, including setup, deployment, and management. Here are some official CARV NaaS partners: * [Animoca](https://www.animocabrands.com/) * [Easeflow](https://easeflow.io/) * [Infstones](https://infstones.com/) * [Nodeops](https://console.nodeops.xyz/) * [BwareLabs](https://blastapi.io/node-as-a-service) * [Knidos](https://www.knidos.xyz/) * [Rapidnode](https://www.rapidnode.xyz/) * [Lugasnode](https://luganodes.com/) * [Nodeterminal](https://www.nodeterminal.com/) For more detail comparison, please see: <table><thead><tr><th width="123">Method</th><th>Description</th><th width="179">Requirements</th><th width="180">Convenience</th><th>Cost</th></tr></thead><tbody><tr><td><a href="/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli"><strong>Desktop Software</strong></a></td><td>Run nodes on your own machine with downloaded software.</td><td>Download software, run for 6 hours daily.</td><td>Low: Requires continuous operation.</td><td>Low: No additional cost.</td></tr><tr><td><a href="/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-desktop-app"><strong>Browser Version</strong></a></td><td>Run verifier nodes in your browser.</td><td>Open and active browser.</td><td>Moderate: No download, works on any OS.</td><td>Low: No additional cost.</td></tr><tr><td><strong>Virtual Private Server (VPS)</strong></td><td>Use a VPS to keep your node running continuously.</td><td>VPS account, manage software on VPS.</td><td>Moderate: Requires setup and management.</td><td>Medium: VPS fees apply.</td></tr><tr><td><strong>Node-as-a-Service (NaaS)</strong></td><td>Third-party service handles setup, deployment, and management.</td><td>NaaS subscription.</td><td>High: Fully managed service.</td><td>Medium: NaaS subscription fees.</td></tr></tbody></table> {% hint style="info" %} Note that all methods mentioned above guarantee the same rewards for each license you operate. If you have multiple licenses, you can delegate all of them to a single node operated by yourself. However, the more reliable your node is, the higher the possibility of receiving delegations from the community. {% endhint %} # Running in VPS {% hint style="info" %} This content is generated by our community. CARV does not recommend using any services listed in this tutorial. Please conduct your own research as needed. {% endhint %} Credit to [DEPINspirationHUB](https://medium.com/@depinspirationhub?source=post_page-----31bead81ad07--------------------------------) for helping with the VPS tutorial. {% embed url="<https://www.youtube.com/watch?v=IOfMcILu6uA>" %} Set up CARV node on Linux VPS {% endembed %} Medium post: <https://medium.com/@depinspirationhub/carv-node-setup-on-linux-vps-alphanet-31bead81ad07> # Running in CLI ## Hardware Requirements **Minimum:** * CPU with 1+ cores * 2GB RAM * 4 MBit/sec download Internet service **Recommended:** * Fast CPU with 2+ cores * 4GB+ RAM * 8+ MBit/sec download Internet service {% hint style="info" %} The verifier node does not need a static IP address or open ports. {% endhint %} {% hint style="info" %} The verifier node does not require significant storage capacity. The minimum storage needed is merely for the software and its configuration, which should be less than 100MB. {% endhint %} #### **Running in Desktop App** You can operate your nodes on any OS by using the Desktop App. Check [Running in Desktop App](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-desktop-app)for more details. #### **Starting with Source Code** If you prefer to start with the source code, you can choose one of the following methods: * [Using Source Code](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli/using-source-code) * [Using Docker](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli/using-docker) # Using Source Code {% hint style="info" %} Note that the configuration may change while testing. Please check this page consistently for operation info. {% endhint %} #### Before you start The verifier is written in Golang. Before you start, you should make sure you have Golang installed correctly. For more details check: <https://go.dev/doc/install>. #### Clone the source code The verifier code is open source and currently in development. You can clone the GitHub repository and build the source: <https://github.com/carv-protocol/verifier>. <pre class="language-bash"><code class="lang-bash"><strong>git clone https://github.com/carv-protocol/verifier.git &#x26;&#x26; \ </strong><strong>cd verifier &#x26;&#x26; \ </strong><strong>make build </strong></code></pre> **Run via binary program** After executing `make build` or `make all`, the verifier executable file will be compiled into the `./bin` directory. You need to switch to the `./bin` directory before executing verifier. run ``` cd bin ``` If this is your first time running verifier, you need to specify a private key. The private key will sign the verification transaction. {% hint style="info" %} **Never expose your main account's private key. Always generate a brand new private key for operating the node, otherwise generate a new one using the \`**&#x67;enerate-keystor&#x65;**\` command below.** {% endhint %} The private key can be passed to the verifier through startup parameters, or written into the configuration file. **Through startup parameters** If you already have a brand new private key generated, you can start your node with the command below. {% hint style="info" %} The private key can be any brand new private key. If the key doesn't hold the CARV node license, you need to go to <https://explorer.carv.io/verifiers> to delegate your license to this new key. {% endhint %} {% hint style="info" %} Commission rate can be set between 0-10. 0 means you don't take any commission from delegators. 10 means you take 10% of the rewards from delegators. {% endhint %} ``` # Pass the pre-generated private key in clear text ./verifier -private-key <Your Private Key> -reward-address <Your Reward Address> -commission-rate <Your Commission Rate> # By specifying keystore ./verifier -keystore-path <Path to keystore file> -keystore-password <keystore password> -reward-address <Your Reward Address> -commission-rate <Your Commission Rate> ``` In order to facilitate user operation, verifier provides a tool to generate a new keystore, run ``` ./verifier -generate-keystore -keystore-path <path to generate your keystore file> ``` After running the command, you will be prompted to enter a password for the keystore. After entering the password, the keystore file will be generated in the specified path. And then you can run the verifier with the keystore file path and password before you delegate to the keystore address. {% hint style="info" %} Same for Keystore. Before you run the verifier, you must delegate to the keystore address. After the delegation is successful, you can run the verifier again. Delegated address you can get from the terminal after generating the keystore. You can delegate your License through the explorer <https://explorer.carv.io/verifiers>. {% endhint %} **Through configuration file** If you prefer to config your own parameters, including RPC url, private key mode, etc. you can operate your node using config file, check details below: 1. Set `wallet.mode` in the configuration file (`../configs/config.yaml`) to `1`, 2. Write the plain text private key into `wallet.private_key`, 3. Write your reward address into `wallet.reward_claimer_addr`, 4. Write your commission rate into `wallet.commission_rate`. Then run ``` ./verifier -conf ../configs/config.yaml ``` Configure the path and password of the keystore: 1. Set `wallet.mode` in the configuration file (`../configs/config.yaml`) to `2`, 2. Write the path and password of the keystore file into `wallet.keystore_path` 3. Write the keystore password into `wallet.keystore_password`. 4. Write your reward address into `wallet.reward_claimer_addr`, 5. Write your commission rate into `wallet.commission_rate`. Then run ``` ./verifier -conf ../configs/config.yaml ``` # Using Docker {% hint style="info" %} Note that the configuration may change while testing. Please check this page consistently for operation info. {% endhint %} One of the quickest ways to run verifier is by using Docker: ## Use Private Key (mode = 0) **Update config\_docker.yaml** Update your private\_key and run : ``` wallet: # wallet mode, by which way to pass the private key # 0: through startup parameters # 1: through plain text private key in config file # 2: through path and password of the keystore in config file mode: 0 # plain text private key, needed when mode is 1 private_key: "99a038e9d345d0b12130b3b1fb003bf8f2d3a5c27ce2a800bbb1608efff6c591" # path of the keystore, needed when mode is 2 keystore_path: "" # password of the keystore, needed when mode is 2 keystore_password: "" ``` ``` docker run -d --name verifier -v /<Path To This Repository>/verifier/configs:/data/conf -v /<Path To Keystore direction>:/data/keystore carvprotocol/verifier:mainnet ``` ## **Use Keystore (mode = 2)** > If you want to use keystore, you need to generate a keystore file first. You can use the following command to generate a keystore file. ``` ./verifier -generate-keystore -keystore-path <path to generate your keystore file> ``` After running the command, you can run verifier by following the steps below. **update config\_docker.yaml** Update your keystore\_path and keystore\_password and run : ``` wallet: # wallet mode, by which way to pass the private key # 0: through startup parameters # 1: through plain text private key in config file # 2: through path and password of the keystore in config file mode: 2 # plain text private key, needed when mode is 1 private_key: "" # path of the keystore, needed when mode is 2 keystore_path: "/data/conf/xxxx/UTC--2021-09-29T07-00-00.000000000Z--xxxx" # password of the keystore, needed when mode is 2 keystore_password: "123456" ``` ``` docker run -d --name verifier -v /<Path To This Repository>/verifier/configs:/data/conf -v /<Path To Keystore direction>:/data/keystore carvprotocol/verifier:mainnet ``` #### Example Config ```` ```yaml chain: chain_id: 42161 chain_name: "arbitrum" rpc_url: "https://arb1.arbitrum.io/rpc" start_block: 0 offset_block: 14400 # arbitrum block time: 0.25 sec. An offset of 14400 starts fetching blocks from 1 hours ago. max_block_per_query: 500 query_ticker: 5 # second report_delay: 30 # second enable_gas_mode: false # default: false contract: addr: "0xa91fF8b606BA57D8c6638Dd8CF3FC7eB15a9c634" tee_addr: "0x8A5614d82187BAa01FB004D5adAcC86992543e67" topic1: "0x89a3b784b99180438f3b2027aa89e97c3c3ed66e8dc78a555d7013b39caf1a89" topic2: "0x455929120054502ca2ea8194b26e7bb3acb631d30177f6881ffa70581abd4a13" topic3: "0x8a0859fa4a2e331800d512db6925d210facda82733207cb9fe49e7da954fc4aa" #wallet: ## wallet mode, by which way to pass the private key ## 0: through startup parameters ## 1: through plain text private key in config file ## 2: through path and password of the keystore in config file # mode: 1 # private_key: "99a038e9d345d0b12130b3b1fb003bf8f2d3a5c27ce2a800bbb1608efff6c591" # keystore_path: "" # keystore_password: "" # reward_claimer_addr: "0x689d0b32Da0480095b7AE7b604f1b1997736B3F9" # commission_rate: 100 wallet: mode: 2 private_key: "" keystore_path: "./keystore/UTC--2024-06-25T12-01-01.663731000Z--031cff11b035aa5f5189f163c1fc937bf0be235c" keystore_password: "123456" reward_claimer_addr: "0x689d0b32Da0480095b7AE7b604f1b1997736B3F9" commission_rate: 100 signature: domain_name: "ProtocolService" domain_version: "1.0.0" expired_time: 3600 gasless_service: url: "https://interface.carv.io" version: "1.0.0" ```` # Gasless Server API To minimize node operating costs, CARV offers official endpoints that assist node operators in batching operations and posting them on-chain. While gasless transactions still necessitate user signatures for specific operations, CARV ensures endpoint availability. However, if you are concerned about risks, you also have the option to independently send transactions to the smart contract. **Base URLs: <https://interface.carv.io>** ### Message Construction To make sure the gasless server still guarantee the authorization from the original node operater, it adopts the [EIP-712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) standard to proof authorization through the signature. For more details of message structure: <https://github.com/carv-protocol/verifier/blob/main/internal/worker/signature_server.go> Example config: [Using Docker](/carv-ecosystem/verifier-nodes/join-mainnet-verifier-nodes/operating-a-verifier-node/running-in-cli/using-docker#example-config) ### POST ExplorerSendTxNodeEnter `POST /explorer/send_tx_node_enter` #### Message structure (Golang) ```json typedData := apitypes.TypedData{ Types: apitypes.Types{ "EIP712Domain": { { Name: "name", Type: "string", }, { Name: "version", Type: "string", }, { Name: "chainId", Type: "uint256", }, }, "NodeEnterData": { { Name: "replacedNode", Type: "address", }, { Name: "expiredAt", Type: "uint256", }, }, }, PrimaryType: "NodeEnterData", Domain: apitypes.TypedDataDomain{ Name: c.cf.Signature.DomainName, Version: c.cf.Signature.DomainVersion, ChainId: (*math.HexOrDecimal256)(big.NewInt(c.cf.Chain.ChainId)), }, Message: apitypes.TypedDataMessage{ "replacedNode": replacedNode.String(), "expiredAt": expiredAt, }, } ``` #### Body Parameters ```json { "signer": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B", "replaced_node": "0xb1878c4d1BAAbbB6abba3d77836cC85A80D5753B", "expired_at": 1000000000, "v": 27, "r": "ac0b5874f37c40838a33663da72cf90629a0164f98d7785736cc3fd96abeec67", "s": "10ba15d823cd831ef4061d474cc42d66933c6e45c2865b6d9c5f3646a2599b55", "version": "1.0.0" } ``` #### Params <table><thead><tr><th width="156">Name</th><th width="114">Location</th><th width="103">Type</th><th width="105">Required</th><th>Description</th></tr></thead><tbody><tr><td>Origin</td><td>header</td><td>string</td><td>yes</td><td></td></tr><tr><td>User-Agent</td><td>header</td><td>string</td><td>yes</td><td></td></tr><tr><td>x-app-id</td><td>header</td><td>string</td><td>yes</td><td></td></tr><tr><td>» signer</td><td>body</td><td>string</td><td>yes</td><td></td></tr><tr><td>» replaced_node</td><td>body</td><td>string</td><td>yes</td><td>The node to replace. There are 2000 active node limit. To join th
프로젝트로 돌아가기