Fibercoin Creation

reference:

Deployment Considerations - Network

A typical production deployment for a fibercoin, following the example of skycoin, has the following subdomains and endpoints. I have attempted to mirror this configuration with magnetosphere.net for demonstration

  • node.skycoin.com - used by mobile wallets
  • explorer.skycoin.com - the url of the explorer
  • downloads.skycoin.com/blockchain/peers.txt - peers.txt url

furthermore, it is likely needed to forward the port (referenced in peers.txt) to the machine hosting the node endpoint.

LAN IP addresses can be set initially for testing purposes.

Satisfy Dependencies

Note: requires git and go

  • git clone the skycoin source code
mkdir -p $HOME/go/src/github.com/skycoin
cd $HOME/go/src/github.com/skycoin
git clone https://github.com/skycoin/skycoin
cd skycoin

NOTE: run all commands from within that directory NOTE: the default branch should be ‘develop’ - please make sure to use develop

  • Compile or otherwise install skycoin-cli and newcoin

(tip: install skycoin-latest on archlinux)

yay -S skycoin-latest

to manually compile skycoin-cli:

go build cmd/skycoin-cli/skycoin-cli.go

the skycoin-cli binary should now be in the current directory test with

./skycoin-cli --help

to manually compile newcoin:

go build cmd/newcoin/newcoin.go

the newcoin binary should now be in the current directory test with

./newcoin --help

The documentation uses the names of the commands as they exist in the skycoin-latest package. If you have manually compiled these binaries, you may symlink them to your PATH to use the commands exactly as stated in this documentation:

sudo ln -s newcoin /usr/bin/skycoin-newcoin
sudo ln -s skycoin-cli /usr/bin/skycoin-cli

Editing fiber.toml

  • Preform initial edits to the fiber.toml file at the top level of the skycoin source dir

You can edit this file at any time, and update your fibercoin.go file with newcoin as outlined in the next steps; however, the blockchain public key, signature, and genesis address must match that of the existing chain. This only applies if a chain already exists, which it does not at this point. The hard-coded distribution addresses are set from this file, as well as the peers.

Remove the information present in the genesis signature, address, blockchain public key fields. We will add these back in the next steps

HINT: you can run skycoin-cli fiberAddressGen to make the distribution addresses.txt and the seed.csv. Be sure to secure the seeds.csv if you do this.

for this example, I’ve created a coin called tesla:

[node]
default_connections = [
	"70.121.6.216:5999",
	#set LAN IP here first for testing. port should match port below
]

peer_list_url = "https://downloads.magnetosphere.net/blockchain/peers.txt"
port = 5999
web_interface_port = 6419
display_name = "Tesla"
ticker = "TESLA"
coin_hours_ticker = "TCH"
qr_uri_prefix = "tesla"
explorer_url = "https://explorer.magnetosphere.net"

