Skip to content

Latest commit

 

History

History
112 lines (68 loc) · 5.01 KB

README.md

File metadata and controls

112 lines (68 loc) · 5.01 KB

Nolus Core


nolus-core


Go Report Card License Lint Test Test Fuzz Test cosmos-sdk

Nolus is a blockchain built using Cosmos SDK and CometBFT.

Prerequisites

Install golang, tomlq and jq.

Get started

Build, configure and run a single-node locally deployed Nolus chain

Build

make install

The command will compile and install nolusd locally on your machine.

Initialize, set up and run

init-local-network.sh generates a network setup, including the deployment of platform contracts (only) and initial Hermes setup (Nolus chain configuration).

First, generate the mnemonic you will use for Hermes:

nolusd keys mnemonic

Initialize and start (run ./scripts/init-local-network.sh --help for additional configuration options):

./scripts/init-local-network.sh --reserve-tokens <reserve_account_init_tokens> --hermes-mnemonic <the_mnemonic_generated_by_the_previous_steps> --dex-admin-mnemonic <mnemonic_phrase> --store-code-privileged-account-mnemonic <mnemonic_phrase>

*Notes:

  • Make sure the nolus-money-market repository is checked out as a sibling to this one.

  • !!! Before running the ./scripts/init-local-network.sh again, make sure the nolusd and hermes processes are killed.

  • The nolusd logs are stored in ~/.nolus.

Run an already configured single-node

nolusd start --home "networks/nolus/local-validator-1"

Set up a new DEX

On a live network, a new DEX can be deployed using the following steps.

Manual step - Prerequisites

  • provide a certain amount for the Hermes account (DEX side)

    Recover your Hermes wallet on the DEX network and use a faucet to obtain some amount.

    Example for the Osmosis DEX (Osmo-test-5 faucet):

    osmosisd keys add hermes_key --recover
  • start hermes

Аutomated step

./scripts/add-new-dex.sh --wasm-artifacts-path <wasm_artifacts_dir_path> --dex-name <dex_name> --dex-chain-id <new_dex_chain_id> --dex-ip-addr-rpc-host <new_dex_ip_addr_rpc_host_part> --dex-ip-addr-grpc-host <new_dex_ip_addr_grpc_host_part> --dex-account-prefix <new_dex_account_prefix> --dex-gas-price-denom <new_dex_price_denom> --dex-trusting-period-secs <new_dex_trusting_period_in_seconds>  --dex-if-interchain-security <if_interchain_security_true/false> --protocol-currency <new_protocol_currency> --protocol-swap-tree <new_protocol_swap_tree> --dex-network <dex_network_name> --dex-type-and-params '<dex_specific_field>'

The script takes care of setting up Hermes to work with the new DEX and, for now, deploying DEX-specific contracts (More about deploying contracts on a live network can be found here).

*Notes:

  • Execute ./scripts/add-new-dex.sh --help for additional configuration options

  • The protocol-swap-tree must be passed in single quotes (for example: --protocol-swap-tree '{"value":[0,"USDC"],"children":[{"value":[5,"OSMO"],"children":[{"value":[12,"ATOM"]}]}]}')

  • The script will locate the Hermes account from the Hermes configuration directory and link it to the new DEX

Build a statically linked binary

By default, make build generates a dynamically linked binary. In case someone would like to reproduce the way the binary is built in the pipeline then the command to achieve it locally is:

docker run --rm -it -v "$(pwd)":/code public.ecr.aws/nolus/builder:<replace_with_the latest_tag> make build -C /code

Upgrade wasmvm

  • Update the Go modules
  • Update the wasmvm version in the builder Dockerfile at .github/images/builder.Dockerfile
  • Increment the IMAGE_TAG and use the same version in the build-binary step in .github/workflows/build.yaml

Run a full node with docker

https://github.com/Nolus-Protocol/nolus-networks