friday

module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: Apache-2.0

README

Travis codecov

TESTNET

Prerequisites

Build

make install

Run

Setup a genesis status and run a genesis node
  • note: Fill the name what you want inside < >
# run execution engine grpc server
./CasperLabs/execution-engine/target/release/casperlabs-engine-grpc-server $HOME/.casperlabs/.casper-node.sock

# init node
nodef init <node_name> --chain-id testnet

# copy execution engine chain configurations
cp ./x/executionlayer/resources/manifest.toml ~/.nodef/config

# create a wallet key
clif keys add elsa # select password
clif keys add anna # select password

# add genesis node
nodef add-genesis-account $(clif keys show elsa -a) 5000000000000dummy,100000000stake
nodef add-genesis-account $(clif keys show anna -a) 5000000000000dummy,100000000stake
nodef add-el-genesis-account $(clif keys show elsa -a) "5000000000000" "1000000"
nodef add-el-genesis-account $(clif keys show anna -a) "5000000000000" "1000000"
nodef load-chainspec ~/.nodef/config/manifest.toml

# apply default clif configure
clif config chain-id testnet
clif config output json
clif config indent true
clif config trust-node true

# prepare genesis status
nodef gentx --name elsa # insert password
nodef collect-gentxs
nodef validate-genesis
  • genesis node start
nodef start
  • note your genesis node's ID and genesis file
  • you can get your node ID using clif
clif status | grep \"id\"
  • your genesis file exists ~/.nodef/config/genesis.json
Clif usage
  • query
    • usage: clif executionlayer getbalance [address]
clif executionlayer getbalance $(clif keys show elsa -a)

{
   "value": "5000000000000"
}
  • transfer (send)
    • usage: clif executionlayer transfer [token_contract_address] [from_address] [to_address] [amount] [fee] [gas_price]
    • token_contract_address is currently dummy, and you may input as same as from_address
clif executionlayer transfer $(clif keys show elsa -a) $(clif keys show elsa -a) $(clif keys show anna -a) 1000000 100000000 20000000

...
confirm transaction before signing and broadcasting [y/N]: y
Password to sign with 'elsa': # input your password
{
  "height": "0",
  "txhash": "141F12A891659F52B055EF7F701B1D406E5F1721CE929630CC5CE3CE0C4C8718",
  "raw_log": "[{\"msg_index\":0,\"success\":true,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"executionengine\"}]}]}]",
  "logs": [
    {
      "msg_index": 0,
      "success": true,
      "log": "",
      "events": [
        {
          "type": "message",
          "attributes": [
            {
              "key": "action",
              "value": "executionengine"
            }
          ]
        }
      ]
    }
  ]
}
  • bond
    • usage: clif executionlayer bond
./clif executionlayer bond \
--from $(clif keys show elsa -a) \
--validator fridayvaloper19rxdgfn3grqgwc6zhyeljmyas3tsawn64dsges \
--amount 1000000 \
--fee 10000000 \
--gas-price 30000000

confirm transaction before signing and broadcasting [y/N]: y
Password to sign with 'elsa':
{
  "height": "0",
  "txhash": "22DF1E0D8D9EB8BE2B5F50995C6FC0AB20E34715875A9F9856A9466A8C406807",
  "raw_log": "[{\"msg_index\":0,\"success\":true,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"executionengine\"}]}]}]",
  "logs": [
    {
      "msg_index": 0,
      "success": true,
      "log": "",
      "events": [
        {
          "type": "message",
          "attributes": [
            {
              "key": "action",
              "value": "executionengine"
            }
          ]
        }
      ]
    }
  ]
}
  • unbond
    • usage: clif executionlayer unbond [from_address] [unbond_amount] [fee] [gas_price]
./clif executionlayer unbond \
--from $(clif keys show elsa -a) \
--validator fridayvaloper19rxdgfn3grqgwc6zhyeljmyas3tsawn64dsges \
--amount 1000000 \
--fee 10000000 \
--gas-price 30000000

