get started linux - SkycoinWikis/CXChains GitHub Wiki
HOME » CX » CX CHAINS » GET STARTED LINUX
Setup Process
First, this introduction assumes that you have a working CX installation, installed from the CX sources. If you do not, then first, follow the instructions in the sources on how to do that.
NOTE: At the current early stage, you need to run this on Linux, since the CX blockchain has not been tested on Windows or MacOS X.
After you have a working CX, perform the following steps:
- Update your CX repository:
$ cd $GOPATH/src/github.com/skycoin/cx
$ git pull origin develop
- Recompile with
make build
- Run
cx --generate-address
and write down the result. - Replace the fields
blockchain_pubkey_str
andgenesis_address_str
in./fiber.toml
with the values generated bycx --generate-address
(public_key
andaddress
, respectively) - Run
cx --blockchain --heap-initial 100 --stack-size 100 \
--secret-key $SECRET_KEY \
--public-key $PUBLIC_KEY \
./examples/blockchain/counter-bc.cx
- Write down the blockchain's genesis signature that is shown at the bottom. CX will update fiber.toml's
genesis_signature_str
field with your new genesis signature. - Start a publisher node (use the data obtained from running the previous commands; you can create bash variables that hold these values for convenience):
cx --publisher --genesis-address $GENESIS_ADDRESS \
--genesis-signature $GENESIS_SIGNATURE \
--secret-key $SECRET_KEY \
--public-key $PUBLIC_KEY
- Run a peer node (for now, it MUST use port 6001):
cx --peer --genesis-address $GENESIS_ADDRESS \
--port 6001 \
--genesis-signature $GENESIS_SIGNATURE \
--public-key $PUBLIC_KEY
- Create a wallet (for now you need to use this seed. This will be changed ASAP):
cx --create-wallet --wallet-seed "museum nothing practice weird wheel dignity economy attend mask recipe minor dress"
- Restart your peer node by pressing
Ctrl-C
to stop the peer node process, and then run again this:
cx --peer --genesis-address $GENESIS_ADDRESS \
--port 6001 \
--genesis-signature $GENESIS_SIGNATURE \
--public-key $PUBLIC_KEY
- You can test a transaction (without broadcasting the new program state) with:
cx --transaction examples/blockchain/counter-txn.cx
- And you can broadcast it with:
cx --secret-key $SECRET_KEY --broadcast examples/blockchain/counter-txn.cx