How To

Create Account

Via DECENT GO service

DECENT GO service offers free signup by entering email and password. Fee is paid by Master Account owned by DECENT Foundation (this serves as a network protection). GO Master account gets DCTs from the Foundation account. Fee is 0,005 DCT per account and fees are going back to the network pool. During registration process, user has to accept the Privacy policy & Terms of use and he/she needs to confirm provided email address by opening unique link which arrives in his/her mailbox. DECENT Network account is created right after successful confirmation.

By signing in, the following options are available:

  1. Generate and save your recovery phrase (you will need to do this in order to get the key pair used in other steps below).
  2. Save your password hint.
  3. Skip and do it later.

Password requirements:

  • A minimum of 8 characters
  • An UPPERCASE letter
  • A lowercase letter
  • A number or symbol

Via CLI

The CLI wallet interface for DECENT network also offers the possibility of creating user account independently of the centralized DECENT GO service. But it has a catch, it is only possible to be created by knowing someone who is already an existing user and is able to pay the fee for creation of the account. This condition is mandatory and the payment is 0,005 DCT.

 register_account "new_account_name" public-key-owner public-key-active "my_account_name" true

API details for registering a third party’s account:

 signed_transaction graphene::wallet::wallet_api::register_account(string name, public_key_type owner, public_key_type active, string registrar_account, bool broadcast = false)

This function is used to register an account for which you do not own the private keys. When acting as a registrar, an end user will generate their own private keys and send you the public keys. The registrar will use this function to register the account on behalf of the end user.

Return

The signed transaction registering the account.

Parameters

  • name: the name of the account, must be unique on the blockchain. Shorter names are more expensive to register. The rules are still in flux, but in general names of more than 8 characters with at least one digit will be cheap.
  • owner: the owner key for the new account.
  • active: the active key for the new account, can be the same as the owner key.
  • registrar_account: the account which will pay the fee to register the user.
  • broadcast: true to broadcast the transaction on the network.
 signed_transaction create_account_with_brain_key(string brain_key, string account_name, string registrar_account, bool broadcast = false)

Creates a new account and registers it on the blockchain.

Return

The signed transaction registering the account.

Parameters

  • brain_key: the brain key used for generating the account’s private keys.
  • account_name: the name of the account, must be unique on the blockchain. Shorter names are more expensive to register. The rules are still in flux, but in general names of more than 8 characters with at least one digit will be cheap.
  • registrar_account: the account which will pay the fee to register the user.
  • broadcast: true to broadcast the transaction on the network.

Start Mining/Validating

Have your account name and private key ready.

Start the local node by running:

 ./decentd --rpc-endpoint 127.0.0.1:8090

Start cli_wallet and set the password and import the key when running for the first time:

 ./cli_wallet -s ws://127.0.0.1:8090
 new>>> set_password <password>
 null
 locked>>> unlock <password>
 null
 unlocked>>> import_key <accountname> <private-key>
 true

Create miner object.

 unlocked >>> create_miner <accountname> "url-to-proposal" true

"url-to-proposal" is a url of a web page with your intentions, info about your system, …, it may be blank.

 {
   "ref_block_num": 8335,
   "ref_block_prefix": 760912907,
   "expiration": "2017-05-24T11:45:45",
   "operations": [[
       12,{
         "fee": {
           "amount": "5000000000",
           "asset_id": "1.3.0"
         },
         "miner_account": "1.2.16",
         "url": "decentdev-ejossev",
         "block_signing_key": "DCT7RZAJu7fLM5RS6GujZ8b9EjE3KLUzrXmAAi6QaUeiZTGHEVQXp"
       }
     ]
   ],
   "extensions": [],
   "signatures": [   "20038dc5a699b030204ec3f70150d13c6a7b8a2ecb96aeddfe0927a4969e26ab1818b17f149a5e4def18653626db3cf53b9bfe570adb257455b62c1207da29dacf"
  ]
 }

Check the ID and signing key:

 unlocked>>> get_miner <accountname>
 {
   "id": "1.4.12",
   "miner_account": "1.2.16",
   "last_aslot": 0,
   "signing_key": "DCT7RZAJu7fLM5RS6GujZ8b9EjE3KLUzrXmAAi6QaUeiZTGHEVQXp",
   "vote_id": "0:11",
   "total_votes": 0,
   "url": "decentdev-ejossev",
   "total_missed": 0,
   "last_confirmed_block_num": 0
 }

Now, your miner object is ready.

Next, you need to start the miner, so shut down the wallet (ctrl-d) and shut down decentd (ctrl-c). Re-launch the miner, now mentioning the new miner 1.4.12 and its keypair:

 ./decentd --rpc-endpoint 127.0.0.1:8090 --miner-id "1.4.12" --private-key
 ["DCT7RZAJu7fLM5RS6GujZ8b9EjE3KLUzrXmAAi6QaUeiZTGHEVQXp", "<private-key>"]

Alternatively, you can also add this line into your config.ini:

 miner-id = "1.4.12"
 private-key = ["DCT7RZAJu7fLM5RS6GujZ8b9EjE3KLUzrXmAAi6QaUeiZTGHEVQXp", "<private-key>"]

Now, get some support for your miner:

 unlocked>>> vote_for_miner <accountname> <miner name> true true
 [a transaction in json format]

Only voted miners will be allowed to mining.

Become Seeder

Initiation

Find the IPFS binary, and “cd” to the directory, where it is located. If you are running IPFS binary for the first time, initialize IPFS local configuration by executing the command:

 ./ipfs init
  • optionally start the “screen”, so ipfs keeps running when terminal is closed.
  • start ipfs daemon manually
 ./ipfs daemon
  • locate decentd binary and “cd” to the directory where it is located.
  • optionally start the “screen”, so decentd keeps running when terminal is closed.
  • start decentd by command:
 ./decentd --rpc-endpoint=127.0.0.1:8091
  • cd to the binary dir and start cli_wallet in other terminal:
 ./cli_wallet -s ws://127.0.0.1:8091
  • in the wallet, generate your unique content (el-gamal) key and retrieve your account information:
 locked>>> generate_el_gamal_keys
 generate_el_gamal_keys
 {
   "private_key": "9929825202538904525106109715118390731307867060424773269806671642582808014388431220063738899822276719239811537373767212483489421362837444007489350876354517.",
   "public_key": "3648917272837948840111820214699156582057756326092170692394831096647015694006097575449253578125567465803655043496246107225444630380402263661429117826904742."
 }
 locked>>> get_account_id decentuser0985
 get_account_id decentuser0985
  • you will see, e.g.:
 "1.2.1009"

Option 1: Start seeding plugin

  • Close the cli_wallet and decentd binaries and then run decentd binary with the following arguments:
 --seeding-price - how much will be received for each MB of shared data every day,  in satoshi (1DCT=100,000,000 satoshi)
 --free-space - space allocated for seeding
 --seeder - your account ID, retrieved in previous step
 --seeder-private-key - your private key, received in the information e-mail
 --content-private-key - the private key generated in previous step
 --rpc-endpoint=127.0.0.1:8091 - optionally specify new listening endpoint, so it will not interfere with gui application
  • Example:
 ./decentd —seeding-price=5 —free-space=10000 —seeder=1.2.147 —seeder-private-key=5KWqD3VgtamUrq1sM6tK4hBQvJrJHqBsHTJonoJ5TXrsSejWPoH —content-private-key=8350062629259001565868362551941857436696436206897745031831346012489628303440637181214912450434908814625379986214241979043322759883531042603154115677476020 —packages-path=./existing_folder_created_for_packages –rpc-endpoint=127.0.0.1:8091

Option 2: Start seeding plugin via cli_wallet

  • Execute these commands in the terminal, where cli_wallet is running:
 import_key type_your_username type_your_private_key
  • Please note, that the command above should only be used if your private key has not been imported yet. Insert the parameters in the following order and fill with the data:
 seeding_startup seeder content-private-key seeder-private-key free-space seeding-price packages-path
  • Example:
 seeding_startup 1.2.1009 8350062629259001565868362551941857436696436206897745031831346012489628303440637181214912450434908814625379986214241979043322759883531042603154115677476020 5KWqD3VgtamUrq1sM6tK4hBQvJrJHqBsHTJonoJ5TXrsSejWPoH 10000 5 ./existing_folder_created_for_packages

Finalization

  • Wait until the node is selected for seeding
  • Please note that authors prefer seeders with a higher rating
  • The rating is used as a reliability metric and is derived from various seeding statistics
  • In regular intervals there will be performed proof-of-custody by DECENT network which validates promoted values against reality: free size, etc.

Use DECENT

Starting DECENT

In the commands below, change ~/dev/DECENTfoundation/DECENT-Network-build/artifacts/prefix to ~/dev/DECENTfoundation/DECENT-Network-prefix or to any other install location, that you specified during initial configuration.

