lbm-sdk

module
v0.43.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: Apache-2.0

README

The LBM SDK is a framework for building blockchain applications in Golang. It is being used to build LBM, the first implementation of the LINE Blockchain Mainnet. This is forked from cosmos-sdk at 2021-03-15.

WARNING: Breaking changes may occur because this repository is still in the pre-release development phase.

Note: Requires Go 1.15+

What is the LBM SDK?

The LBM SDK is an open-source framework for building multi-asset public Proof-of-Stake (PoS) blockchains, as well as permissioned Proof-Of-Authority (PoA) blockchains. Blockchains built with the Cosmos SDK are generally referred to as application-specific blockchains.

The purpose of LBM SDK is to succeed to the objectives of Cosmos sdk while helping develop blockchains that requires faster transaction processing to be applied to reality.

Why the LBM SDK?

Cosmos-sdk, which created the philosophy of application-specific blockchain, established its status as a framework for various application blockchain development. LBM SDK inherited this cosmos-sdk philosophy, addressing slow transaction processing problem that was difficult for cosmos-sdk to apply in real financial system. Real financial systems require thousands of processing performance per second, with LBM SDK adding many performance improvements to meet that demand. The following work was carried out to improve performance.

  • Concurrent checkTx, deliverTx
  • Use fastcache for inter block cache and nodedb cache of iavl
  • Lock granularity enhancement

In addition, the following functions were added:

  • Virtual machine using cosmwasm that makes smart contracts possible to be executed
  • Use Ostracon as consensus engine instead of Tendermint

To learn about Cosmos SDK, please refer Cosmos SDK Docs.

Quick Start

Build

make build
make install

# you can see the version!
simd version

 

Configure

zsh init_node.sh sim {N(number of nodes), default=1}

 

Run

# run a node
simd start --home ~/.simapp/simapp0

# If N is larger than 1, run all node.
# simapp0 has other nodes as persistant_peer. 
simd start --home ~/.simapp/simapp0
simd start --home ~/.simapp/simapp1
...

Visit with your browser

 

Follow Guide

Create new account

simd keys add user0 --keyring-backend test --home ~/.simapp/simapp0

# check if new account was added successfully
simd keys list --keyring-backend test --home ~/.simapp/simapp0               

Let the user0 and validator0 account address be each

  • user0: link1lu5hgjp2gyvgdpf674aklzrpdeuyhjr4fsuqrj
  • validator0: link146asaycmtydq45kxc8evntqfgepagygelel00h

If you run multi node, home option's value can be ~/.simapp/simapp1, ~/.simapp/simapp2, ... You can get same result whatever --home option you use

 

Send funds(Bank)

# user0 balances: "0"
simd query bank balances link1lu5hgjp2gyvgdpf674aklzrpdeuyhjr4fsuqrj --home ~/.simapp/simapp0

# validator0 balances: 90000000000stake, 100000000000ukrw
simd query bank balances link146asaycmtydq45kxc8evntqfgepagygelel00h --home ~/.simapp/simapp0

# send 10000stake from validator0 to user0
simd tx bank send link146asaycmtydq45kxc8evntqfgepagygelel00h link1lu5hgjp2gyvgdpf674aklzrpdeuyhjr4fsuqrj 10000000000stake --keyring-backend test --chain-id sim --home ~/.simapp/simapp0

# user0 balances: 10000000000stake
simd query bank balances link1lu5hgjp2gyvgdpf674aklzrpdeuyhjr4fsuqrj --home ~/.simapp/simapp0

# validator0 balances: 80000000000stake, 100000000000ukrw
simd query bank balances link146asaycmtydq45kxc8evntqfgepagygelel00h --home ~/.simapp/simapp0

 

Staking(deligate)

# Bech32 Val is operator address of validator0
simd debug addr link146asaycmtydq45kxc8evntqfgepagygelel00h --home ~/.simapp/simapp0

Let the validator0 operator address be linkvaloper146asaycmtydq45kxc8evntqfgepagygeddajpy

 

# deligate 10000000000stake to validator0
simd tx staking delegate linkvaloper146asaycmtydq45kxc8evntqfgepagygeddajpy 10000000000stake 
--from link1lu5hgjp2gyvgdpf674aklzrpdeuyhjr4fsuqrj --keyring-backend test --chain-id sim --home ~/.simapp/simapp0

# check if deligation was successful
simd query staking validators --chain-id sim --home ~/.simapp/simapp0

# undeligate 10000000000stake from validator
simd tx staking unbond linkvaloper146asaycmtydq45kxc8evntqfgepagygeddajpy 10000000000stake --from link1lu5hgjp2gyvgdpf674aklzrpdeuyhjr4fsuqrj --keyring-backend test --chain-id sim --home ~/.simapp/simapp0

# check if undeligation was successful
simd query staking validators --chain-id sim --home ~/.simapp/simapp0

 

Test different commands to get a broader understanding of lbm

Directories

Path Synopsis
grpc/reflection
Package reflection is a reverse proxy.
Package reflection is a reverse proxy.
grpc/tmservice
Package tmservice is a reverse proxy.
Package tmservice is a reverse proxy.
rpc
tx
legacy
Package legacy contains a global amino Cdc which is deprecated but still used in several places within the SDK.
Package legacy contains a global amino Cdc which is deprecated but still used in several places within the SDK.
types
Package types defines a custom wrapper for google.protobuf.Any which supports cached values as well as InterfaceRegistry which keeps track of types which can be used with Any for both security and introspection
Package types defines a custom wrapper for google.protobuf.Any which supports cached values as well as InterfaceRegistry which keeps track of types which can be used with Any for both security and introspection
unknownproto
unknownproto implements functionality to "type check" protobuf serialized byte sequences against an expected proto.Message to report: a) Unknown fields in the stream -- this is indicative of mismatched services, perhaps a malicious actor b) Mismatched wire types for a field -- this is indicative of mismatched services Its API signature is similar to proto.Unmarshal([]byte, proto.Message) in the strict case if err := RejectUnknownFieldsStrict(protoBlob, protoMessage, false); err != nil { // Handle the error.
unknownproto implements functionality to "type check" protobuf serialized byte sequences against an expected proto.Message to report: a) Unknown fields in the stream -- this is indicative of mismatched services, perhaps a malicious actor b) Mismatched wire types for a field -- this is indicative of mismatched services Its API signature is similar to proto.Unmarshal([]byte, proto.Message) in the strict case if err := RejectUnknownFieldsStrict(protoBlob, protoMessage, false); err != nil { // Handle the error.
cosmovisor module
hd
Package hd provides support for hierarchical deterministic wallets generation and derivation.
Package hd provides support for hierarchical deterministic wallets generation and derivation.
keyring
Package keys provides common key management API.
Package keys provides common key management API.
keys/secp256k1/internal/secp256k1
nolint:gocritic Package secp256k1 wraps the bitcoin secp256k1 C library.
nolint:gocritic Package secp256k1 wraps the bitcoin secp256k1 C library.
The commands from the SDK are defined with `cobra` and configured with the `viper` package.
The commands from the SDK are defined with `cobra` and configured with the `viper` package.
api
cmd
mock
nolint
nolint
params
Package params defines the simulation parameters in the simapp.
Package params defines the simulation parameters in the simapp.
Package std defines all the common and standard inter-module Cosmos SDK types and definitions modules and applications can depend on.
Package std defines all the common and standard inter-module Cosmos SDK types and definitions modules and applications can depend on.
mem
tests
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
cli
network
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
errors
Package errors implements custom error interfaces for cosmos-sdk.
Package errors implements custom error interfaces for cosmos-sdk.
kv
module
Package module contains application module patterns and associated "manager" functionality.
Package module contains application module patterns and associated "manager" functionality.
rest
Package rest provides HTTP types and primitives for REST requests validation and responses handling.
Package rest provides HTTP types and primitives for REST requests validation and responses handling.
tx
Package tx is a reverse proxy.
Package tx is a reverse proxy.
Package version is a convenience utility that provides SDK consumers with a ready-to-use version command that produces apps versioning information based on flags passed at compile time.
Package version is a convenience utility that provides SDK consumers with a ready-to-use version command that produces apps versioning information based on flags passed at compile time.
x
auth/tx
Package tx 's xauthclient.go file is copy-pasted from https://github.com/line/lbm-sdk/blob/v0.41.3/x/auth/client/query.go It is duplicated as to not introduce any breaking change in 0.41.4, see PR: https://github.com/line/lbm-sdk/pull/8732#discussion_r584746947
Package tx 's xauthclient.go file is copy-pasted from https://github.com/line/lbm-sdk/blob/v0.41.3/x/auth/client/query.go It is duplicated as to not introduce any breaking change in 0.41.4, see PR: https://github.com/line/lbm-sdk/pull/8732#discussion_r584746947
auth/types
Package types is a reverse proxy.
Package types is a reverse proxy.
bank/types
Package types is a reverse proxy.
Package types is a reverse proxy.
distribution
Package distribution implements a Cosmos SDK module, that provides an implementation of the F1 fee distribution algorithm.
Package distribution implements a Cosmos SDK module, that provides an implementation of the F1 fee distribution algorithm.
distribution/types
nolint Package types is a reverse proxy.
nolint Package types is a reverse proxy.
evidence
Package evidence implements a Cosmos SDK module, per ADR 009, that allows for the submission and handling of arbitrary evidence of misbehavior.
Package evidence implements a Cosmos SDK module, per ADR 009, that allows for the submission and handling of arbitrary evidence of misbehavior.
evidence/types
DONTCOVER Package types is a reverse proxy.
DONTCOVER Package types is a reverse proxy.
genaccounts
Package genaccounts is now deprecated.
Package genaccounts is now deprecated.
genutil
Package genutil contains a variety of genesis utility functionality for usage within a blockchain application.
Package genutil contains a variety of genesis utility functionality for usage within a blockchain application.
gov
gov/types
Package types is a reverse proxy.
Package types is a reverse proxy.
ibc/applications/transfer/types
Package types is a reverse proxy.
Package types is a reverse proxy.
ibc/core/02-client
Package client implements the ICS 02 - Client Semantics specification https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics.
Package client implements the ICS 02 - Client Semantics specification https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics.
ibc/core/02-client/types
Package types is a reverse proxy.
Package types is a reverse proxy.
ibc/core/03-connection/types
Package types is a reverse proxy.
Package types is a reverse proxy.
ibc/core/04-channel/types
Package types is a reverse proxy.
Package types is a reverse proxy.
ibc/light-clients/06-solomachine
Package solomachine implements a concrete `ConsensusState`, `Header`, `Misbehaviour` and `Equivocation` types for the Solo Machine light client.
Package solomachine implements a concrete `ConsensusState`, `Header`, `Misbehaviour` and `Equivocation` types for the Solo Machine light client.
ibc/light-clients/09-localhost
Package localhost implements a concrete `ConsensusState`, `Header`, `Misbehaviour` and `Equivocation` types for the loop-back client.
Package localhost implements a concrete `ConsensusState`, `Header`, `Misbehaviour` and `Equivocation` types for the loop-back client.
ibc/light-clients/99-ostracon
Package tendermint implements a concrete `ConsensusState`, `Header`, `Misbehaviour` and `Equivocation` types for the Tendermint consensus light client.
Package tendermint implements a concrete `ConsensusState`, `Header`, `Misbehaviour` and `Equivocation` types for the Tendermint consensus light client.
ibc/testing/mock
This package is only intended to be used for testing core IBC.
This package is only intended to be used for testing core IBC.
mint/types
Package types is a reverse proxy.
Package types is a reverse proxy.
params
Package params provides a namespaced module parameter store.
Package params provides a namespaced module parameter store.
params/types
To prevent namespace collision between consumer modules, we define a type Subspace.
To prevent namespace collision between consumer modules, we define a type Subspace.
params/types/proposal
Package proposal is a reverse proxy.
Package proposal is a reverse proxy.
simulation
Package simulation implements a full fledged Cosmos SDK application used for executing simulation test suites.
Package simulation implements a full fledged Cosmos SDK application used for executing simulation test suites.
slashing/types
noalias noalias DONTCOVER Package types is a reverse proxy.
noalias noalias DONTCOVER Package types is a reverse proxy.
staking/types
Package types is a reverse proxy.
Package types is a reverse proxy.
upgrade
Package upgrade provides a Cosmos SDK module that can be used for smoothly upgrading a live Cosmos chain to a new software version.
Package upgrade provides a Cosmos SDK module that can be used for smoothly upgrading a live Cosmos chain to a new software version.
upgrade/types
Package types is a reverse proxy.
Package types is a reverse proxy.
wasm
nolint
nolint
wasm/types
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

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