core

module
v0.5.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: Apache-2.0

README

 

Full-node software implementing the Olmec protocol

Explore the Docs »

Olmec Core reference · Go API · Rest API · Python SDK · Olmec.js · Finder · Station


Table of Contents

What is Olmec?

Olmec is a public, open-source blockchain protocol that provides fundamental infrastructure for a decentralized economy and enables open participation in the creation of new financial primitives to power the innovation of money.

The Olmec blockchain is secured by distributed consensus on staked asset Cacao and natively supports the issuance of price-tracking stablecoins that are algorithmically pegged to major world currencies, such as USC, KRC, and SDC. Smart contracts on Olmec run on WebAssembly and take advantage of core modules, such as on-chain swaps, price oracle, and staking rewards, to power modern DeFi apps. Through dynamic fiscal policy managed by community governance, Olmec is an evolving, democratized economy directed by its users.

Olmec Core is the reference implementation of the Olmec protocol, written in Golang. Olmec Core is built atop Cosmos SDK and uses Tendermint BFT consensus. If you intend to work on Olmec Core source, it is recommended that you familiarize yourself with the concepts in those projects.

Installation

Binaries

The easiest way to get started is by downloading a pre-built binary for your operating system. You can find the latest binaries on the releases page.

From Source

Step 1. Install Golang

Go v1.17+ or higher is required for Olmec Core.

If you haven't already, install Golang by following the official docs. Make sure that your GOPATH and GOBIN environment variables are properly set up.

Step 2: Get Olmec Core source code

Use git to retrieve Olmec Core from the official repo and checkout the main branch. This branch contains the latest stable release, which will install the olmecd binary.

git clone https://gitlab.com/mayachain/olmec/core/
cd core
git checkout main

Step 3: Build Olmec core

Run the following command to install the executable olmecd to your GOPATH and build Olmec Core. olmecd is the node daemon and CLI for interacting with a Olmec node.

# COSMOS_BUILD_OPTIONS=rocksdb make install
make install

Step 4: Verify your installation

Verify that you've installed olmecd successfully by running the following command:

olmecd version --long

If olmecd is installed correctly, the following information is returned:

name: olmec
server_name: olmecd
version: 0.5.0-rc0-9-g640fd0ed
commit: 640fd0ed921d029f4d1c3d88435bd5dbd67d14cd
build_tags: netgo,ledger
go: go version go1.17.2 darwin/amd64

olmecd

NOTE: olmeccli has been deprecated and all of its functionalities have been merged into olmecd.

olmecd is the all-in-one command for operating and interacting with a running Olmec node. For comprehensive coverage on each of the available functions, see the olmecd reference information. To view various subcommands and their expected arguments, use the $ olmecd --help command:

        
$ olmecd --help Stargate Olmec App Usage: olmecd [command] Available Commands: add-genesis-account Add a genesis account to genesis.json collect-gentxs Collect genesis txs and output a genesis.json file debug Tool for helping with debugging your application export Export state to JSON gentx Generate a genesis tx carrying a self delegation help Help about any command init Initialize private validator, p2p, genesis, and application configuration files keys Manage your application's keys migrate Migrate genesis to a specified target version query Querying subcommands rosetta spin up a rosetta server start Run the full node status Query remote node for status tendermint Tendermint subcommands testnet Initialize files for a olmecd testnet tx Transactions subcommands unsafe-reset-all Resets the blockchain database, removes address book files, and resets data/priv_validator_state.json to the genesis state validate-genesis validates the genesis file at the default location or at the location passed as an arg version Print the application binary version information Flags: -h, --help help for olmecd --home string directory for config and data (default "/Users/$HOME/.olmec") --log_format string The logging format (json|plain) (default "plain") --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) (default "info") --trace print out full stack trace on errors Use "olmecd [command] --help" for more information about a command.

Node Setup

Once you have olmecd installed, you will need to set up your node to be part of the network.

Join the mainnet

The following requirements are recommended for running a columbus-5 mainnet node:

  • 4 or more CPU cores
  • At least 2TB of disk storage
  • At least 100mbps network bandwidth
  • An Linux distribution

For configuration and migration instructions for setting up a Columbus-5 mainnet node, visit The mainnet repo.

Olmec Node Quick Start

olmecd init nodename
wget -O ~/.olmec/config/genesis.json https://cloudflare-ipfs.com/ipfs/QmZAMcdu85Qr8saFuNpL9VaxVqqLGWNAs72RVFhchL9jWs
curl https://network.olmec.dev/addrbook.json > ~/.olmecd/config/addrbook.json
olmecd start

Join a testnet

Several testnets might exist simultaneously. Ensure that your version of olmecd is compatible with the network you want to join.

To set up a node on the latest testnet, visit the testnet repo.

Run a local testnet

The easiest way to set up a local testing environment is to run LocalOlmec, which automatically orchestrates a complete testing environment suited for development with zero configuration.

Run a single node testnet

You can also run a local testnet using a single node. On a local testnet, you will be the sole validator signing blocks.

Step 1. Create network and account

First, initialize your genesis file to bootstrap your network. Create a name for your local testnet and provide a moniker to refer to your node:

olmecd init --chain-id=<testnet_name> <node_moniker>

