Skip to content

Instantly share code, notes, and snippets.

@mberry
Created July 17, 2019 13:18
Show Gist options
  • Save mberry/f58332ccf5246391f65b91ee56d89fc9 to your computer and use it in GitHub Desktop.
Save mberry/f58332ccf5246391f65b91ee56d89fc9 to your computer and use it in GitHub Desktop.


Build Status Discord License

A Network of Pegged Tokens

This is the main repository for the PegNet application.

Pegged tokens reflect real market assets such as currencies, precious metals, commodities, cryptocurrencies etc. The conversion rates on PegNet are determined by a decentralized set of miners who submit values based on current market data. These values are recorded in the Factom blockchain and then graded based upon accuracy and mining hashpower.

The draft proposal paper is available here.

For any questions, troubleshooting or further information head to discord.

Mining

Requirements

Setup

Create a .pegnet folder inside your home directory. Copy the defaultconfig.ini file there.

On Windows this is your %USERPROFILE% folder

Linux example:

mkdir ~/.pegnet
wget https://raw.githubusercontent.com/pegnet/pegnet/master/defaultconfig.ini -P ~/.pegnet/
  • Sign up for an API Key from https://currencylayer.com, replace APILayerKey in the config with your own

  • Replace either ECAddress or FCTAddress with your own

  • Modify the IdentityChain name to one of your choosing.

  • Have a factomd node running on mainnet.

  • Have factom-walletd open

  • Start Pegnet

On first startup there will be some delay while the bytemap is shuffled. It will only start mining at the beginning of a block also.

Contributing

  • Join Discord and chat about it with lovely people!

  • Run a testnet node

  • Create a github issue because they always exist.

  • Fork the repo and submit your pull requests, fix things.

Development

Docker guide can be found here for an automated solution.

Manual Setup

Install the factom binaries

The Factom developer sandbox setup overview is [here], which covers the first parts, otherwise use below.

# In first terminal
# Change blocktime to whatever suits you 
factomd -blktime=120 -network=LOCAL

# Second Terminal
factom-walletd

# Third Terminal
fa='factom-cli importaddress Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK'
ec='factom-cli newecaddress'
factom-cli listaddresses # Verify addresses
factom-cli buyec $fa $ec 100000
factom-cli balance $ec # Verify Balance

# Fork Repo on github, clone your fork
git clone https://github.com/<USER>/pegnet

# Add main pegnet repo as a remote
cd pegnet
git remote add upstream https://github.com/pegnet/pegnet

# Sync with main development branch
git pull upstream develop 

# Initialize the pegnet chain
cd initialization
go build
./initialization

# You should be ready to roll from here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment