Skip to content

Commit

Permalink
Merge branch 'master' into releases/v0.21.x
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yang committed Jul 12, 2023
2 parents a069f6c + ab97b8f commit 3fe9064
Show file tree
Hide file tree
Showing 57 changed files with 2,444 additions and 1,334 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Improvements

* [#1494](https://github.com/NibiruChain/nibiru/pull/1494) - feat: create cli to add sudo account into genesis
* [#1493](https://github.com/NibiruChain/nibiru/pull/1493) - fix(perp): allow `ClosePosition` when there is bad debt
* [#1500](https://github.com/NibiruChain/nibiru/pull/1500) - refactor(perp): clean up reverse market order mechanics

### Features

* [#1498](https://github.com/NibiruChain/nibiru/pull/1498) - feat: add cli to change root sudo command
* [#1501](https://github.com/NibiruChain/nibiru/pull/1501) - feat(localnet.sh): (1) Make it possible to run while offline. (2) Implement --no-build option to use the script with the current `nibid` installed.
* [#1501](https://github.com/NibiruChain/nibiru/pull/1501) - feat(proto): add Python buf generation logic for py-sdk

## [v0.21.6](https://github.com/NibiruChain/nibiru/releases/tag/v0.21.6) - 2023-07-05

### Features
Expand Down Expand Up @@ -97,6 +109,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Improvements

* [#1463](https://github.com/NibiruChain/nibiru/pull/1463) - feat(oracle): add genesis pricefeeder delegation
* [#1466](https://github.com/NibiruChain/nibiru/pull/1466) - refactor(perp): `PositionLiquidatedEvent`
* [#1462](https://github.com/NibiruChain/nibiru/pull/1462) - fix(perp): Add pair to liquidation failed event.
* [#1424](https://github.com/NibiruChain/nibiru/pull/1424) - feat(perp): Add change type and exchanged margin to position changed events.
* [#1390](https://github.com/NibiruChain/nibiru/pull/1390) - fix(localnet.sh): Fix genesis market initialization + add force exits on failure
Expand Down
8 changes: 8 additions & 0 deletions CHAOSNET.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ make chaosnet-build

to force re-build and pull images.

## Endpoints

- `http://localhost:5555` -> GraphQL server
- `http://localhost:26657` -> Tendermint RPC server
- `tcp://localhost:9090` -> Cosmos SDK gRPC server
- `http://localhost:1317` -> Cosmos SDK LCD (REST) server
- `http://localhost:8000` -> Faucet server (HTTP POST only)

## FAQ

### `make chaosnet` says that "Additional property name is not allowed"
Expand Down
3 changes: 3 additions & 0 deletions cmd/nibid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"io"
"os"

"github.com/NibiruChain/nibiru/x/sudo/cli"

dbm "github.com/cometbft/cometbft-db"
tmcli "github.com/cometbft/cometbft/libs/cli"
"github.com/cometbft/cometbft/libs/log"
Expand Down Expand Up @@ -153,6 +155,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) {
encodingConfig,
oraclecli.AddGenesisPricefeederDelegationCmd(app.DefaultNodeHome),
perpv2cli.AddMarketGenesisCmd(app.DefaultNodeHome),
cli.AddSudoRootAccountCmd(app.DefaultNodeHome),
),
queryCommand(),
txCommand(),
Expand Down
201 changes: 43 additions & 158 deletions contrib/docker-compose/docker-compose-chaosnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,214 +2,99 @@ name: chaosnet

services:
nibiru:
image: ghcr.io/nibiruchain/chaosnet:latest
build:
context: ../.. # nibiru project folder
dockerfile: ./contrib/docker/chaosnet.Dockerfile # relative to context directory (i.e. nibiru project folder)
args:
MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
ports:
- 26656:26656
- 26657:26657
- 1317:1317
- 9090:9090
volumes:
- nibid-data:/root/.nibid/data:rw

faucet:
restart: always
image: ghcr.io/nibiruchain/go-faucet:latest
environment:
NODE: nibiru:9090
MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
MNEMONIC: undo donkey arena rule old portion long forget rescue post stuff normal reduce raw unable warrior method stairs valley enhance glory lens sign zero
SEND_COINS: 11000000unibi,100000000unusd,100000000uusdt
MAX_SEND_COINS: 110000000unibi,1000000000unusd,1000000000uusdt
depends_on:
- nibiru
restart: on-failure
nibiru:
condition: service_started
ports:
- 8000:8000

liquidation-db:
image: postgres:latest
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: liquidator
ports:
- 5433:5432

liquidator:
image: ghcr.io/nibiruchain/liquidation:latest
platform: linux/amd64 # see https://github.com/psycopg/psycopg2/issues/1360 for why we need to force linux/amd64
restart: always
environment:
- ENVIRONMENT=localnet
- NETWORK_INSECURE=true
- CHAIN_ID=nibiru-localnet-0
- LCD_ENDPOINT=http://nibiru:1317
- GRPC_ENDPOINT=nibiru:9090
- RPC_ENDPOINT=nibiru:26657
- WEBSOCKET_ENDPOINT=ws://nibiru:26657/websocket
- DATABASE_URI=postgresql+psycopg2://postgres:postgres@liquidation-db:5432/liquidator
- WALLET_MNEMONIC=guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
- VPOOLS=ubtc:unusd

heart-monitor-db:
image: postgres:latest
heartmonitor-db:
image: postgres:14
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: heart-monitor
ports:
- 5434:5432
- 5433:5432

heart-monitor:
image: ghcr.io/nibiruchain/heart-monitor:latest
platform: linux/amd64 # see https://github.com/psycopg/psycopg2/issues/1360 for why we need to force linux/amd64
heartmonitor:
image: ghcr.io/nibiruchain/go-heartmonitor:latest
restart: always
command: --clean
volumes:
- nibid-data:/heartmonitor/.nibid/data:ro
environment:
- DATABASE_URI=postgresql+psycopg2://postgres:postgres@heart-monitor-db:5432/heart-monitor
- ENVIRONMENT=localnet
- NETWORK_INSECURE=true
- LCD_ENDPOINT=http://nibiru:1317
- GRPC_ENDPOINT=tcp://nibiru:9090
- DATABASE_URI=postgresql://postgres:postgres@heartmonitor-db:5432/heart-monitor?sslmode=disable
- TENDERMINT_RPC_ENDPOINT=http://nibiru:26657
- WEBSOCKET_ENDPOINT=ws://nibiru:26657/websocket
- VALIDATOR_MNEMONIC=guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
- MODULE_ACCOUNTS={'nibi1yl6hdjhmkf37639730gffanpzndzdpmhe6js7s':'transfer','nibi1fl48vsnmsdzcv85q5d2q4z5ajdha8yu3z7dksy':'bonded_tokens_pool','nibi1trh2mamq64u4g042zfeevvjk4cukrthvppfnc7':'perp_ef','nibi1tygms3xhhs3yv487phx3dw4a95jn7t7lk738xs':'not_bonded_tokens_pool','nibi10d07y265gmmuvt4z0w9aw880jnsr700jd8hulq':'gov','nibi1jv65s3grqf6v6jl3dp4t6c9t9rk99cd8s6q9qv':'distribution','nibi143kdcynewz7d08fmlu0ugtnn9sv8vljxwp7eug':'fee_pool','nibi1m3h30wlvsf8llruxtpukdvsy0km2kum8l5rpwn':'mint','nibi1umc2r7a58jy3jmw0e0hctyy0rx45chmurptawl':'vault','nibi17xpfvakm2amg962yls6f84z3kell8c5l8u8ezw':'fee_collector'}
- LOGGER_TIMESTAMP=true

# BDJUNO
bdjuno-repo-clone-task:
image: alpine/git
command:
[
"clone",
"https://github.com/NibiruChain/bdjuno.git",
"/bdjuno"
]
volumes:
- bdjuno-repo:/bdjuno

bdjuno-database-schema-task:
image: alpine:latest
command:
[
"/bin/sh",
"-c",
"mv -v /bdjuno/database/schema/* /docker-entrypoint-initdb.d"
]
volumes:
- bdjuno-repo:/bdjuno
- bdjuno-docker-entrypoint:/docker-entrypoint-initdb.d
depends_on:
bdjuno-repo-clone-task:
condition: service_completed_successfully

bdjuno-hasura-metadata-task:
image: alpine:latest
command:
[
"/bin/sh",
"-c",
"mv -v /bdjuno/hasura/metadata/* /hasura-metadata"
]
volumes:
- bdjuno-repo:/bdjuno
- bdjuno-hasura-metadata:/hasura-metadata
depends_on:
bdjuno-repo-clone-task:
condition: service_completed_successfully
- GRPC_ENDPOINT=tcp://nibiru:9090
- GRPC_INSECURE=true
- NO_PARTITIONS=true
- CHAIN_DB_PATH=/heartmonitor/.nibid/data

bdjuno-db:
image: postgres:latest
liquidator:
image: ghcr.io/nibiruchain/go-heartmonitor:latest
restart: always
command: --liquidator
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bdjuno
ports:
- 5435:5432
volumes:
- bdjuno-docker-entrypoint:/docker-entrypoint-initdb.d:ro
depends_on:
bdjuno-repo-clone-task:
condition: service_completed_successfully

bdjuno-genesis-task:
image: apteno/alpine-jq
command:
[
"sh",
"-c",
"curl -s http://nibiru:26657/genesis | jq -r '.result.genesis' > /bdjuno/.bdjuno/genesis.json"
]
volumes:
- bdjuno-genesis:/bdjuno/.bdjuno
depends_on:
nibiru:
condition: service_started

bdjuno:
image: ghcr.io/nibiruchain/bdjuno:latest
restart: always
command: [ "bdjuno", "start", "--home", "/bdjuno/.bdjuno" ]
volumes:
- type: bind
source: ../templates/bdjuno.yaml
target: /bdjuno/.bdjuno/config.yaml
- bdjuno-genesis:/bdjuno/.bdjuno
- DATABASE_URI=postgresql://postgres:postgres@heartmonitor-db:5432/heart-monitor?sslmode=disable
- TENDERMINT_RPC_ENDPOINT=http://nibiru:26657
- GRPC_ENDPOINT=tcp://nibiru:9090
- GRPC_INSECURE=true
- NO_PARTITIONS=true
- LIQUIDATOR_MNEMONIC=record damage person caution truly riot resource luxury rude guide mushroom athlete fantasy dentist friend mule depth salmon photo unfold exclude coyote idea evoke
- LIQUIDATOR_GAS_LIMIT_INITIAL=500000
- LIQUIDATOR_GAS_MULTIPLIER=5
- LIQUIDATOR_GAS_MAX_ATTEMPTS=10
depends_on:
bdjuno-genesis-task:
condition: service_completed_successfully
bdjuno-db:
heartmonitor:
condition: service_started

hasura:
image: hasura/graphql-engine:latest.cli-migrations-v3
graphql:
image: ghcr.io/nibiruchain/go-heartmonitor:latest
restart: always
command: --graphql
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgres@bdjuno-db:5432/bdjuno
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_ADMIN_SECRET: hasura
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous
ACTION_BASE_URL: http://bdjuno:3000
HASURA_GRAPHQL_ENABLED_LOG_TYPES: "startup, http-log, webhook-log, websocket-log, query-log"
ports:
- 8080:8080
volumes:
- bdjuno-hasura-metadata:/hasura-metadata
depends_on:
bdjuno-hasura-metadata-task:
condition: service_completed_successfully
bdjuno-db:
condition: service_started

big-dipper:
image: ghcr.io/nibiruchain/big-dipper:localnet-0
platform: linux/amd64
restart: always
- DATABASE_URI=postgresql://postgres:postgres@heartmonitor-db:5432/heart-monitor?sslmode=disable
- NO_PARTITIONS=true
ports:
- 3000:3000
environment:
NODE_ENV: production
- 5555:5555
depends_on:
hasura:
heartmonitor:
condition: service_started

pricefeeder:
image: ghcr.io/nibiruchain/pricefeeder:latest
restart: always
environment:
CHAIN_ID: "nibiru-localnet-0"
CHAIN_ID: nibiru-localnet-0
GRPC_ENDPOINT: nibiru:9090
WEBSOCKET_ENDPOINT: ws://nibiru:26657/websocket
FEEDER_MNEMONIC: guard cream sadness conduct invite crumble clock pudding hole grit liar hotel maid produce squeeze return argue turtle know drive eight casino maze host
FEEDER_MNEMONIC: empower dice proud brick treat reward pull jeans right rubber infant hamster pet foster among crush quick report rival bracket easily mouse topple absorb
EXCHANGE_SYMBOLS_MAP: '{ "bitfinex": { "ubtc:uusd": "tBTCUSD", "ueth:uusd": "tETHUSD", "uusdt:uusd": "tUSTUSD" }, "binance": { "ubtc:uusd": "BTCUSD", "ueth:uusd": "ETHUSD", "uusdt:uusd": "USDTUSD", "uusdc:uusd": "USDCUSD", "uatom:uusd": "ATOMUSD", "ubnb:uusd": "BNBUSD", "uavax:uusd": "AVAXUSD", "usol:uusd": "SOLUSD", "uada:uusd": "ADAUSD", "ubtc:unusd": "BTCUSD", "ueth:unusd": "ETHUSD", "uusdt:unusd": "USDTUSD", "uusdc:unusd": "USDCUSD", "uatom:unusd": "ATOMUSD", "ubnb:unusd": "BNBUSD", "uavax:unusd": "AVAXUSD", "usol:unusd": "SOLUSD", "uada:unusd": "ADAUSD" } }'

VALIDATOR_ADDRESS: nibivaloper1zaavvzxez0elundtn32qnk9lkm8kmcszuwx9jz
depends_on:
nibiru:
condition: service_started

volumes:
bdjuno-repo:
bdjuno-docker-entrypoint:
bdjuno-genesis:
bdjuno-hasura-metadata:
nibid-data:
17 changes: 13 additions & 4 deletions contrib/make/chaosnet.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,31 @@ chaosnet-down:
### Chaosnet Logs ###
###############################################################################

# Run a chaosnet testnet locally
.PHONY: chaosnet-logs
chaosnet-logs:
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml logs

# Run a chaosnet testnet locally
.PHONY: chaosnet-logs-faucet
chaosnet-logs-faucet:
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml logs faucet
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml logs go-faucet

.PHONY: chaosnet-logs-pricefeeder
chaosnet-logs-pricefeeder:
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml logs pricefeeder --follow

.PHONY: chaosnet-logs-go-heartmonitor
chaosnet-logs-go-heartmonitor:
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml logs go-heartmonitor

###############################################################################
### Chaosnet SSH ###
###############################################################################

# Run a chaosnet testnet locally
.PHONY: chaosnet-ssh-nibiru
chaosnet-ssh-nibiru:
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml exec -it nibiru /bin/sh

.PHONY: chaosnet-ssh-go-heartmonitor
chaosnet-ssh-go-heartmonitor:
docker compose -f ./contrib/docker-compose/docker-compose-chaosnet.yml exec -it go-heartmonitor /bin/sh

Loading

0 comments on commit 3fe9064

Please sign in to comment.