On the first run decentd will create .decentin the home directory, if doesn't exist already.

 $ ~/dev/DECENTfoundation/DECENT-Network-build/artifacts/prefix/bin/decentd

Then, in a separate console, start the command-line wallet by executing:

 $ cd ~/dev/DECENTfoundation/DECENT-Network-working-dir
 $ ~/dev/DECENTfoundation/DECENT-Network-build/artifacts/prefix/bin/cli_wallet

To set your initial password to mypassword, execute:

 >>> set_password mypassword>>> unlock mypassword

To import your account keys, execute:

 >>> import_key [name] [private_wif_key]

Decent daemon

The role of the decent daemon is to broadcast transactions, download blocks and optionally sign them.

 $ ~/dev/DECENTfoundation/DECENT-Network-build/artifacts/prefix/bin/decentd –rpc-endpoint 127.0.0.1:8090 –enable-stale-production -w '"1.4.0"'

Seeder plugin

Seeder plugin is responsible for automatically announce seeder's capability, downloading content, seeding it and distributing keys. In order to enable it, follow these steps:

  1. Generarate El-Gamal keys using cli_wallet command (first one is private, second one is public)

  2. generate_el_gamal_keys

  3. Add parameters to the witness_node

  4. Parameters:

    –seeder [account-id] –seeder-private-key [private_wif_key] –content-private-key [el_gamal_private_key] –packages-path [path] –seeding-price [price] –free-space [free-space]
    
  5. Be aware that [account-id] is one of your accounts, [private_wif_key] corresponding active key, [el_gamal_private_key] is the generated El-Gamal key, [path] is a filesystem location with at least [space] Megabytes available, and [price] is publishing price per MB per day, in satoshis.

API

Using the API

We provide several different APIs. Each API has its own ID. When running decentd, initially two APIs are available: API 0 provides read-only access to the database, while API 1 is used to login and gain access to additional, restricted APIs.

Here is an example using wscat package from npm for websockets:

 $ npm install -g wscat
 $ wscat -c ws://127.0.0.1:8090> {"id":1, "method":"call", "params":[0,"get_accounts",[["1.2.0"]]]}
 connected (press CTRL+C to quit)> {"id":1, "method":"call", "params":[ 1, "login", ["", ""]]}
 <{"id":1,"result":true}> {"id":2, "method":"call", "params":[ 1, "network_broadcast", []  ]}
 <{"id":2,"result":2}> { "id":4,"method":"call","params":[2, "broadcast_transaction"  ,[{"ref_block_num": 6707,"ref_block_prefix": 4229622607,"expiration": "2017-06-05T08:59:05","operations": [[0,{"fee": {"amount": 10000000,"asset_id": "1.3.0"},"from": "1.2.15", "to": "1.2.16""amount": {"amount": "1000000000000","asset_id": "1.3.0"},"extensions": []}]],"extensions": [],"signatures": ["1f0a72cd1dc25f01d91168de7dd13e81119f4e6468a56b521628f7c307444e98991e3543e9549ee9d49a9e4b002439f320abf2fb0c60eecbc093906dd4824f29dd"] } ] ] }

We can do some thing using a HTTP client, such as curl for APIs which do not require login or other session state:

 $ curl --data '{"jsonrpc": "2.0", "method": "lookup_accounts", "params": ["", 10], "id": 1}' http://127.0.0.1:8090/rpc
 {"id":1,"result":[["chrisw","1.2.31"],["decent","1.2.15"],["decent-account-manager","1.2.27"],["decent-mm","1.2.32"],["decent-sandra","1.2.29"],["decent-seeding1","1.2.24"],["decent-seeding2","1.2.25"],["decent-seeding3","1.2.26"],["decent-seeding4","1.2.28"],["decentdev-davit","1.2.18"]]}

(MINING) Witnessing blocks for DECENT Network

This is a DECENT community powered guide thanks to roelandp.

DECENT is a network for publishing content and runs on Graphene based software. Graphene has many advantages, such as very low blocktimes which result in nearly instantaneous transfers and high TX throughput.

Graphene software is based on the Delegated Proof of Stake (DPoS) model and not on the Proof-of-Work model. There is NO need for heavy computing power to calculate algorithms to find solutions and create new blocks and get rewarded.

It is not an environmentally unfriendly game of 'who has the biggest CPU/GPU'. Rather a low latency network is the key to success. A dedicated (or at least a low aggregation rate) high speed network and a fast SSD, being the most crucial elements to producing blocks.