confirm transaction before signing and broadcasting [y/N]: y
Password to sign with 'elsa':
{
  "height": "0",
  "txhash": "69C51D25E3E5DB4F2D4ACE832C775DC8EE993E9CDB7560A3AF470FF07CC7FFC9",
  "raw_log": "[{\"msg_index\":0,\"success\":true,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"executionengine\"}]}]}]",
  "logs": [
    {
      "msg_index": 0,
      "success": true,
      "log": "",
      "events": [
        {
          "type": "message",
          "attributes": [
            {
              "key": "action",
              "value": "executionengine"
            }
          ]
        }
      ]
    }
  ]
}
Connect to seed node
  • run this on another machine
# run execution engine grpc server
./CasperLabs/execution-engine/target/release/casperlabs-engine-grpc-server $HOME/.casperlabs/.casper-node.sock

# init node
nodef init <node_name> --chain-id testnet
  • edit ~/.nodef/config/config.toml
...
# Comma separated list of seed nodes to connect to
seeds = "" -> "<genesis node's ID>@<genesis node's IP>:26656"
...
  • replace ~/.nodef/config/genesis.json to genesis node's one what you saved above.
Running validator
  • run this on another machine
  • create a wallet key
clif keys add bryan # select password
  • show AccAddress & ValAddress
# AccAddress
clif keys show bryan --bech acc

{
  "name": "bryan",
  "type": "local",
  "address": "friday19rxdgfn3grqgwc6zhyeljmyas3tsawn6qe0quc",
  "pubkey": "fridaypub1addwnpepqfaxrvy4f95duln3t6vvtd0qd0sdpwfsn3fh9snpnq06w25qualj6rxm04t"
}

# ValAddress
clif keys show bryan --bech val

{
  "name": "bryan",
  "type": "local",
  "address": "fridayvaloper19rxdgfn3grqgwc6zhyeljmyas3tsawn64dsges",
  "pubkey": "fridayvaloperpub1addwnpepqfaxrvy4f95duln3t6vvtd0qd0sdpwfsn3fh9snpnq06w25qualj6vczad0"
}
  • create validator
 clif executionlayer create-validator \
--from=friday19rxdgfn3grqgwc6zhyeljmyas3tsawn6qe0quc \
--pubkey=$(nodef tendermint show-validator) \
--moniker=bryan
  • bonding amount
clif executionlayer bond \
--from friday19rxdgfn3grqgwc6zhyeljmyas3tsawn6qe0quc \
--validator fridayvaloper19rxdgfn3grqgwc6zhyeljmyas3tsawn64dsges \
--amount 1000000 \
--fee 10000000 \
--gas-price 30000000 \

Test

# run execution engine grpc server
./CasperLabs/execution-engine/target/release/casperlabs-engine-grpc-server $HOME/.casperlabs/.casper-node.sock

# run test
make test

Directories