[params]
distribution_addresses = [
"PVNSxuVxViHgR7AGbP8q1GDsQaNhPzsyWh",
"2Dw91ASpF3EhgcAQGY9SJAhsWB5i4f3c1xT",
"2i948zidppKB2ktguWeQoaPx9vhYNHsFV8w",
"DTwgf3c3pULEYPZFc75yM48Pq3pkFv5izf",
"2MbGrqH6mFnimcKKh8LU1sDKCCiFDm3A4nH",
"2HP8BHBaRMzpBUGZQY8G7MzP4NyCg1HX8fR",
"27mCTZocPeM5sXRJYPFJD8tg986nnSissqF",
"24XQkH3Yf6nfLJMFMRqrU1nozfjrSQ47APy",
"ZkeK9EPHRKmXsxrFEgdxwkCyjJjTFbkMSY",
"2SDvTFN3xfN1Rx6hUa5Bonc1S61c3ACDYyi",
"cHP3ZNi7i3A3L9QaQys9pUCUZ8gXUsfKZk",
"25FZzt5VKRs5JzcUj5vXaomrYVzgYFdh1e9",
"2FM4seZUjzrWpbkH99Bbk3jfn7WWvump2Jt",
"VWbFgiahA6TFwTSsAMGAGiPomZkHHwUFDM",
"ScjmMaQj48YfYLDdHo1Kktzo3F6UD3Zh4A",
"2PyVQSnuXDd57WmwJ9rCxgHEtqYXLJ3ZzzL",
"2hCWh15BerbsoGoaPcaEjvdtQjimbFLVkfQ",
"yUfbnFwG7kpVVRATkboBrvQboujtc3otdX",
"2n1NDaoo2CTLcVRBKVrbT1nSXETtLCfK2AP",
"2WEJHakQdT6cvEm3tLWWK8nFYETBQxVjdN7",
"2Zh9aHooTJdNgbzQ4Tg7qK8bzEjbk9V1EYC",
"2fhCLAJ6HTo3VDm1aUTXxnsVvC44enLdAE9",
"r8rb1tGd4GWNuoD9v24aJNCgFjvm3LazSh",
"3unk43DZAwBB7a1rjH52q5KTcDGXEwVVco",
"2Y4MuBbCeT6RkbcjBjMzMeYExmMZKQosqBT",
"cfmJDASb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tdoFuhJt6qUE",
"UxMfTNQUC8eoy2dvjG9Db8Sg1GummYA8Yp",
"Wqdeb7xG5vRmFgqYxiK9KHZduAhTDybc4L",
"213vbta1AQM9zd4eezYfWSFPGatvmHM37vP",
"iq3dXcstUNc9M88vaf9n41Ev8EYohARMnP",
"rBx8mPuWZ1msd5ReHubRVvJsv6q3jnhezX",
"2L9DyBViNE34jLCPTqthJkaTA3QMQg9eTpw",
"KTVAN7tDACDJSX22haWxeMEnaZAuddgudr",
"2NcvF3bCryTToebY2w2Wz9dxBKYg6mj7Tup",
"2LHMzDrWzvB15MFCEPAQAfiyHQLHjJUYVYL",
"2GSr2xrDsvN34U9RYSLdcvRoRyVjWQUpnmT",
"2juRxziDuJLZeQbHNVGKk8UQQSeWXVnFZxq",
"25QC4Lpe2dxj5x81DfkDNfZ2XUwcP4XLRgM",
"2ch9EL8fHFTUCmq7m4KvMeLHEkWKoUUyj3q",
"2m5Ja269aae7U76NVSSbQDSe3TtVK2jD1Yw",
"N2sioxE75sXPWdXwLGxifw3LKCuqpfW2mD",
"2enXurufokzqkReFYddNDSFwGmDmFfiAEMv",
"21GTPDCv5Wy9dAgscmNoWVBoS8VQ6HwtdhE",
]

Genesis address, keys

This procedure is at present most extensively documented in the cx-chains documentation. Please refer also to this as an aid to your understanding of this process.

Note that cx has functionality of skycoin-cli and relies on newcoin for certain commands to complete. This is not explicitly stated in the documentation for cx chains but it is the case.

Thus, the cx-chains tutorial has been paraphrased into the following steps using skycoin-cli and newcoin, which targets the creation of a wallet binary / executable file called tesla which is the distributable cryptocurrency wallet binary with defaults for the new blockchain being created. To be clear, it is the eqivalent of the skycoin wallet but with defaults for the fiberchain. It is also possible to customize the wallet GUI; but this is outside the scope of this documetation.

    1. Use newcoin to create the directory and go file for the new coin (ex: tesla)
skycoin-newcoin createcoin --coin tesla

Note: command prints no output if it completes without error

    1. Create the genesis address and keys
skycoin-cli addressGen

save the output of this to genesis.json (and later should delete this file or save offline)

Note: when troubleshooting or attempting this process multiple times in succession, start again with the next step

    1. you can now initialize the blockchain (pay very close attention)

$KEY envs are obtained from genesis.json which was created in the previous step you can set them by using export

export SEC_KEY=<substituite-the-blockchain-secret-key-string-here>
export GEN_ADD=<substituite-the-genesis-address-here>
export PUB_KEY=<substituite-the-blockchain-public-key-here>

The chain initialization-

go run cmd/tesla/tesla.go --block-publisher=true --blockchain-secret-key=$SEC_KEY --blockchain-public-key=$PUB_KEY --genesis-address=$GEN_ADD

run the above for a few moments until you start getting “ERROR” messages, and then ctrl c to stop the process.

The output from the above command:

