Skip to content

Take a tour of BigBang

BigBang-Core edited this page Dec 20, 2019 · 14 revisions

Take a tour of BigBang

After you have finished the process of the installation of BigBang. Now you can try to use BigBang simply.

Okay, Let's get started with BigBang on this pleasant journey.

1. Create a world that accommodates Bigbang

1.1 Create a directory in your user directory

The name of this folder is whatever you like. (Recommend: The name of the folder is better not to contain any non-ASCII character)

# At this time, the name of folder is simply named bigbang
mkdir -p /home/[user-name]/bigbang

1.2 Create a configuration file

Create a configuration file in the folder that mentioned above.

The name of the configuration file is better called bigbang.conf(Although can be called by another name, but in this way, it should be explicitly specified by -conf parameter, which is not conducive to early learning).

The file contains a bunch of configurable items likes *.conf in other open source projects.

The simple example of the configuration file write down as follows:

cryptonightaddress=1965p604xzdrffvg90ax9bk0q3xyqn5zz2vc9zpbe3wdswzazj7d144mm
cryptonightkey=9f1e445c2a8e74fabbb7c53e31323b2316112990078cbd8d27b2cd7100a1648d
mpvssaddress=1965p604xzdrffvg90ax9bk0q3xyqn5zz2vc9zpbe3wdswzazj7d144mm
mpvsskey=c00f1c287f0d9c0931b1b3f540409e8f7ad362427df4a75286992cb9200096b1
rpcmaxconnections=200
maxconnections=200
listen4 # listen in P2P network layer
dnseed=15.188.165.143
rpclisten4 # rpc server listen
rpcallowip=*.*.*.* # rpc ip white list. At this time,enable rpc client with any ip address to request rpc server
addgroup=e96f1d8ec9bdc8e3b56a992f183d5c384603edabe655e4e839fdee9ec57b2abf # genesis fork in test network, please change genesis if you are in real network
dbname=bigbang
port=9903 # P2P listen port
rpcport=9904 # rpc listen port
testnet # enbale test network, if you want to configure real network please remove this option

You can copy the content written above to your created configuration file and save it.

Additional information: If you want to check more configurable items, you could run the command line as follows:

bigbang -help

It will show all of configurable items.

2. Use BigBang

2.1 Use one BigBang node on single physics machine

2.1.1 Run BigBang

bigbang -debug -daemon -datadir=[you created folder in 1.1 section]

# example
bigbang -debug -daemon -datadir=/home/[user-name]/bigbang >> ~/bigbang.log 2>&1

2.1.2 Entry Bigbang CLI of RPC Client

Run command as follows:

bigbang-cli

Then, an interactive RPC client command interface shows up in front of your eyes. All of the RPC command you can refer this.

2.1.3 Try Send Transaction

  • First, you should import a private key that have some of money
importprivkey 8eaf3fbf3c79a58535bc3426d16356104891c4904e97ce3ba541bb53423cc89e 123456

If did not report some of errors when the command returned and returned value is ff2d3a109b53b4dc0b01f5a373bd88c3ed569afb2e76ab076a269ce9f90d008e(public key according private key that imported), it might be import success.

And you can run command as follows:

getbalance

Then, you can see address 1hr00vyf9kgk6m1xberqfq6jpxq1rhfbkmftg22ywph9sp41t5qznwstq have 300000000.000000 available money(token).

  • Create your own address and key.
getnewkey [your password]
# example
getnewkey 123456

It will return your public key in hex string format, and you can run the command to get your address:

getpubkeyaddress [your public key]
# example
getpubkeyaddress ecc3191d22bb095bbeaff758f2b0cec282706f98826737aa125328760f7ab9a9
  • Unlock Key(have money) to prepare for sending transaction
unlockkey ff2d3a109b53b4dc0b01f5a373bd88c3ed569afb2e76ab076a269ce9f90d008e 123456
  • Send Transaction From an address to another address In this case, I will show you send transaction(contains 50 tokens) from an address to your address.
sendfrom 1hr00vyf9kgk6m1xberqfq6jpxq1rhfbkmftg22ywph9sp41t5qznwstq [your address] 1000000

The command above will returned transaction id when it success. You can use gettransaction command to get the detail information about the transaction.

  • Check your address balance if received 1000000.0 tokens
getbalance -a=[your address]

It will display the json below when it success:

[
    {
        "address" : "[your address hex format]",
        "avail" : 1000000.000000,
        "locked" : 0.000000,
        "unconfirmed" : 0.000000
    }
]

2.1.4 Create a new fork from specific block

Multi-fork chain model of the BigBang looks like a Git that you can create a fork from specific commit id to improve the work of your company or yours.

  • Make Origin to create the meta information about the fork, it includes you want to fork from specific block, owner public key, amount, fork name and symbol and so forth.
makeorigin [prev block hash] [owner public key] [new amount tokens in the fork] [fork name] [fork-symbol] 1.0 0
# example
makeorigin f1c529b4dc73555ed1667a3fbc33404d4326a29ab877509f574729a18d22d3d6 1n6wqm3vp519h5ahqcy19gvvggb1cxc7jb3vtzfjv16xj478srfp9x65x 1000000.0 fork-1 fork-1-symbol 1.0 0

It will show the json as follows when it success:

