BounceBit 백서

BounceBit

원문

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

3a521bac188bb14b1ee573f475baaa9fcf93@34.124.209.175:26656,9a648107c68081f85cc5ca6614aaef9061e3ce86@35.185.181.242:26656,f72890ab6ade55f6f705b5c4addcd5fedc0c9c15@34.87.108.66:26656" ``` ### Config ( Optional ) <mark style="color:red;">If you want to run an archived node , we recommend simply using the following settings.</mark> **app.toml** ```bash pruning = "nothing" ``` **config.toml** ```bash indexer = "kv" ``` <mark style="color:red;">If you are running as a validator and seeking to save disk space, we recommend simply using the following settings.</mark> **app.toml** ```bash pruning = "custom" # These are applied if and only if the pruning strategy is custom. pruning-keep-recent = "100" pruning-interval = "10" ``` **config.toml** ```bash indexer = "null" ``` ### 🌈 Download <mark style="color:red;">`Latest Version`</mark> snapshot Download and check snapshot file ```bash wget -c -O bouncebit_archive_snapshot.tar.zst -c https://snapshots.bouncebit.io/bouncebit_archive_snapshot_$(curl -s https://snapshots.bouncebit.io/latest).tar.zst wget -c -O bouncebit_archive_snapshot.tar.zst.sha256sum -c https://snapshots.bouncebit.io/bouncebit_archive_snapshot_$(curl -s https://snapshots.bouncebit.io/latest).tar.zst.sha256sum # check sha256 sha256sum -c bouncebit_archive_snapshot.tar.zst.sha256sum sudo -u bouncebit bash -c "tar --use-compress-program='zstd --long=29' -xvf bouncebit_archive_snapshot.tar.zst -C /data/bouncebit" ``` Show the $WORKSPACE ```bash ├── bin │ ├── bbcored │ └── checksum.txt ├── config │ ├── addrbook.json │ ├── app.toml │ ├── client.toml │ ├── config.toml │ ├── genesis.json │ ├── node_key.json │ └── priv_validator_key.json └── data ├── application.db ├── blockstore.db ├── cs.wal ├── evidence.db ├── evmindexer.db ├── priv_validator_state.json ├── snapshots ├── state.db └── tx_index.db ``` #### Running Node via systemd We recommend using Systemd to manage Bouncebit service and check logs. **Setting up systemd unit file** You can create a Systemd unit file at the following location `/etc/systemd/system/bouncebit.service`: ```bash sudo tee /etc/systemd/system/bouncebit.service <<EOF [Unit] Description=bouncebit node daemon After=network-online.target Wants=network-online.target data.mount Requires=data.mount [Service] ExecStart=/usr/local/bin/bbcored start \\ --log_format=json \\ --log_level=info \\ --home=/data/bouncebit Type=simple Restart=on-failure KillMode=process KillSignal=SIGINT TimeoutStartSec=infinity TimeoutStopSec=600 User=bouncebit Group=bouncebit CPUSchedulingPolicy=batch LimitNOFILE=524288 LimitNPROC=16384 MemoryMax=27G WorkingDirectory=/data/bouncebit EnvironmentFile=-/etc/bouncebit/bbcored.env # /run/bouncebit RuntimeDirectory=bouncebit RuntimeDirectoryMode=0700 # /etc/bouncebit ConfigurationDirectory=bouncebit ConfigurationDirectoryMode=0755 # /var/lib/bouncebit StateDirectory=bitcoind StateDirectoryMode=0710 SyslogIdentifier=bbcored # Provide a private /tmp and /var/tmp. PrivateTmp=true # Mount /usr, /boot/ and /etc read-only for the process. ProtectSystem=full # Deny access to /home, /root and /run/user ProtectHome=true # Disallow the process and all of its children to gain # new privileges through execve(). NoNewPrivileges=true # Use a new /dev namespace only populated with API pseudo devices # such as /dev/null, /dev/zero and /dev/random. PrivateDevices=true # Deny the creation of writable and executable memory mappings. MemoryDenyWriteExecute=true [Install] WantedBy=multi-user.target EOF ``` **Start the service** ```bash systemctl daemon-reload systemctl start bouncebit.service systemctl enable bouncebit.service ``` **View logs** ```bash journalctl -o cat -f -u bouncebit ``` ## Monitoring Monitor your Full node using the instructions at Logging, Tracing, Metrics, and Observability. The default metrics port is <mark style="color:red;">`26660`</mark>. To change the port, edit your config/config.toml file. ```bash prometheus = true # Address to listen for Prometheus collector(s) connections prometheus_listen_addr = ":26660" ``` # Cosmovisor ### Cosmovisor > Please refer to the Cosmovisor documentation for further information. <https://docs.cosmos.network/main/build/tooling/cosmovisor> > `cosmovisor` is a process manager for Cosmos SDK application binaries that automates application binary switch at chain upgrades. It polls the `upgrade-info.json` file that is created by the x/upgrade module at upgrade height, and then can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary. > > ‼️ > > If you have been running without using Cosmovisor for a while and are now preparing to use Cosmovisor, please note that you need to check if `upgrade-info.json` file exists under `WORKSPACE/data/` Please remove it during the initial run Cosmovisor. **To Install the latest version.** ```bash go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest ``` **Setup** ```bash cd $WORKSPACE mkdir -p cosmovisor/genesis/bin mkdir -p cosmovisor/upgrades cp bbcored cosmovisor/genesis/bin/ # copy current version of bbcored ``` **Systemd** `update -> /etc/systemd/system/bouncebit.service` ```bash [Unit] Description=Bouncebit Mainnet After=network-online.target [Service] Type=simple User=bouncebit ExecStart=cosmovisor run start --log_level info --home <WORKSPACE> --chain-id bouncebit_6001-1 --moniker <YOUR_NODE_NAME> KillMode=process Restart=on-failure RestartSec=3 Environment="DAEMON_HOME=<WORKSPACE>" # replace! Environment="DAEMON_NAME=bbcored" Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false" Environment="DAEMON_RESTART_AFTER_UPGRADE=true" Environment="UNSAFE_SKIP_BACKUP=true" [Install] WantedBy=multi-user.target ``` ```bash systemctl daemon-reload systemctl start bouncebit.service systemctl enable bouncebit.service ``` **When requested to upgrade to the new version.** ```bash cd $WORKSPACE # download the new bbcored (v1.5.0) mkdir -p cosmovisor/upgrades/v1.5.0/bin # replace version cp bbcored cosmovisor/upgrades/v1.5.0/bin/ ``` \<aside> ‼️ **Please ensure to use StateSync or Archive Snapshot to synchronize the mainnet node.** \</aside> #### StateSync > With state sync, your node will download and verify data only related to the head or near the head of the chain. Fetch the latest block height. ```bash curl -s <http://34.126.185.25:26657/block> | jq -r '.result.block.header.height' 224136 ``` Fetch the trust hash of the latest block height. ```bash curl -s "<http://34.126.185.25:26657/block?height=224136>" | jq -r '.result.block_id.hash' FC1E650D149713BF9AB0072C084CE4B7CAD0ABA503C32CD64F759651BB66A7C2 ``` Enable state-sync, add RPC servers **config.toml** ```bash [statesync] enable = true rpc_servers = "34.126.185.25:26657,35.247.178.93:26657" trust_height = 224136 trust_hash = "FC1E650D149713BF9AB0072C084CE4B7CAD0ABA503C32CD64F759651BB66A7C2" ``` **app.toml** ```bash [rosetta] enable = false ``` #### Archive Snapshot (pruning nothing) ✅ bouncebit\_archive\_snapshot\_2024\_12\_06.lz4 ```bash curl -o - -sL [<https://bouncebit-snapshot.s3.ap-southeast-1.amazonaws.com/>](<https://bouncebit-snapshot.s3.ap-southeast-1.amazonaws.com/bouncebit_archive_snapshot_2024-08-25.lz4>){{snapshot_file}} | lz4 -c -d - | tar -x -C $HOME ``` # Chain Info Below is data that you might need to add the network to your wallet: Mainnet Information: * Network Name: BounceBit Mainnet * RPC Url: [https://fullnode-mainnet.bouncebitapi.com/](https://fullnode-testnet.bouncebitapi.com/) * Chain ID: 6001 * Currency Symbol: BB * Block explorer URL: <https://bbscan.io/>&#x20; **Testnet Information:** * Network Name: BounceBit Testnet * RPC Url: <https://fullnode-testnet.bouncebitapi.com/> * Chain ID: 6000 * Currency Symbol: BB * Block explorer URL: <https://testnet.bbscan.io/>&#x20; Get your BB coins and BBTC Tokens from our Discord faucet: {% content-ref url="/pages/BQbMqXv5WOCODOE9U7Ms" %} [How to Use the Testnet Faucet](/user-guides/general/how-to-use-the-testnet-faucet) {% endcontent-ref %} # RPC Support Our partner Blockvision provides high-quality private RPCs at an affordable price. You can read more about it here: https\://docs.blockvision.org/reference/rate-limits-and-compute-units ## Rate Limits and Compute Units The illustration of what Compute Units are and how we use them. Compute Units are a measure of the total computing resources that your application uses on BlockVision. Some query interfaces are lightweight and fast (e.g. eth\_blockNumber), while others can be more complex and require more resources(e.g. eth\_call). Each method is assigned a certain number of computational units derived from the global average duration of each method. ### Pricing Plans | | | | | | | ---------------------- | ---------- | ----------- | ----------- | ------------- | | Price | $0/Month | $29/Month | $99/Month | $199/Month | | Compute Unit | 10,000,000 | 100,000,000 | 600,000,000 | 1,500,000,000 | | EVM Approx. Request | 400,000 | 4,000,000 | 24,000,000 | 60,000,000 | | Compute Units / Second | 300 | 500 | 1,000 | 2,000 | | Max App | 5 | 6 | 10 | 20 | | Development Toolkits | ☑️ | ☑️ | ☑️ | ☑️ | | Archive Node Service | ☑️ | ☑️ | ☑️ | ☑️ | | Monitor Service | ☑️ | ☑️ | ☑️ | ☑️ | | Multi-Chain Support | ☑️ | ☑️ | ☑️ | ☑️ | | Token API | ☑️ | ☑️ | ☑️ | ☑️ | | NFT API | ☑️ | ☑️ | ☑️ | ☑️ | | Account API | - | ☑️ | ☑️ | ☑️ | | MemPool API | - | ☑️ | ☑️ | ☑️ | | Trace API | - | ☑️ | ☑️ | ☑️ | > For Free Tier, some APIs like Account API support 300 free trials. ### Sui RPC APIs For Sui RPC endpoint, each RPC call currently consumes 50 compute unit. | Membership | Cost | Requests per Month | Rate Limit | | ---------- | -------------- | ------------------ | ---------------------- | | Free | $0 per month | 200,000 | 5 requests per second | | Lite | $29 per month | 2,000,000 | 10 requests per second | | Basic | $99 per month | 12,000,000 | 20 requests per second | | Pro | $199 per month | 40,000,000 | 40 requests per second | ### Sui Indexing APIs | Method | CU | | --------------------------------- | --- | | Retrieve Account's DeFi Portfolio | 400 | | Retrieve Account's Collections | 400 | | Retrieve a Single Collection Info | 400 | | Retrieve Collection Holders | 400 | | Retrieve Collection Activity | 400 | | Retrieve Collection NFT List | 400 | | Retrieve NFT Activity | 400 | | Retrieve NFT History Owner | 400 | | Retrieve Coin Holders | 400 | | Retrieve Account Activity | 400 | | Retrieve Account's Coins | 400 | | Retrieve Account's NFTs | 400 | | Retrieve Protocol Activity | 400 | ### EVM RPC APIs | Method | CU | | ---------------------------------------- | --- | | eth\_chainId | 1 | | eth\_syncing | 1 | | eth\_protocolVersion | 1 | | net\_listening | 1 | | eth\_gasPrice | 1 | | eth\_uninstallFilter | 10 | | eth\_blockNumber | 10 | | eth\_subscribe | 10 | | eth\_unsubscribe | 10 | | eth\_feeHistory | 10 | | eth\_maxProrityFeePerGas | 10 | | eth\_getTransactionReceipt | 15 | | eth\_getTransactionReceiptsByBlockNumber | 15 | | eth\_getUncleByBlockHashAndIndex | 15 | | eth\_getUncleByBlockNumberAndIndex | 15 | | eth\_getTransactionByBlockHashAndIndex | 15 | | eth\_getTransactionByBlockNumberAndIndex | 15 | | eth\_getUncleCountByBlockNumber | 15 | | eth\_getUncleCountByBlockHash | 15 | | web3\_clientVersion | 15 | | web3\_sha3 | 15 | | eth\_getBlockByNumber | 16 | | eth\_getTransactionByHash | 17 | | eth\_getStorageAt | 17 | | eth\_getBalance | 19 | | eth\_getCode | 19 | | eth\_getBlockTransactionCountByHash | 20 | | eth\_getBlockTransactionCountByNumber | 20 | | eth\_getBlockByHash | 21 | | eth\_getTransactionCount | 26 | | eth\_call | 26 | | eth\_getLogs | 75 | | eth\_estimateGas | 80 | | eth\_sendRawTransaction | 250 | | eth\_getBlockReceipts | 500 | ### Trace APIs | Method | CU | | ------------------ | -- | | trace\_block | 69 | | trace\_transaction | 29 | | trace\_get | 75 | | trace\_call | 75 | ### WebSocket WebSocket subscriptions like eth\_subscribe on BlockVision are priced based on bandwidth: the amount of data delivered as part of the subscription. Each subscription type is priced identically, per byte: | BandWidth | CU | | --------- | ---- | | 1 Byte | 0.02 | On average, websocket subscriptions event sizes range from a minimum of about 75 bytes to a maximum of about 1000 bytes. Specifically, subscribing to newPendingTransactions costs about 2 compute units per event. The event bvPendingTransactions costs about 20 compute units, while newHeads requires about 25 compute units. But the actual situation may be far from this number. ### Rate Limits (CUPS) Rate limit serves to protect users from malicious actors or runaway scripts. Each tier has prioritized rate limit allocations designed for ultimate reliability. CUPS is a measure of the number of compute units used per second when making requests. Since each request is weighted differently, the query frequency is limited based on the total compute units used rather than the number of requests.\ For example, if you send one web3\_sha3(15 CUs), two eth\_blockNumber (16 CUs) requests in the same second, you will have a total of 47 CUPS. | USER | Compute Units Per Second (CUPS) | | ---------- | ------------------------------- | | Free | 300 | | Lite | 500 | | Basic | 1000 | | Pro | 2000 | | Enterprise | Custom | # How to Verify Smart Contracts A contract source code could be verify after successfully deployed to BounceBit network , At the moment , to verify the source code ,it supports BounceBit explorer(bbscan.io) and hardhat verify plugin. ### Verify via bbscan.io The simplest way to verify your source code is via the bbscan.io UI. This process does not require any programming skills. #### A Step-by-step Tutorial **Step 1.** Head to bbscan.io, select the network for the contract to verify (support both for Testnet and Mainnet): <figure><img src="https://files.readme.io/32111da-1280X1280.PNG" alt=""><figcaption></figcaption></figure> <br> **Step 2.** Navigate to the 'Verify Contract' page through the submenu of Blockchain tab on the menu bar. <figure><img src="https://files.readme.io/70a4577-1280X1280_1.PNG" alt=""><figcaption></figcaption></figure> <br> **Step 3.** Insert the contract Address and upload metadata.json file, then click the verify contract button at bottom of the page. The verification process may fail if there are any mismatches between the smart contract and the upload files. <figure><img src="https://files.readme.io/8b2d69c-download.png" alt=""><figcaption></figcaption></figure> <br> **Step 4.** You will then be able to view the verification results. The outcome can either be a success or a failure. The verification process may fail if there are any mismatches between the smart contract and the uploaded files. <figure><img src="https://files.readme.io/50c6f6c-image.png" alt=""><figcaption></figcaption></figure> <br> **Step 5.** Verified contract details could be viewed by clicking the View the Contract, or navigate to the contract detail page by searching the contract address. <figure><img src="https://files.readme.io/2afc0fc-image_1.png" alt=""><figcaption></figcaption></figure> \ <br> ### Verify via Hardhat verify plugin To verify contract with hardhat verify plugin, in short, all steps are: 1. Setup config. 2. Flatten contract (skip if there's only one solidity file with no external dependencies). 3. Verify contract by verify plugin. **Step 1. Setup config** First, install the plugin: Shell ```shell npm install --save-dev @nomicfoundation/hardhat-verify ``` And add the following statement to your `hardhat.config.js`: JavaScript ```javascript require("@nomicfoundation/hardhat-verify"); ``` Then, add the following networks, etherscan and sourcify configs to your `hardhat.config.js` file: JavaScript ```javascript module.exports = { networks: { bbtestnet: { chainId: 6000, url: "https://fullnode-testnet.bouncebitapi.com" }, bbmainnet: { chainId: 6001, url: "https://fullnode-mainnet.bouncebitapi.com/" } }, etherscan: { enabled: false }, sourcify: { enabled: true, apiUrl: "http://api.bbscan.io/sourcify/server" } }; ``` **Step 2. Flatten contract** If the contract contains more than one file, or it imports external dependencies, Hardhat comes with a built-in flatten task that lets you combine the source code of multiple Solidity files so the contract could be verify by hardhat-verify plugin. Shell ```shell #all the Solidity files in your project will be combined npx hardhat flatten > contracts/flattened.sol #or, specifc a path to the contract file to flatten(the file which contains compile target): npx hardhat flatten contracts/Foo.sol > contracts/flattened.sol ``` The flattened contract need to be successful compiled in your contract project by hardhat. Then we are ready for the next step. **Step3. Verify contract** Run the command: Shell ```shell npx hardhat verify --network bbtestnet --contract contracts/flattened.sol:Foo <0xTheContractAddress> ``` Run `npx hardhat help verify` more details about verify plugin The verification process takes seconds to minutes. If contract is successfully verified, you should see : ``` Successfully verified contract Token on Sourcify. ``` Done! # How to Withdraw Validator Commission This guide explains how to withdraw your validator commission on BounceBit. Execute the following script on your validator machine, assuming your data directory is /data/bouncebit. #### **Prerequisites:** * bbcored is installed (assumed location: /usr/local/bin/bbcored). * You have access to your validator's keyring. Withdrawal Script: ```bash #!/bin/bash bbc="/usr/local/bin/bbcored --home=/data/bouncebit" moniker=$($bbc status | jq -r '.NodeInfo.moniker' | sed 's/\n//') opaddr=$($bbc query staking validators --output json | jq -r ".validators[] | select(.description.moniker == \"$moniker\") | .operator_address") keys=$($bbc keys list --output json) oper=$(echo "$keys"|jq -r '.[0].name') rwaddr=$(echo "$keys"|jq -r '.[0].address') cmd="bbc tx distribution withdraw-rewards $opaddr --from $oper --fees 2000000000000000bit --commission --yes --output json|jq" echo "Moniker: $moniker" echo "Operator Address: $opaddr" echo "Reward Address: $rwaddr" echo "Key Name: $oper" echo "Command to execute: $cmd" eval "$cmd" ``` #### Key Points: * **Execution**: Run this script on your validator server. * **Keyring**: You will be prompted for your keyring password twice during execution. * **Reward Address**: Rewards will be sent to your validator's operator address ($opaddr). * **Key** **Selection**: The script uses the first key in your keyring. Ensure this is the correct key. * **Commission** **Flag**: The --commission flag is essential for withdrawing validator commission. Please execute this script to withdraw your commission. Contact us if you have any questions. <br> # Official Social Media Channels These are our official social media channels. Do not trust non-official sources. <table data-view="cards"><thead><tr><th></th><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td></td><td>Twitter</td><td></td><td><a href="https://1316604192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNWumH92fd1205exOOBs%2Fuploads%2FM4t1ZuiduiK6yL6e21GI%2Flogo-white.png?alt=media&amp;token=801d818a-116b-405f-961b-850aa3d0b8a3">logo-white.png</a></td><td><a href="https://x.com/bouncebit">https://x.com/bouncebit</a></td></tr><tr><td></td><td></td><td>Medium</td><td></td><td><a href="https://1316604192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNWumH92fd1205exOOBs%2Fuploads%2FczznOHBafAErLV7BJ8nA%2FMedium-Symbol-White-RGB%401x.png?alt=media&amp;token=d2b2e0f7-9bae-4618-867b-52745391eb5f">Medium-Symbol-White-RGB@1x.png</
프로젝트로 돌아가기