#47 | Starting with Nibiru: A Guide to Nibiru Cli
· 4 min read
Nibiru offers a powerful platform for developing decentralized applications. In this guide, we'll explore how you can use the Nibiru CLI to interact with Nibiru, perform transactions, and query blockchain data.
Inter-Blockchain Communication (IBC) protocol
One of the key advantages of Nibiru is its interoperability with other blockchains in the Cosmos ecosystem. Nibiru uses the Inter-Blockchain Communication (IBC) protocol, allowing it to connect and communicate with other chains. This interoperability enables developers to build cross-chain applications that can exchange tokens and data with multiple blockchains, enhancing the overall utility of their applications.
Scalability and Security
Nibiru inherits the security features of the Tender mint consensus mechanism, ensuring fast finality and security against various attack vectors. Additionally, Nibiru's scalability is enhanced by its ability to connect with other chains in the Cosmos network using the IBC protocol. This allows Nibiru to offload transactions to other chains, reducing the burden on its own network and improving overall scalability.
Setting up Nibiru Node
Installation via Bash Script (Recommended)
curl -s https://get.nibiru.fi/! | bash
# For installing a specific version
curl -s https://get.nibiru.fi/@v1.0.0! | bash
This command allows you to install directly to your /usr/local/bin and will ask you for your sudo password.
Installation via the Binary
Depending on your machine, you can select and install any of the available binaries found on the official Nibiru GitHub Releases. The assets are at the bottom after the release notes.
To identify whether your machine is amd64 or arm64, you can run one of the following commands
dpkg --print-architecture
# returns "amd64" on Ubuntu
uname -m
# returns values like x86_64, i686, arm, and aarch64
After downloading the tar file containing the binary, you'll need to unpack it.
tar -xvf nibiru_linux_amd64.tar.gz && mv nibirud nibid
# The tar file unpacks with "nibirud" as the default name, so we rename it here.
To complete your installation, you would need to add nibid to your $PATH via updating your PATH in your shell config or by directly adding nibid to your binary folder on your machine.
# Add to shell config
export PATH=<path-to-nibid>:$PATH
# Or, copy directly to a /bin folder
cp nibid /bin/nibid
Running a Localnet (Optional)
For running a Localnet, you will need to clone the nibiru GitHub repository and run a localnet. (if Go related issues occur, you might want to install make, gcc and go following the steps found here)
git clone https://github.com/NibiruChain/nibiru.git cd nibiru make localnet
Running a local network (localnet) is essential for blockchain developers to safely develop, test, and debug applications. It provides a controlled environment for experimenting with new features, testing smart contracts, and simulating real-world conditions without affecting the main network. Localnets ensure applications meet performance, security, and privacy requirements before deployment, and they offer a cost-effective and offline development option for developers.
Nibid Command Line Interface
nibid is a command line client for the Nibiru network. Nibiru users can use nibid to send transactions to the Nibiru network and query the blockchain data.
Connected to a Nibiru
By default, nibid uses tcp://localhost:26657 as the RPC address to connect to the Nibiru network. This default configuration assumes that the machine executing nibid is running as a full-node. To connect to a live Testnet, you can run the following command:
nibid config chain-id nibiru-testnet-1 && \
nibid config broadcast-mode sync && \
nibid config node "https://rpc.testnet-1.nibiru.fi:443" && \
nibid config keyring-backend os && \
nibid config output json
In the command above, we are connecting to Nibiru’s most stable Testnet. To connect to other, you just replace the inputs to specify the chain
Environment | chain-id | keyring-backend | output | node | broadcast-mode |
mainnet | cataclysm-1 | os | json | sync | |
testnet1 | nibiru-testnet-1 | os | json | sync | |
testnet2 | nibiru-testnet-2 | os | json | sync | |
localnet | localnet-chain-id | os | json | sync |
To interact with the chain, you can use the nibid modules. Each module has its specific use case and documentation.
About Nibiru
Nibiru is a breakthrough L1 blockchain and smart contract ecosystem sporting superior throughput and unparalleled security. Nibiru aims to be the most developer-friendly and user-friendly smart contract ecosystem, leading the charge toward mainstream Web3 adoption by innovating at each layer of the stack: dApp development, infra, consensus, a comprehensive dev toolkit, value accrual.