Next, create a Olmec account by running the following command:

olmecd keys add <account_name>

Step 2. Add account to genesis

Next, add your account to genesis and set an initial balance to start. Run the following commands to add your account and set the initial balance:

olmecd add-genesis-account $(olmecd keys show <account_name> -a) 100000000ucacao,1000usd
olmecd gentx <account_name> 10000000ucacao --chain-id=<testnet_name>
olmecd collect-gentxs

Step 3. Run Olmec daemon

Now you can start your private Olmec network:

olmecd start

Your olmecd node will be running a node on tcp://localhost:26656, listening for incoming transactions and signing blocks.

Congratulations, you've successfully set up your local Olmec network!

Set up a production environment

NOTE: This guide only covers general settings for a production-level full node. You can find further details on considerations for operating a validator node by visiting the Olmec validator guide.

This guide has been tested against Linux distributions only. To ensure you successfully set up your production environment, consider setting it up on an Linux system.

Increase maximum open files

olmecd can't open more than 1024 files (the default maximum) concurrently.

You can increase this limit by modifying /etc/security/limits.conf and raising the nofile capability.

*                soft    nofile          65535
*                hard    nofile          65535

Create a dedicated user

It is recommended that you run olmecd as a normal user. Super-user accounts are only recommended during setup to create and modify files.

Port configuration

olmecd uses several TCP ports for different purposes.

  • 26656: The default port for the P2P protocol. Use this port to communicate with other nodes. While this port must be open to join a network, it does not have to be open to the public. Validator nodes should configure persistent_peers and close this port to the public.

  • 26657: The default port for the RPC protocol. This port is used for querying / sending transactions and must be open to serve queries from olmecd. DO NOT open this port to the public unless you are planning to run a public node.

  • 1317: The default port for Lite Client Daemon (LCD), which can be enabled in ~/.olmec/config/app.toml. The LCD provides an HTTP RESTful API layer to allow applications and services to interact with your olmecd instance through RPC. Check the Olmec REST API for usage examples. Don't open this port unless you need to use the LCD.

  • 26660: The default port for interacting with the Prometheus database. You can use Promethues to monitor an environment. This port is closed by default.

Run the server as a daemon

Important:

Keep olmecd running at all times. The simplest solution is to register olmecd as a systemd service so that it automatically starts after system reboots and other events.

Register olmecd as a service

First, create a service definition file in /etc/systemd/system.

Sample file: /etc/systemd/system/olmecd.service

[Unit]
Description=Olmec Daemon
After=network.target

[Service]
Type=simple
User=olmec
ExecStart=/data/olmec/go/bin/olmecd start
Restart=on-abort

[Install]
WantedBy=multi-user.target

[Service]
LimitNOFILE=65535

Modify the Service section from the given sample above to suit your settings. Note that even if you raised the number of open files for a process, you still need to include LimitNOFILE.

After creating a service definition file, you should execute systemctl daemon-reload.

Start, stop, or restart service

Use systemctl to control (start, stop, restart)

# Start
systemctl start olmecd
# Stop
systemctl stop olmecd
# Restart
systemctl restart olmecd

Access logs

# Entire log
journalctl -t olmecd
# Entire log reversed
journalctl -t olmecd -r
# Latest and continuous
journalctl -t olmecd -f

Resources

Community

Contributing

If you are interested in contributing to Olmec Core source, please review our code of conduct.

License

This software is licensed under the Apache 2.0 license. Read more about it here.

© 2021 Olmecform Labs, PTE LTD


 

Powering the innovation of money.

Directories

Path Synopsis
app
params
Package params defines the simulation parameters in the gaia.
Package params defines the simulation parameters in the gaia.
client
docs/statik
Package statik contains static assets.
Package statik contains static assets.
cmd
custom
auth/legacy/v040
Package v040 creates in-place store migrations for fixing multisig pubkey migration problem ref: https://github.com/olmec-money/core/issues/562
Package v040 creates in-place store migrations for fixing multisig pubkey migration problem ref: https://github.com/olmec-money/core/issues/562
auth/tx
Package tx is a reverse proxy.
Package tx is a reverse proxy.
gov
Package types nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/olmec-money/core/types/assets/ ALIASGEN: github.com/olmec-money/core/types/util/
Package types nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/olmec-money/core/types/assets/ ALIASGEN: github.com/olmec-money/core/types/util/
x
market/exported
DONTCOVER
DONTCOVER
market/legacy/v04
DONTCOVER nolint
DONTCOVER nolint
market/types
Package types is a reverse proxy.
Package types is a reverse proxy.
oracle/exported
DONTCOVER
DONTCOVER
oracle/keeper
nolint
nolint
oracle/legacy/v04
DONTCOVER nolint
DONTCOVER nolint
oracle/types
Package types is a reverse proxy.
Package types is a reverse proxy.
treasury/exported
DONTCOVER
DONTCOVER
nolint
treasury/legacy/v04
DONTCOVER nolint
DONTCOVER nolint
treasury/types
Package types is a reverse proxy.
Package types is a reverse proxy.
wasm/exported
nolint
nolint
wasm/legacy/v04
DONTCOVER nolint
DONTCOVER nolint
wasm/types
noalias Package types is a reverse proxy.
noalias Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL