Welcome to the world of Nervos CKB Blockchain with CKB Explorer! Whether you’re a developer or a blockchain enthusiast, this comprehensive guide will help you dive into using and contributing to CKB Explorer, a powerful tool built using React and Ruby on Rails.
What is CKB Explorer?
CKB Explorer is a blockchain explorer for the Nervos CKB network that allows you to explore transactions, blocks, addresses, and lock hashes. Its frontend and backend components provide a comprehensive user experience, making it easy to interact with the blockchain.
Features of CKB Explorer
- Explore blocks, transactions, addresses, and lock hashes
- View previous output and spending transaction details
- Quick search for transaction hash, address, lock hash, block hash, or height
- Responsive design for mobile users
- Supports two languages – English and Chinese
- Mainnet and Testnet functionality with distinct theme colors
Getting Started
Let’s break this down into a few simple steps that you can follow to get your CKB Explorer up and running.
Prerequisites
- Node: Ensure you have version 12.0.0 or greater installed.
- Yarn: Visit the Yarn website for installation instructions (version 1.13.0 or greater is needed).
- A fork of the repo (for contributions).
- A clone of the ckb-explorer-frontend repo.
Edit the .env File
To configure the environment for your application, you need to edit the .env.development for development purposes and .env.production for production. Here’s how it looks:
REACT_APP_API_URL = http://your-api-url # Set your own server API URL
REACT_APP_CHAIN_TYPE = testnet # Set chain type (mainnet or testnet)
REACT_APP_MAINNET_URL = http://localhost:3000 # MAINNET_URL is for deploying testnet, please ignore for development
REACT_APP_TESTNET_NAME = testnet # TESTNET_NAME is displayed on explorer header and also determines the subpath of the testnet
Installation Steps
- Clone the repository by using the command:
git clone https://github.com/nervosnetwork/ckb-explorer-frontend.git
- Navigate into your cloned repository:
cd ckb-explorer-frontend
- Install dependency libraries using:
yarn install
Running CKB Explorer Locally
Once installed, you can start your exploration:
- Run the development server:
yarn start
- Open your browser and visit http://localhost:3000 to see your CKB Explorer in action!
Building for Production
If you’re ready to build the project for production, follow these commands:
- Build the CKB Explorer frontend:
yarn build
- Run the project test cases:
yarn test
Troubleshooting
As you venture into using the CKB Explorer, you might encounter some challenges. Here are a few troubleshooting ideas:
- If the application does not start, ensure you have the correct Node and Yarn versions installed.
- Double-check that the .env file is configured correctly, especially the API URL and chain type.
- If you experience issues with dependencies, you may want to delete the node_modules directory and run
yarn install
again.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
With CKB Explorer, you can now confidently navigate the Nervos CKB blockchain. Consider this as a treasure map; each feature allows you to uncover pertinent details about the blockchain, just like finding jewels on your adventure. Start exploring, and contribute to this exciting project!
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.