{
    "hash" : "d531e18a403f8b12b990105d415efe66ab78f085e3435f319e7bcec63f74db11",
    "hex" : "010000ff00d6545dd6d3228da12947579f5077b89aa226434d4033bc3f7a66d15e5573dcb429c5f10000000000000000000000000000000000000000000000000000000000000000878001000000e106666f726b2d31e20d666f726b2d312d73796d626f6c4301a4002d310100000000a540420f0000000000a664000000000000008700000000e82101a9b97a0f76285312aa376782986f7082c2ceb0f258f7afbe5b09bb221d19c3ecc9bf2a7bc59eeefd39e8e455e6abed0346385c3d182f996ab5e3c8bdc98e1d6fe98a1e0000000100000100d6545d0000000000000000000000000000000000000000000000000000000000000000000000000001a9b97a0f76285312aa376782986f7082c2ceb0f258f7afbe5b09bb221d19c3ec002d310100000000000000000000000006666f726b2d3100004033f251bbbdad05d8c171cfda8e9f18f021a0dd0f1e7408bd34181d01267daad71c87a405210d9a806b0cf02e833cd76a8b690f1c31b12b0857821713eff22d04"
}
  • Add New Fork Template
addnewtemplate fork '{"redeem":"[address]", "fork":"[hash field returned by makeorigin]"}'
# example
addnewtemplate fork '{"redeem":"1n6wqm3vp519h5ahqcy19gvvggb1cxc7jb3vtzfjv16xj478srfp9x65x", "fork":"d531e18a403f8b12b990105d415efe66ab78f085e3435f319e7bcec63f74db11"}'

it will display the template address when it success 20c0f7rj0m4k6c0203kzyh9a8v5ky9waewp83cwv7a2qwp6bm3ra4wvp0

  • Send Transaction from owner address to fork template address
sendfrom [owner address] [fork template address] [amount tokens] -f=[genesis fork] -d=[hex field returned by makeorigin]
# example
sendfrom 1n6wqm3vp519h5ahqcy19gvvggb1cxc7jb3vtzfjv16xj478srfp9x65x 20c0f7rj0m4k6c0203kzyh9a8v5ky9waewp83cwv7a2qwp6bm3ra4wvp0 1000000 -f=e96f1d8ec9bdc8e3b56a992f183d5c384603edabe655e4e839fdee9ec57b2abf -d=010000ff00d6545dd6d3228da12947579f5077b89aa226434d4033bc3f7a66d15e5573dcb429c5f10000000000000000000000000000000000000000000000000000000000000000878001000000e106666f726b2d31e20d666f726b2d312d73796d626f6c4301a4002d310100000000a540420f0000000000a664000000000000008700000000e82101a9b97a0f76285312aa376782986f7082c2ceb0f258f7afbe5b09bb221d19c3ecc9bf2a7bc59eeefd39e8e455e6abed0346385c3d182f996ab5e3c8bdc98e1d6fe98a1e0000000100000100d6545d0000000000000000000000000000000000000000000000000000000000000000000000000001a9b97a0f76285312aa376782986f7082c2ceb0f258f7afbe5b09bb221d19c3ec002d310100000000000000000000000006666f726b2d3100004033f251bbbdad05d8c171cfda8e9f18f021a0dd0f1e7408bd34181d01267daad71c87a405210d9a806b0cf02e833cd76a8b690f1c31b12b0857821713eff22d04

It will display transaction id returned by sendfrom, you can check the transaction util the transaction confirmed.

Finally, you can run listfork -a to list all of fork, you will find your fork you created.

2.2 Run multiply BigBang nodes on multiply physics machine

The operations of the section is nearly all the same like 2.1 section.

The difference is that some of nodes run on the P2P distributed enviroment. So you need create connections of the P2P network.

2.2.1 Create and Run a Bigbang node on another physics machine

  • Create another configure file and connect to the other node
cryptonightaddress=1965p604xzdrffvg90ax9bk0q3xyqn5zz2vc9zpbe3wdswzazj7d144mm
cryptonightkey=9f1e445c2a8e74fabbb7c53e31323b2316112990078cbd8d27b2cd7100a1648d
vssmpaddress=1965p604xzdrffvg90ax9bk0q3xyqn5zz2vc9zpbe3wdswzazj7d144mm
vssmpkey=c00f1c287f0d9c0931b1b3f540409e8f7ad362427df4a75286992cb9200096b1
rpcmaxconnections=200
maxconnections=200
listen4 # listen in P2P network layer
rpclisten4 # rpc server listen
rpcallowip=*.*.*.* # rpc ip white list. At this time,enable rpc client with any ip address to request rpc server
addgroup=e96f1d8ec9bdc8e3b56a992f183d5c384603edabe655e4e839fdee9ec57b2abf # genesis fork in test network, please change genesis if you are in real network
dbname=bigbang
port=9901 # P2P listen port
rpcport=9902 # rpc listen port
testnet # enbale test network, if you want to configure real network please remove this option
addnode=192.168.1.112:9901 # the other Bigbang node ip and listen port, you need change to meet your network
  • Run node
bigbang -debug -daemon -datadir=/home/[user-name]/bigbang >> ~/bigbang.log 2>&1

If you did not find any error in .log file. You will find that the node is synchronizing blocks of other nodes.

2.2.2 Entry Bigbang CLI of RPC Client

Run command as follows:

bigbang-cli

2.2.3 Try to check your transaction

Check your transaction sent on the other node

gettransaction [transaction id you sent before]

If the node is synchronized from the other node, you will see the information of transaction you sent before.

3. Tour finished

Now, you can access this page to start your fresh journey. :)

Clone this wiki locally