-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: unwire perp module for main branch #1830
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,14 +1,18 @@ | ||||
# Install `nibid` binaries <!-- omit in toc --> | ||||
# Install `nibid` binaries <!-- omit in toc --> | ||||
|
||||
This guide will explain how to install the Nibiru Chain binary, `nibid`, onto your system. | ||||
|
||||
#### Table of Contents | ||||
|
||||
- [1. Update the system](#1-update-the-system) | ||||
- [2. Install Golang](#2-install-golang) | ||||
- [3. Install build requirements](#3-install-build-requirements) | ||||
- [4. Clone the Nibiru Repository](#4-clone-the-nibiru-repository) | ||||
- [Upgrade](#upgrade) | ||||
|
||||
- [Troubleshooting](#troubleshooting) | ||||
- [Contributing](#contributing) | ||||
- [Troubleshooting](#troubleshooting-1) | ||||
- [Error when running `make install` on MacOS](#error-when-running-make-install-on-macos) | ||||
|
||||
## 1. Update the system | ||||
|
||||
|
@@ -19,7 +23,7 @@ sudo apt update | |||
sudo apt upgrade --yes | ||||
``` | ||||
|
||||
## 2. Install Golang | ||||
## 2. Install Golang | ||||
|
||||
Steps described here: https://go.dev/doc/install | ||||
|
||||
|
@@ -34,7 +38,6 @@ wget -q -O - https://git.io/vQhTU | bash -s -- --version 1.16 | |||
|
||||
After installed, open new terminal to properly load go | ||||
|
||||
|
||||
## 4. Clone the Nibiru Repository | ||||
|
||||
```sh | ||||
|
@@ -43,32 +46,33 @@ git clone https://github.com/NibiruChain/nibiru | |||
cd nibiru | ||||
``` | ||||
|
||||
On this fresh clone of the repo, simply run | ||||
On this fresh clone of the repo, simply run | ||||
|
||||
```sh | ||||
make build | ||||
make build | ||||
make install | ||||
make localnet | ||||
``` | ||||
and open another terminal. | ||||
|
||||
and open another terminal. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence does not start with an uppercase letter. Consider revising for consistency and readability. - and open another terminal.
+ And open another terminal. Committable suggestion
Suggested change
|
||||
|
||||
--- | ||||
|
||||
## Upgrade | ||||
|
||||
The scheduled mainnet upgrade to `nibiru-2` is planned for | ||||
The scheduled mainnet upgrade to `nibiru-2` is planned for | ||||
|
||||
``` | ||||
cd nibiru | ||||
git fetch tags | ||||
git checkout v0.0.1 | ||||
``` | ||||
|
||||
|
||||
Testnet | ||||
Testnet | ||||
|
||||
One the Nibiru binary has been installed, for further information on joining the testnet, head over to the [testnet repo](https://github.com/NibiruChain/Networks/tree/main/Testnet). | ||||
|
||||
Mainnet | ||||
Mainnet | ||||
|
||||
One the Nibiru binary has been installed, for further information on joining mainnet, head over to the [mainnet repo](https://github.com/NibiruChain/Networks/tree/main/Mainnet). | ||||
|
||||
|
@@ -84,9 +88,9 @@ B. New commands you've made on the `nibid` don't show up. Your `nibid` probably | |||
|
||||
## Contributing | ||||
|
||||
The code for `nibid` is located in the `/cmd/nibid` folder. | ||||
The code for `nibid` is located in the `/cmd/nibid` folder. | ||||
|
||||
In addition to the commands available within that folder, `nibid` pulls in cli subcommands from the modules e.g. `/x/perps/cli` | ||||
In addition to the commands available within that folder, `nibid` pulls in cli subcommands from the modules e.g. `/x/oracle/cli` | ||||
|
||||
After updating the code run | ||||
|
||||
|
@@ -98,14 +102,14 @@ make install | |||
To see all the commands available just add `--help` to the end. | ||||
|
||||
Example: | ||||
|
||||
```bash | ||||
nibid --help | ||||
nibid query --help | ||||
nibid tx --help | ||||
nibid query perp --help | ||||
nibid query oracle --help | ||||
``` | ||||
|
||||
|
||||
## Troubleshooting | ||||
|
||||
### Error when running `make install` on MacOS | ||||
|
@@ -120,4 +124,4 @@ You can fix it by installing `wget` with Homebrew: | |||
|
||||
``` | ||||
brew install wget | ||||
``` | ||||
``` | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The operating system from Apple is written as “macOS” rather than “MacOS”. Consider updating for accuracy. - ### Error when running `make install` on MacOS
+ ### Error when running `make install` on macOS |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,17 +22,17 @@ | |
|
||
## ⚙️ — Documentation | ||
|
||
- [Docs | Nibiru Chain](https://nibiru.fi/docs/): Conceptual and technical documentation can be found here. | ||
- [Docs | Nibiru Chain](https://nibiru.fi/docs/): Conceptual and technical documentation can be found here. | ||
- [Complete Golang reference docs](https://pkg.go.dev/github.com/NibiruChain/nibiru): (`pkg.go.dev`) For the blockchain implementation . | ||
- ["X Module"](https://nibiru.fi/docs/dev/x/)-specific documentation | ||
|
||
## 💬 — Community | ||
|
||
If you have questions or concerns, feel free to connect with a developer or community member in the [Nibiru Discord][social-discord]. We also have active communities on [Twitter][social-twitter] and [Telegram][social-telegram]. | ||
|
||
<!-- Markdown versions of the social badges | ||
[![description][discord-badge]][social-discord] | ||
[![description][twitter-badge]][social-twitter] | ||
<!-- Markdown versions of the social badges | ||
[![description][discord-badge]][social-discord] | ||
[![description][twitter-badge]][social-twitter] | ||
[![description][telegram-badge]][social-telegram] | ||
--> | ||
|
||
Comment on lines
22
to
38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The operating system name should adhere to the standard naming convention. Here's the correction: - MacOS
+ macOS |
||
|
@@ -44,33 +44,30 @@ If you have questions or concerns, feel free to connect with a developer or comm | |
|
||
## 🧱 — Components of Nibiru | ||
|
||
- **CosmWasm Smart Contracts**: Rust-based, Wasm smart contracts built enhanced security, performance, and interoperability. See our [CosmWasm sandbox monorepo (cw-nibiru)](https://github.com/NibiruChain/cw-nibiru/tree/main) for the protocol's core smart contracts. | ||
- **Nibi-Perps**: A perpetual futures exchange where users can take leveraged exposure and trade on a plethora of assets — completely on-chain, completely non-custodially, and with minimal gas fees. | ||
- **CosmWasm Smart Contracts**: Rust-based, Wasm smart contracts built enhanced security, performance, and interoperability. See our [CosmWasm sandbox monorepo (cw-nibiru)](https://github.com/NibiruChain/cw-nibiru/tree/main) for the protocol's core smart contracts. | ||
- **Nibi-Oracle**: Nibiru accurately prices assets using a native, system of decentralized oracles, and communicates with other Cosmos layer-1 chains using the Inter-Blockchain Communication (IBC) (opens new window)protocol. | ||
- **Nibi-Swap**: An automated market maker protocol for multichain assets. This application gives users access to swaps, pools, and bonded liquidity gauges. | ||
|
||
| Module | Description | | ||
| --- | --- | | ||
| [wasm][code-x-wasm] | Implements the execution environment for [WebAssembly (WASM) smart contracts](https://nibiru.fi/docs/wasm/). | | ||
| [devgas][code-x-devgas] | The `devgas` module of Nibiru Chain shares contract execution fees with smart contract developers. This aims to increase the adoption of Nibiru by offering CosmWasm smart contract developers a direct source of income based on usage. | | ||
| [epochs][code-x-epochs] | The `epochs` module allows other modules to set hooks to be called to execute code automatically on a period basis. For example, "once a week, starting at UTC-time = x". `epochs` creates a generalized epoch interface. | | ||
| [inflation][code-x-inflation] | Implements the [tokenomics](https://nibiru.fi/docs/learn/tokenomics.html) for Nibiru. | | ||
| [common][code-x-common] | Holds helper and utility functions to be utilized by other `x/` modules. | | ||
| [oracle][code-x-oracle] | Handles the posting of an up-to-date and accurate feed of exchange rates from the validators. | | ||
| [perp][code-x-perp] | Powers the Nibi-Perps exchange. This module enables traders to open long and short leveraged positions and houses all of the PnL calculation and liquidation logic. | | ||
| [spot][code-x-spot] | Responsible for creating, joining, and exiting liquidity pools. It also allows users to swap between two assets in an existing pool. It's a fully functional AMM. | | ||
| Module | Description | | ||
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [wasm][code-x-wasm] | Implements the execution environment for [WebAssembly (WASM) smart contracts](https://nibiru.fi/docs/wasm/). | | ||
| [devgas][code-x-devgas] | The `devgas` module of Nibiru Chain shares contract execution fees with smart contract developers. This aims to increase the adoption of Nibiru by offering CosmWasm smart contract developers a direct source of income based on usage. | | ||
| [epochs][code-x-epochs] | The `epochs` module allows other modules to set hooks to be called to execute code automatically on a period basis. For example, "once a week, starting at UTC-time = x". `epochs` creates a generalized epoch interface. | | ||
| [inflation][code-x-inflation] | Implements the [tokenomics](https://nibiru.fi/docs/learn/tokenomics.html) for Nibiru. | | ||
| [common][code-x-common] | Holds helper and utility functions to be utilized by other `x/` modules. | | ||
| [oracle][code-x-oracle] | Handles the posting of an up-to-date and accurate feed of exchange rates from the validators. | | ||
| [spot][code-x-spot] | Responsible for creating, joining, and exiting liquidity pools. It also allows users to swap between two assets in an existing pool. It's a fully functional AMM. | | ||
|
||
[code-x-common]: https://github.com/NibiruChain/nibiru/tree/main/x/common | ||
[code-x-devgas]: https://nibiru.fi/docs/dev/x/nibiru-chain/devgas.html | ||
[code-x-epochs]: https://github.com/NibiruChain/nibiru/tree/main/x/epochs | ||
[code-x-inflation]: https://github.com/NibiruChain/nibiru/tree/main/x/inflation | ||
[code-x-oracle]: https://github.com/NibiruChain/nibiru/tree/main/x/oracle | ||
[code-x-perp]: https://github.com/NibiruChain/nibiru/tree/main/x/perp | ||
[code-x-spot]: https://github.com/NibiruChain/nibiru/tree/main/x/spot | ||
|
||
Nibiru is built with the [Cosmos-SDK][cosmos-sdk-repo] on [Tendermint Core](https://tendermint.com/core/) consensus and communicates with other blockchain chains using the [Inter-Blockchain Communication (IBC)](https://github.com/cosmos/ibc) protocol. | ||
|
||
---- | ||
--- | ||
|
||
## ⛓️ — Building: `make` commands | ||
|
||
|
@@ -94,10 +91,12 @@ Usage instructions for the `nibid` CLI are available at [docs.nibiru.fi/dev/cli] | |
### Running a Local Node | ||
|
||
On a fresh clone of the repo, simply run: | ||
|
||
```bash | ||
make localnet | ||
``` | ||
and open another terminal. | ||
``` | ||
|
||
and open another terminal. | ||
|
||
### Generate the protobufs | ||
|
||
|
@@ -131,19 +130,13 @@ Licensed under the [MIT License](./LICENSE.md). | |
|
||
[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg | ||
[cosmos-sdk-repo]: https://github.com/cosmos/cosmos-sdk | ||
[badge-go-linter]: | ||
https://github.com/NibiruChain/nibiru/actions/workflows/golangci-lint.yml/badge.svg?query=branch%3Amain | ||
[workflow-go-linter]: | ||
https://github.com/NibiruChain/nibiru/actions/workflows/golangci-lint.yml?query=branch%3Amain | ||
[badge-go-releaser]: | ||
https://github.com/NibiruChain/nibiru/actions/workflows/goreleaser.yml/badge.svg?query=branch%3Amain | ||
[workflow-go-releaser]: | ||
https://github.com/NibiruChain/nibiru/actions/workflows/goreleaser.yml?query=branch%3Amain | ||
|
||
[badge-go-linter]: https://github.com/NibiruChain/nibiru/actions/workflows/golangci-lint.yml/badge.svg?query=branch%3Amain | ||
[workflow-go-linter]: https://github.com/NibiruChain/nibiru/actions/workflows/golangci-lint.yml?query=branch%3Amain | ||
[badge-go-releaser]: https://github.com/NibiruChain/nibiru/actions/workflows/goreleaser.yml/badge.svg?query=branch%3Amain | ||
[workflow-go-releaser]: https://github.com/NibiruChain/nibiru/actions/workflows/goreleaser.yml?query=branch%3Amain | ||
[social-twitter]: https://twitter.com/NibiruChain | ||
[social-discord]: https://discord.gg/nibirufi | ||
[social-telegram]: https://t.me/nibiruchain | ||
|
||
[discord-badge]: https://img.shields.io/badge/Discord-7289DA?&logo=discord&logoColor=white | ||
[twitter-badge]: https://img.shields.io/badge/Twitter-1DA1F2?&logo=twitter&logoColor=white | ||
[telegram-badge]: https://img.shields.io/badge/Telegram-2CA5E0?&logo=telegram&logoColor=white | ||
|
@@ -153,7 +146,7 @@ https://github.com/NibiruChain/nibiru/actions/workflows/goreleaser.yml?query=bra | |
|
||
[](https://github.com/NibiruChain/nibiru/releases/latest) | ||
|
||
[](https://goreportcard.com/report/github.com/NibiruChain/nibiru) | ||
[](https://goreportcard.com/report/github.com/NibiruChain/nibiru) | ||
|
||
[](https://godoc.org/github.com/NibiruChain/nibiru) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This script is used in tandem with `contrib/docker/chaosnet.Dockerfile` to | ||
# run nodes for Nibiru Chain networks inside docker containers. | ||
# run nodes for Nibiru Chain networks inside docker containers. | ||
# - See CHAOSNET.md for usage instructions. | ||
set -e | ||
|
||
|
@@ -27,7 +27,6 @@ sed -i 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/' $HOME/.nibid/ | |
sed -i "s/localhost:1317/0.0.0.0:$LCD_PORT/" $HOME/.nibid/config/app.toml | ||
sed -i "s/localhost:9090/0.0.0.0:$GRPC_PORT/" $HOME/.nibid/config/app.toml | ||
|
||
|
||
# ------------------------------------------------------------------------ | ||
# Configure genesis params | ||
# ------------------------------------------------------------------------ | ||
Comment on lines
27
to
32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Consider quoting variables to prevent globbing and word splitting. This is a good practice to ensure that the script behaves as expected when dealing with values that may contain spaces or special characters. - nibid init $CHAIN_ID --chain-id $CHAIN_ID --home $HOME/.nibid --overwrite
+ nibid init "$CHAIN_ID" --chain-id "$CHAIN_ID" --home "$HOME/.nibid" --overwrite |
||
|
@@ -44,9 +43,7 @@ add_genesis_param() { | |
mv $HOME/.nibid/config/tmp_genesis.json $HOME/.nibid/config/genesis.json | ||
} | ||
|
||
curr_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
source "$curr_dir/feat-perp.sh" | ||
add_genesis_perp_markets_offline | ||
curr_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable |
||
|
||
# recover mnemonic | ||
echo "$MNEMONIC" | nibid keys add validator --recover | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Troubleshooting" section appears twice in the Table of Contents. Consider removing the duplicate entry to avoid confusion.