Path Synopsis
nolint
nolint
Package baseapp contains data structures that provide basic data storage functionality and act as a bridge between the ABCI interface and the SDK abstractions.
Package baseapp contains data structures that provide basic data storage functionality and act as a bridge between the ABCI interface and the SDK abstractions.
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/client/context ALIASGEN: github.com/cosmos/cosmos-sdk/client/flags ALIASGEN: github.com/cosmos/cosmos-sdk/client/keys ALIASGEN: github.com/cosmos/cosmos-sdk/client/lcd ALIASGEN: github.com/cosmos/cosmos-sdk/client/rest ALIASGEN: github.com/cosmos/cosmos-sdk/client/rpc ALIASGEN: github.com/cosmos/cosmos-sdk/client/tx ALIASGEN: github.com/cosmos/cosmos-sdk/client/utils ALIASGEN: github.com/cosmos/cosmos-sdk/client/input
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/client/context ALIASGEN: github.com/cosmos/cosmos-sdk/client/flags ALIASGEN: github.com/cosmos/cosmos-sdk/client/keys ALIASGEN: github.com/cosmos/cosmos-sdk/client/lcd ALIASGEN: github.com/cosmos/cosmos-sdk/client/rest ALIASGEN: github.com/cosmos/cosmos-sdk/client/rpc ALIASGEN: github.com/cosmos/cosmos-sdk/client/tx ALIASGEN: github.com/cosmos/cosmos-sdk/client/utils ALIASGEN: github.com/cosmos/cosmos-sdk/client/input
lcd
lcd/statik
Package statik contains static assets.
Package statik contains static assets.
rpc
cmd
keys/hd
Package hd provides basic functionality Hierarchical Deterministic Wallets.
Package hd provides basic functionality Hierarchical Deterministic Wallets.
mock
nolint
nolint
Package simapp implements a full fledged Cosmos SDK application used for executing simulation test suites.
Package simapp implements a full fledged Cosmos SDK application used for executing simulation test suites.
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.
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
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/auth/types nolint
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/auth/types nolint
auth/legacy/v0_34
DONTCOVER nolint
DONTCOVER nolint
auth/legacy/v0_36
DONTCOVER nolint DONTCOVER nolint
DONTCOVER nolint DONTCOVER nolint
auth/types
nolint noalias
nolint noalias
bank
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/bank/types
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/bank/types
crisis
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/crisis/types
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/crisis/types
nolint
distribution
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/distribution/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/distribution/types ALIASGEN: github.com/cosmos/cosmos-sdk/x/distribution/client
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/distribution/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/distribution/types ALIASGEN: github.com/cosmos/cosmos-sdk/x/distribution/client
nolint
distribution/legacy/v0_34
DONTCOVER nolint
DONTCOVER nolint
distribution/legacy/v0_36
DONTCOVER nolint
DONTCOVER nolint
distribution/types
nolint nolint
nolint nolint
genaccounts
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/genaccounts/internal/types Package genaccounts contains specialized functionality for initializing accounts from genesis including: - genesis account validation, - initchain processing of genesis accounts, - export processing (to genesis) of accounts, - server command for adding accounts to the genesis file.
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/genaccounts/internal/types Package genaccounts contains specialized functionality for initializing accounts from genesis including: - genesis account validation, - initchain processing of genesis accounts, - export processing (to genesis) of accounts, - server command for adding accounts to the genesis file.
genaccounts/legacy/v0_34
DONTCOVER nolint
DONTCOVER nolint
genaccounts/legacy/v0_36
DONTCOVER nolint DONTCOVER nolint
DONTCOVER nolint DONTCOVER nolint
genutil
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/genutil/types Package genutil contains a variety of genesis utility functionality for usage within a blockchain application.
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/genutil/types Package genutil contains a variety of genesis utility functionality for usage within a blockchain application.
gov
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/gov/types nolint:deadcode unused
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/gov/types nolint:deadcode unused
gov/legacy/v0_34
DONTCOVER nolint
DONTCOVER nolint
gov/legacy/v0_36
DONTCOVER nolint
DONTCOVER nolint
gov/types
nolint
nolint
mint
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/mint/internal/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/mint/internal/types
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/mint/internal/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/mint/internal/types
mint/internal/keeper
nolint:deadcode unused
nolint:deadcode unused
mock
Package mock provides utility methods to ease writing tests.
Package mock provides utility methods to ease writing tests.
params
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/params/subspace ALIASGEN: github.com/cosmos/cosmos-sdk/x/params/types nolint: deadcode unused
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/params/subspace ALIASGEN: github.com/cosmos/cosmos-sdk/x/params/types nolint: deadcode unused
simulation
Package simulation implements a simulation framework for any state machine built on the SDK which utilizes auth.
Package simulation implements a simulation framework for any state machine built on the SDK which utilizes auth.
slashing
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/slashing/types nolint nolint:deadcode unused
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/slashing/types nolint nolint:deadcode unused
nolint
staking
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/staking/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/staking/types ALIASGEN: github.com/cosmos/cosmos-sdk/x/staking/exported
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/staking/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/staking/types ALIASGEN: github.com/cosmos/cosmos-sdk/x/staking/exported
staking/legacy/v0_34
DONTCOVER nolint
DONTCOVER nolint
staking/legacy/v0_36
DONTCOVER nolint DONTCOVER nolint
DONTCOVER nolint DONTCOVER nolint
staking/types
nolint
nolint
supply
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/supply/internal/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/supply/internal/types
nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/supply/internal/keeper ALIASGEN: github.com/cosmos/cosmos-sdk/x/supply/internal/types
supply/legacy/v0_36
DONTCOVER nolint
DONTCOVER nolint

Jump to

Keyboard shortcuts

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