$ go run cmd/tesla/tesla.go --block-publisher=true --blockchain-secret-key=$SEC_KEY --blockchain-public-key=$PUB_KEY --genesis-address=$GEN_ADD
[2021-02-19T11:59:21-06:00] INFO [main]: App version: 0.27.1
[2021-02-19T11:59:21-06:00] INFO [main]: OS: linux
[2021-02-19T11:59:21-06:00] INFO [main]: Arch: amd64
[2021-02-19T11:59:21-06:00] INFO [main]: Opening database /home/user/.tesla/data.db
[2021-02-19T11:59:21-06:00] INFO [main]: DB version: 0.27.1
[2021-02-19T11:59:21-06:00] INFO [main]: Coinhour burn factor for user transactions is 10
[2021-02-19T11:59:21-06:00] INFO [main]: Max transaction size for user transactions is 32768
[2021-02-19T11:59:21-06:00] INFO [main]: Max decimals for user transactions is 3
[2021-02-19T11:59:21-06:00] INFO [main]: wallet.NewService
[2021-02-19T11:59:21-06:00] INFO [main]: visor.New
[2021-02-19T11:59:21-06:00] INFO [visor]: Creating new visor
[2021-02-19T11:59:21-06:00] INFO [visor]: Visor running in block publisher mode
[2021-02-19T11:59:21-06:00] INFO [visor]: Coinhour burn factor for unconfirmed transactions is 10
[2021-02-19T11:59:21-06:00] INFO [visor]: Max transaction size for unconfirmed transactions is 32768
[2021-02-19T11:59:21-06:00] INFO [visor]: Max decimals for unconfirmed transactions is 3
[2021-02-19T11:59:21-06:00] INFO [visor]: Coinhour burn factor for transactions when creating blocks is 10
[2021-02-19T11:59:21-06:00] INFO [visor]: Max transaction size for transactions when creating blocks is 32768
[2021-02-19T11:59:21-06:00] INFO [visor]: Max decimals for transactions when creating blocks is 3
[2021-02-19T11:59:21-06:00] INFO [visor]: Max block size is 32768
[2021-02-19T11:59:21-06:00] INFO [blockdb]: Unspents.MaybeBuildIndexes
[2021-02-19T11:59:21-06:00] INFO [blockdb]: Rebuilding unspent_pool_addr_index (addrHeightIndexExists=false, addrIndexHeight=0, headSeq=0)
[2021-02-19T11:59:21-06:00] INFO [blockdb]: Building unspent address index
[2021-02-19T11:59:21-06:00] INFO [blockdb]: No unspents to index
[2021-02-19T11:59:21-06:00] INFO [visor]: Visor initHistory
[2021-02-19T11:59:21-06:00] INFO [visor]: Resetting historyDB
[2021-02-19T11:59:21-06:00] INFO [visor]: Visor parseHistoryTo
[2021-02-19T11:59:21-06:00] INFO [visor]: Unconfirmed transaction pool size: 0
[2021-02-19T11:59:21-06:00] INFO [main]: daemon.New
[2021-02-19T11:59:21-06:00] INFO [main]: kvstorage.NewManager
[2021-02-19T11:59:21-06:00] INFO [kvstorage]: Creating new KVStorage manager
[2021-02-19T11:59:21-06:00] INFO [kvstorage]: KVStorage is disabled
[2021-02-19T11:59:21-06:00] INFO [main]: api.NewGateway
[2021-02-19T11:59:21-06:00] WARN [api]: HTTPS not in use!
[2021-02-19T11:59:21-06:00] INFO [pex]: Trying to download peers list url="https://downloads.magnetosphere.net/blockchain/peers.txt"
[2021-02-19T11:59:21-06:00] INFO [main:CRITICAL]: Full address: http://127.0.0.1:6419
[2021-02-19T11:59:21-06:00] INFO [main]: visor.Init
[2021-02-19T11:59:21-06:00] INFO [visor]: Visor init
[2021-02-19T11:59:21-06:00] INFO [visor]: Visor maybeCreateGenesisBlock
[2021-02-19T11:59:21-06:00] INFO [visor]: Create genesis block
[2021-02-19T11:59:21-06:00] INFO [visor]: Genesis block signature=86f410b1c507e75cd9e05bfecb735c8fad366579afdd714ed0f27730369768f262ed21940c814dd522e6ce9535cebd95e05dbfbb1eb48fcd0dd91d7240f7ec1401
[2021-02-19T11:59:21-06:00] INFO [visor]: Removed 0 invalid txns from pool
[2021-02-19T11:59:21-06:00] INFO [main]: webInterface.Serve
[2021-02-19T11:59:21-06:00] INFO [api]: Starting web interface on 127.0.0.1:6419
[2021-02-19T11:59:21-06:00] INFO [main]: daemon.Run
[2021-02-19T11:59:21-06:00] INFO [daemon]: Daemon UserAgent is tesla:0.27.1
[2021-02-19T11:59:21-06:00] INFO [daemon]: Daemon unconfirmed BurnFactor is 10
[2021-02-19T11:59:21-06:00] INFO [daemon]: Daemon unconfirmed MaxTransactionSize is 32768
[2021-02-19T11:59:21-06:00] INFO [daemon]: Daemon unconfirmed MaxDropletPrecision is 3
[2021-02-19T11:59:21-06:00] INFO [pex]: Pex.Run started
[2021-02-19T11:59:21-06:00] INFO [daemon]: daemon.Pool listening on port 6001
[2021-02-19T11:59:21-06:00] INFO [gnet]: Listening for connections on :6001...
[2021-02-19T11:59:21-06:00] WARN [daemon]: maybeConnectToTrustedPeer: connectToPeer failed addr="70.121.6.216:6001" error="Already connected to this peer"
[2021-02-19T11:59:21-06:00] ERROR [daemon:CRITICAL]: maybeConnectToTrustedPeer error="Could not connect to any trusted peer"
[2021-02-19T11:59:21-06:00] ERROR [pex]: waiting to retry downloadText error="Get "https://downloads.magnetosphere.net/blockchain/peers.txt": dial tcp: lookup downloads.magnetosphere.net: no such host" waitTime=719.600155ms
[2021-02-19T11:59:22-06:00] INFO [pex]: Trying to download peers list url="https://downloads.magnetosphere.net/blockchain/peers.txt"
[2021-02-19T11:59:22-06:00] ERROR [pex]: waiting to retry downloadText error="Get "https://downloads.magnetosphere.net/blockchain/peers.txt": dial tcp: lookup downloads.magnetosphere.net: no such host" waitTime=436.089288ms
[2021-02-19T11:59:23-06:00] INFO [pex]: Trying to download peers list url="https://downloads.magnetosphere.net/blockchain/peers.txt"
[2021-02-19T11:59:23-06:00] ERROR [pex]: waiting to retry downloadText error="Get "https://downloads.magnetosphere.net/blockchain/peers.txt": dial tcp: lookup downloads.magnetosphere.net: no such host" waitTime=966.087607ms
[2021-02-19T11:59:23-06:00] INFO [pex]: Trying to download peers list url="https://downloads.magnetosphere.net/blockchain/peers.txt"
[2021-02-19T11:59:23-06:00] ERROR [pex]: waiting to retry downloadText error="Get "https://downloads.magnetosphere.net/blockchain/peers.txt": dial tcp: lookup downloads.magnetosphere.net: no such host" waitTime=1.534681399s
[2021-02-19T11:59:25-06:00] INFO [pex]: Trying to download peers list url="https://downloads.magnetosphere.net/blockchain/peers.txt"
[2021-02-19T11:59:25-06:00] ERROR [pex]: waiting to retry downloadText error="Get "https://downloads.magnetosphere.net/blockchain/peers.txt": dial tcp: lookup downloads.magnetosphere.net: no such host" waitTime=1.977973304s
^C[2021-02-19T11:59:26-06:00] INFO [main]: Shutting down...
[2021-02-19T11:59:26-06:00] INFO [main]: Closing web interface
[2021-02-19T11:59:26-06:00] INFO [api]: Shutting down web interface
[2021-02-19T11:59:26-06:00] INFO [api]: Web interface closed
[2021-02-19T11:59:26-06:00] ERROR [main]: webInterface.Serve failed error="accept tcp 127.0.0.1:6419: use of closed network connection"
[2021-02-19T11:59:26-06:00] INFO [api]: Web interface shut down
[2021-02-19T11:59:26-06:00] INFO [main]: Closing daemon
[2021-02-19T11:59:26-06:00] INFO [daemon]: Stopping the daemon run loop
[2021-02-19T11:59:26-06:00] INFO [daemon]: Shutting down Pool
[2021-02-19T11:59:26-06:00] INFO [gnet]: ConnectionPool.Shutdown called
[2021-02-19T11:59:26-06:00] INFO [gnet]: ConnectionPool.Shutdown closed pool.quit
[2021-02-19T11:59:26-06:00] INFO [daemon]: Daemon closed
[2021-02-19T11:59:26-06:00] INFO [gnet]: ConnectionPool.Shutdown waiting for strandDone
[2021-02-19T11:59:26-06:00] INFO [gnet]: ConnectionPool.Shutdown closing the listener
[2021-02-19T11:59:26-06:00] INFO [gnet]: Connection pool closed
[2021-02-19T11:59:26-06:00] INFO [gnet]: ConnectionPool.Shutdown disconnecting all connections
[2021-02-19T11:59:26-06:00] INFO [gnet]: ConnectionPool.Shutdown waiting for done
[2021-02-19T11:59:26-06:00] INFO [daemon]: Shutting down Pex
[2021-02-19T11:59:26-06:00] INFO [pex]: Shutting down pex
[2021-02-19T11:59:26-06:00] INFO [pex]: Save peerlist
[2021-02-19T11:59:26-06:00] INFO [pex]: Pex.Run stopped
[2021-02-19T11:59:26-06:00] INFO [pex]: Pex shutdown
[2021-02-19T11:59:26-06:00] INFO [daemon]: Daemon shutdown complete
[2021-02-19T11:59:26-06:00] INFO [main]: Waiting for goroutines to finish
[2021-02-19T11:59:26-06:00] INFO [main]: Closing database
[2021-02-19T11:59:26-06:00] INFO [main]: Goodbye

