bchain

module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: GPL-3.0

README

bchain

bchain aims to build up a democratic ecosystem.

Supported platforms

bchain currently supports the following platforms:

  1. Linux
  2. Arm
  3. Darwin

windows platform node is in developing, will coming soon...

Bchaind

bchaind is the bchain node program.

Bchain-cli

bchain-cli is a simple node control program.

root@test245:/home/bc# ./bchain-cli
NAME:
   b chain simple wallet tool - A new cli application

USAGE:
   bchain-cli [global options] command [command options][arguments...]

VERSION:
   1.0.1

COMMANDS:
 account-create, acc-c         new a key store file with password. account-create {password}
 start-producer, s-p           start producing block. start-producer {password}
 bc-transfer, bc-tr            bchain BC transfer. bc-transfer {toAddr} {amount} {memo} {txFee(C)} {password}
 bc-nonceOf, bc-nof            bchain get account nonce. bc-nonceOf {Addr}
 bc-transferWithNonce, bc-trn  bchain BC transfer with nonce. bc-transferWithNonce {account nonce} {toAddr} {amount} {memo} {txFee(C)} {password}
 bc-balanceOf, bc-of           bchain BC balance of an addr. bc-balanceOf {Addr}
 bc-pledge, bc-pd              pledge bchain BC to pledge pool. bc-pledge {amount} {txFee(C)} {password}
 bc-redeem, bc-rd              redeem bchain BC from pledge pool. bc-redeem {amount} {txFee(C)} {password}
 bc-pledgeOf, bc-pdof          bchain BC pledge pool pledge of an addr. bc-pledgeOf {Addr}
 help, h                       Shows a list of commands or help for one 

GLOBAL OPTIONS:
   --url value, -u value  node url (default: "http://127.0.0.1:8989/")
   --help, -h             show help
   --version, -v          print the version

How to config node

  1. download program bchaind and bchain-cli

  2. download boot config file bootCommittee.json and node.toml

  3. create config directories

    root@test245:mkdir config -p
    

    move bootCommittee.json and node.toml to config directories.

Run a node

  1. create an account

    root@test245:/home/bc# ./bchain-cli acc-c 6789212
       password:  6789212
       WellCome to CreateAccount
       Print NewAccount Address:0x74b22c8abe8423cce73d14f3609907327208c4ac,   Url:keystore:///home/bc/keystore/UTC--2019-07-28T13-23-22.456113068Z--74b22c8abe8423cce73d14f3609907327208c4ac
       After Address:0x74b22c8abe8423cce73d14f3609907327208c4ac,   Url:keystore:///home/bc/keystore/UTC--2019-07-28T13-23-22.456113068Z--74b22c8abe8423cce73d14f3609907327208c4ac
    
  2. run bchaind

    root@test245:/home/bc# nohup ./bchaind >/dev/null &
    
  3. start producing block(before this, need to pledge BC...)

    root@test245:/home/bc# ./bchain-cli s-p 6789212
    password:  6789212
    {"jsonrpc":"2.0","id":"1","result":null}
    

Pledge BC

  1. pledge BC

    root@test245:/home/bc# ./bchain-cli bc-pd 50 100 6789212
    0x74b22C8aBE8423CcE73D14f3609907327208c4Ac
    from 0x74b22c8abe8423cce73d14f3609907327208c4ac amount(BC) 50 txfee(C) 100
    {"jsonrpc":"2.0","id":"1","result":"0x0"}
    
    nonceOf 0x74b22c8abe8423cce73d14f3609907327208c4ac is 0x0
    {"jsonrpc":"2.0","id":"1","result":"0x85fe99c37031219c7b13d67c6709efbc33eeae564eafdff8418b6e6496cfc342"}
    
  2. query pledge amount

    root@test245:/home/bc# ./bchain-cli bc-pdof 0x74b22c8abe8423cce73d14f3609907327208c4ac
    {"jsonrpc":"2.0","id":"1","result":["0x00f2052a01000000","0x00b1676e46000000","0xf53e000000000000"]}
    
    pledgeOf 0x74b22c8abe8423cce73d14f3609907327208c4ac is 50 BC
    pledge pool total is 3025 BC
    