The system is designed to remain stable through decentralization with sufficient number of active miner witnesses who run copies of the ./decentd software on their dedicated servers and make sure transactions on the network are pushed in blocks, verified, signed off and finally accepted into the chain. The system is self healing, designed to fix itself when blocks are missed, in other words, when the assigned witness fails to verify the block in time. When a block is missed 2/3 of active miners have to validate it, so the 5s average block production may be delayed a bit (could be 15-20s). There are algorithms that do not allow a cascade effect to result from such behaviour. Making sure the most reliable miners are active acts like an immunsystem. So if you have a stake (DCT balance), a bit of knowhow and a dedicated system maybe it’s time to consider becoming a miner witness.

To become a miner witness for DECENT you must understand the following:

  1. You must be reliable: This is not a 'come & go' job. If you are voted in the 'active miner witness list’ your server will get a block to produce/validate/sign every minute or so. If you have not setup your hardware and software correctly, or there is too much latency in your network, you will miss the block and keep missing blocks until you have figured it out. If you miss blocks, the transactions, which are waiting to be added to the blockchain, will be moved to the next block & block producer. The network has fail safe protocols and algorithms to prevent cascading effects for missed blocks. That said, if you are missing blocks often you are not adequately contributing to the network and you will be replaced by another more reliable miner.
  2. Your server must run 24/7.
  3. Your server must run on a good infrastructure, preferably in a professional hosting environment.

Remember this is not a case of 'who has the biggest CPU/GPU', but there should be a healthy competition of who has the least 'missed blocks'.

Vote responsibly!

If you have DCT in an account you can vote for miners witnesses to influence the 'active miner witness list'. Changes in the list take effect (every 24 hours) at the next MAINTENANCE_INTERVAL.

PLEASE VOTE RESPONSIBLY. Do your research and vote for reliable, consistent and stable miners. Votes are weighted with miners DCT balance. To increase the weight of your stake you can transfer DCT from exchanges (currently trading on Bittrex and HitBTC).

To vote for a miner witness: vote_for_miner YOURACCOUNTNAME MINERNAME true true

Be verifiable!

It is advisable to set up your miner witness with an identifiable username. So don't use the default DECENT foundation encrypted u1234123XXXX formed username. It also helps to have some sort of profile info made available to the stakeholders. See roelandp’s info page for a nice example.

Steps involved in setting up a miner witness:

1. Setting up a server and securing it:

  1. Setup a server (16.04 LTS 2 recommended) on a dedicated hosting environment (recommended SSD and a low latency network) and it’s worth noting that currently the gcc compiler only works under Linux.
  2. Secure your server: No root login, no password login, install UFW, and fail2ban and such.
  3. Manually install the DECENTD node software as instructed here: https://github.com/DECENTfoundation/DECENT-Network.

2. Perform all cli_wallet actions (need help? use the function gethelp FUNCTIONNAME):

  1. Import your DECENT account with the weird name with import_key and make sure it is funded with some DCT.
  2. Set up an identifiable username for your miner witness with register_account (you need suggest_brain_key twice to get new pub/private key pairs for both the owner and active keys).
  3. Fund the newly created account from your original DECENT account with transfer.
  4. Upgrade your newly identifiable username account to become a miner witness with create_miner. Be sure to add a url where we can read more about your intentions of being a 24/7 reliable miner witness for DECENT. This will return a result with 'signing key' as well as your miner-id (starts with 1.4. !!! NOT 1.2. !!!).
  5. Update your config.ini for the ./decentd software: Go to /home/LINUXUSER/.decent/data/config.ini.
  6. Update/Add/Uncomment the miner-id="1.4.XX" (note! starts with 1.4. not 1.2.) with your mining-id retrievable via get_miner.
  7. Update/Add/Uncomment the private-key=["DCTPUBLIC","PRIVATEKEY"] with your SIGNING PUBLIC KEY, PRIVATE KEY pair in the correct order. Get your Public Key retrievable via get_miner and seeing the 'signing key'-value. Then get your private key corresponding to that public signing key via get_private_key.
  8. Double check that you are absolutely sure you have setup config.ini correctly with miner-id=1.4.XX (not 1.2.XX !!) and have the correct order and keypair for private-key.
  9. Restart your ./decentd software in a dedicated screen session on your 24/7 reliable dedicated server. In the startup on your screen session you should see it listing some details about your configed miner.
  10. Announce your intentions on #mining and/or #witness-proposals on Slack.

This is a community powered Guide much of the contents come from one of our top miner-wits roelandp, a miner for several graphene chains and you can learn more about this member here.

And the original post can be found here.