Now, about halfway along in the above command output, the genesis block was generated. Copy the genesis signature string.

    1. add the genesis signature from above, and the address and pubkey fields in genesis.json to fiber.toml

NOTE: if you add the secret key to fiber.toml it will show up in the help menu of the created .go file or binary. Don’t do that for a distributable binary. Run the wallet in publisher mode and explicitly specify the secret key string for a block publisher as an env and clear your bash history

note: the timestamp cannot be blank. Choose a recent time.

    1. now we use newcoin to regenerate the tesla.go file

We could have actually used the skycoin wallet binary from the start but the instructions for doing it in this manner are (in my interpretation) meant to prevent any risk to a local copy of the existing skycoin blockchain in ~/.skycoin

edit - actually it’s because you can’t change the display name, etc. with just flags. But it will work still.

The new blockchain will have hence (in this example) been created in ~/.tesla

skycoin-newcoin createcoin --coin tesla
    1. Check the help menu of the created file.go to see the defaults such as genesis address, signature, etc.
go run cmd/tesla/tesla.go --help

make sure if this is intended to produce a distributable binary that the blockchain secret key is not included

Remember, your blockchain currently only exists locally. ~/.tesla will need to be present in the production deployment environment.

DistributeGenesis

The exact process for this is pending improvement

    1. Run a block publisher node
