BitSong is a new music streaming platform based on Tendermint consensus BFT, the Cosmos SDK toolkits and the IPFS distribuited filesystem. Please make sure you study these projects as well if you are not already familiar.
BitSong is a project dedicated to musicians and their fans, which aims to overcome the bureaucratic and economic obstacles within this industry and reward artists and users for simply using the platform.
Artists need no longer to wait several months before a record label sends various reports, they can check the progress in real time directly within the Wallet.
NOTE: This is alpha software. Please contact us if you aim to run it in production.
Note: Requires Go 1.13.6+
There are many ways you can install BitSong Blockchain Testnet node on your machine.
Install Go by following the official docs. Remember to set your
$PATH environment variables, for example:
wget https://dl.google.com/go/go1.13.6.linux-amd64.tar.gzsudo tar -xvzf go1.13.6.linux-amd64.tar.gzsudo mv go /usr/localcat <<EOF >> ~/.profileexport GOPATH=$HOME/goexport GO111MODULE=onexport PATH=$PATH:/usr/local/go/bin:$HOME/go/binEOF
Clone BitSong source code to your machine
mkdir -p $GOPATH/src/github.com/BitSongOfficialcd $GOPATH/src/github.com/BitSongOfficialgit clone https://github.com/BitSongOfficial/go-bitsong.gitcd go-bitsonggit checkout v0.3.1
# Install the app into your $GOBINmake install# Now you should be able to run the following commands:bitsongd helpbitsongcli help
go-bitsong version is now installed.
To initialize configuration and a
genesis.json file for your application and an account for the transactions, start by running:
NOTE: In the below commands addresses are are pulled using terminal utilities. You can also just input the raw strings saved from creating keys, shown below. The commands require
jqto be installed on your machine.
NOTE: If you have run the tutorial before, you can start from scratch with a
bitsongd unsafe-reset-allor by deleting both of the home folders
rm -rf ~/.bitsong*
NOTE: If you have the Cosmos app for ledger and you want to use it, when you create the key with
bitsongcli keys add jackjust add
--ledgerat the end. That's all you need. When you sign,
jackwill be recognized as a Ledger key and will require a device.
# Initialize configuration files and genesis filebitsongd init MyValidator --chain-id bitsong-local-1# Configure your CLI to eliminate need for chain-id flagbitsongcli config chain-id bitsong-local-1bitsongcli config output jsonbitsongcli config indent truebitsongcli config trust-node true# Change default bond token genesis.jsonsed -i 's/stake/ubtsg/g' ~/.bitsongd/config/genesis.json# Copy the `Address` output here and save it for later use# [optional] add "--ledger" at the end to use a Ledger Nano Sbitsongcli keys add jack# Copy the `Address` output here and save it for later usebitsongcli keys add alice# Generate the transaction that creates your validatorbitsongd gentx --name jack --amount=150000000ubtsg# Add both accounts, with coins to the genesis filebitsongd add-genesis-account $(bitsongcli keys show jack -a) 150000000000ubtsgbitsongd add-genesis-account $(bitsongcli keys show alice -a) 150000000000ubtsg# Add the generated bonding transaction to the genesis filebitsongd collect-gentxsbitsongd validate-genesis# Now its safe to start `bitsongd`bitsongd start
You can now start
bitsongd by calling
bitsongd start. You will see logs begin streaming that represent blocks being produced, this will take a couple of seconds.
Open another terminal to run commands against the network you have just created:
# First check the accounts to ensure they have fundsbitsongcli query account $(bitsongcli keys show jack -a)bitsongcli query account $(bitsongcli keys show alice -a)
You can now start the first transaction
bitsongcli tx send --from=$(bitsongcli keys show jack -a) $(bitsongcli keys show alice -a) 10ubtsg
Query an account
bitsongcli query account $(bitsongcli keys show jack -a)
bitsongcli tx track create --title "The Show Must Go On" \--audio="QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u" \--image="QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u" \--duration 385 \--genre "pop" \--mood "happy" \--artists "Queen" \--featuring "Angelo" \--producers "Angelo" \--description="The track description" \--copyright="My Copyright info" \--from jack \-b block
bitsongcli tx track deposit 1 10000000ubtsg --from jackbitsongcli tx track deposit 1 10000000ubtsg --from alicebitsongcli tx track deposit 1 80000000ubtsg --from alice
Currently payout epoch: 60 blocks
bitsongcli tx track play 1 --from alice
# Query all tracks with status Nilbitsongcli query track all# Query all tracks with status DepositPeriodbitsongcli query track all --status DepositPeriod# Query all tracks with status Rejectedbitsongcli query track all --status Rejected# Query all tracks with status Failedbitsongcli query track all --status Failed# Query all tracks with status Verifiedbitsongcli query track all --status Verified# Query track by IDbitsongcli query track track 1# Query plays by track IDbitsongcli query track plays 1# Query all track sharesbitsongcli query track shares# Query total deposits on trackbitsongcli query track deposits 1
Query the Reward Pool
bitsongcli query reward all
BitSong uses SemVer to determine when and how the version changes. According to SemVer, anything in the public API can change at any time before version 1.0.0
To provide some stability to BitSong users in these 0.X.X days, the MINOR version is used to signal breaking changes across a subset of the total public API. This subset includes all interfaces exposed to other processes, but does not include the in-process Go APIs.