Directories

Path Synopsis
src
bchain.io/accounts
Package accounts implements high level bchain account management.
Package accounts implements high level bchain account management.
bchain.io/accounts/keystore
Package keystore implements encrypted storage of secp256k1 private keys.
Package keystore implements encrypted storage of secp256k1 private keys.
bchain.io/blockproducer
Package blockproducer implements Bchain block creation and producing block.
Package blockproducer implements Bchain block creation and producing block.
bchain.io/common/bitutil
Package bitutil implements fast bitwise operations.
Package bitutil implements fast bitwise operations.
bchain.io/common/math
Package math provides integer math utilities.
Package math provides integer math utilities.
bchain.io/common/mclock
package mclock is a wrapper for a monotonic clock source
package mclock is a wrapper for a monotonic clock source
bchain.io/communication/p2p
Package p2p implements the Bchain p2p network protocols.
Package p2p implements the Bchain p2p network protocols.
bchain.io/communication/p2p/discover
Package discover implements the Node Discovery Protocol.
Package discover implements the Node Discovery Protocol.
bchain.io/communication/p2p/discv5
Package discv5 implements the Msgpx v5 Topic Discovery Protocol.
Package discv5 implements the Msgpx v5 Topic Discovery Protocol.
bchain.io/communication/p2p/nat
Package nat provides access to common network port mapping protocols.
Package nat provides access to common network port mapping protocols.
bchain.io/communication/p2p/netutil
Package netutil contains extensions to the net package.
Package netutil contains extensions to the net package.
bchain.io/communication/rpc
Package rpc provides access to the exported methods of an object across a network or other I/O connection.
Package rpc provides access to the exported methods of an object across a network or other I/O connection.
bchain.io/communication/rpc/bchainapi
Package bchainapi implements the general BCHAIN API functions.
Package bchainapi implements the general BCHAIN API functions.
bchain.io/core/interpreter/contract/jsre/deps
Package deps contains the console JavaScript dependencies Go embedded.
Package deps contains the console JavaScript dependencies Go embedded.
bchain.io/core/interpreter/jsre/deps
Package deps contains the console JavaScript dependencies Go embedded.
Package deps contains the console JavaScript dependencies Go embedded.
bchain.io/core/state
Package state provides a caching layer atop the Ethereum state trie.
Package state provides a caching layer atop the Ethereum state trie.
bchain.io/log
Package btclog defines an interface and default implementation for subsystem logging.
Package btclog defines an interface and default implementation for subsystem logging.
bchain.io/node/services/bchain
Package bchain implements the Bchain protocol.
Package bchain implements the Bchain protocol.
bchain.io/node/services/bchain/downloader
Package downloader contains the manual full chain synchronisation.
Package downloader contains the manual full chain synchronisation.
bchain.io/node/services/bchain/filters
Package filters implements an bchain filtering system for block, transactions and log events.
Package filters implements an bchain filtering system for block, transactions and log events.
bchain.io/trie
Package trie implements Merkle Patricia Tries.
Package trie implements Merkle Patricia Tries.
bchain.io/utils/bloom
Package bloombits implements bloom filtering on batches of data.
Package bloombits implements bloom filtering on batches of data.
bchain.io/utils/crypto/bn256
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
bchain.io/utils/crypto/secp256k1
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
bchain.io/utils/crypto/sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
bchain.io/utils/event
Package event deals with subscriptions to real-time events.
Package event deals with subscriptions to real-time events.
bchain.io/utils/event/filter
Package filter implements event filters.
Package filter implements event filters.
bchain.io/utils/metrics
Go port of Coda Hale's Metrics library
Go port of Coda Hale's Metrics library
bchain.io/utils/metrics/exp
Hook go-metrics into expvar on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler
Hook go-metrics into expvar on any /debug/metrics request, load all vars from the registry into expvar, and execute regular expvar handler

Jump to

Keyboard shortcuts

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