go run cmd/tesla/tesla.go --block-publisher=true --blockchain-secret-key=$SECRET_KEY
    1. Run a peer node

To run a peer node on the same machine as the publisher, change the port and data directory

go run cmd/tesla/tesla.go -launch-browser=true -enable-all-api-sets=true -enable-gui=true -log-level=debug --port=5998 -data-dir=$HOME/.tesla1 -web-interface-port=6418

go into the web interface of the wallet and load the genesis wallet seed.

    1. Create the first transaction using skycoin-cli

Export the necessary environmental variables to make skycoin-cli work with your chain

export RPC_ADDR="http://127.0.0.1:6418"
export COIN="tesla"
export DATA_DIR=$HOME/.tesla1/"

At this point it would be typical to use: skycoin-cli distributeGenesis $SEC_KEY

I have not found that to work. The genesis address creates a transaction to itself, showing that coins were sent and coins were received; but the coins simply vanish.

A workaround at this point is to create a raw transaction:

skycoin-cli createRawTransaction '/home/user/.tesla1/wallets/genesis.wlt'  $GEN_ADD 100000000 -a $GEN_ADD

TROUBLESHOOTING

  • re-initialize the blockchain:

stop any running instances and remove everything except wallets dir from ~/.tesla & ~/.tesla1

restart the publisher briefly then kill it

copy the signature to fiber.toml

update tesla.go file with newcoin

restart the publisher

restart the peer

PRODUCTION DEPLOYMENT

In this example, a publisher node is run on port 6418, the node for the mobile wallets is run on port 6419 (the default port) and any other instance for testing purposes, is run on the next lower port. Specify the web interface port similarly to avoid conflicts.

A copy of the data dir should be made and specified with the -data-dir flag for use with each additional instance.

Caddy-server is used to reverse proxy port 6419 to the desired subdomain, in this instance tesla.magnetosphere.net, with the following lines in a Caddyfile:

tesla.magnetosphere.net {
reverse_proxy 127.0.0.1:6419
}

The node used by mobile wallets should be run with the following flags specified:

-enable-all-api-sets=true -log-level=debug -disable-csrf -host-whitelist subdomain.yoursite.com

The subdomain can now be tested with the mobile wallet, by adding tesla.magnetosphere.net as the nodeURL in the settings page of the skycoin mobile wallet.

Running the skycoin explorer with your fibercoin is as simple as changing two lines in explorer.go. However, one is likely to encounter difficulties with the gui sources for the skycoin explorer not building. Please file an issue on github if you experience difficulty with building the skycoin explorer frontend.

The explorer.go file should similarly be changed to increment the port it serves on, and change the port it uses to connect to skycoin / fibercoins to the one you are using. The port which is served by the explorer can then be reverse-proxied to the subdomain.

tesla-explorer.magnetosphere.net {
reverse_proxy 127.0.0.1:8003
}

Get Started with Skycoin