Install and Run Bitcoin Core and Wallet in Ubuntu Server 16.04

  1. Install Bitcoin Core:
    • $ sudo apt-add-repository ppa:bitcoin/bitcoin
    • $ sudo apt-get update
    • $ sudo apt-get install bitcoind
  2. Run Bitcoin Node:
  3. Optional: start Bitcoin node at boot:
    • Run the following command to edit your crontab:
      • $ crontab -e
    • Scroll to the bottom of the file displayed and add the following line:
      • @reboot bitcoind -daemon
    • Save the file and exit.
  4. Verify if Bitcoin node is running:
    • $ bitcoin-cli getinfo
  5. Stop Bitcoin Core/Node process:
    • $ bitcoin-cli stop
  6. Create a new wallet address:
    • $ bitcoin-cli getnewaddress               # create an address in default account
    • $ bitcoin-cli getnewaddress “John”   # create an address in John account
    • (understanding account in wallet)
  7. Show current wallet addresses:
    • $ bitcoin-cli listreceivedbyaddress 0 true      # show all address from all accounts
    • $ bitcoin-cli getaddressesbyaccount “”     # show address in default account
    • $ bitcoin-cli getaddressesbyaccount “John”   # # show address in John account
Advertisements

Install and Run zCash in Ubuntu Server 16.04

  1. Install zCash node (website: z.cash):
    • $ sudo apt-get install apt-transport-https
    • $ echo “deb [arch=amd64] https://apt.z.cash/ jessie main” | sudo tee /etc/apt/sources.list.d/zcash.list
    • $ sudo apt-get update
    • $ sudo apt-get install zcash
    • $ zcash-fetch-params    (# download parameters)
    • $ cd .zcash
    • $ nano zcash.conf    (create file: zcash.conf)
    • Add following line into zcash.conf, then save and exit:
      • addnode=mainnet.z.cash     (# connect to zcash main network)
        rpcuser=user-name     (# user, no matter)
        rpcpassword= password-text  (# anything, no matter)
        gen=0      (# value=0: not mining; value=1: mining when run zcashd)
        genproclimit=2
        equihashsolver=tromp
  2. Run zcash core (zcashd):
    • $ zcashd    :   run zcashd in normal mode and showing running info.
    • $ zcashd –daemon  :   run zcashd in background
    • It will take several hours to download all blockchain to local server.
  3. Use zcash client app (zcash-cli):
    • To check if zcashd is running:
    • Create new t-Address (account for wallet is not supported yet – 2017/07):
      • $ zcash-cli getnewaddress
    • List t-address:
      • zcash-cli getaddressesbyaccount “”  (# show address of default account)
      • zcash-cli listreceivedbyaddress 0 true  (# show all addresses of all accounts)
    • Create new z-address:
      • $ zcash-cli z_getnewaddress
    • List z-address:
      • $ zcash-cli z_listaddresses

Install and configure SSH server for Ubuntu 16.04

  • Intall SSH Server:

$ sudo apt install openssh-server

  • Change SSH Port, if needed:

$ cd /etc/ssh/

$ sudo nano sshd_config

The change port number, save and exit.

  • Restart SSH service:

$ sudo systemctl restart ssh

  • Open SSH session to control another machine:

$ ssh hostname@host_ip_address -p ssh_port

  • Temporary let ssh session (that is controlling a remote host) run under background (i.e. a special command to suspend the SSH client):

Press “–” (Shift -),  “Enter", then “~", followed by “Ctrl-Z"

  • Re-enter interactive mode after Ctrl-Z (i.e. back to the process that is let running in background after press Ctrl-Z):

Type “fg” and hit “enter” in terminal.

 

 

 

 

How to run Siad as a background service in Ubuntu server

Configure a service that allow siad to run on boot (and restart in case of crashed):

    • Assume that you already install Sia Core and ./siad is operational (i.e. you can run command ./siad to start Sia application)
    • Stop siad process.
    • Create a file named: siad.service at a folder you need. In the below example, you create file siad.service in folder /home/your-user-name/config/services
      • $ mkdir config && cd config && mkdir services && cd services
      • $ sudo nano siad.service
      • Add these lines to siad.service file:

        Description=Sia Daemon
         
        [Service]
        ExecStart=/home/your-user-name/path-to-sia-storing-folder/siad
        WorkingDirectory=/home/your-user-name/path-to-sia-storing-folder/
        Restart=always
         
        [Install]
        WantedBy=multi-user.target
        Alias=siad.service
    • Save file and exit to root user.
    • Configure firewall (if ufw is in use):
      • $ ufw allow 9982
    • Start siad as a service:
      • $ systemctl daemon-reload
      • $ systemctl enable ~/.config/systemd/siad.service
      • $ systemctl start siad.service
  • Sia should now be running as a service which can be confirmed/verifyed with:

Sia wallet error when unlock or show addresses

Run commands:

./siac wallet unlock

./siac wallet addresses

Error: Could not unlock wallet: error when calling /wallet/unlock: wallet has not been encrypted yet

Cause: Wallet was unlocked before all blockchain had been downloaded. The wallet is in “incomplete” status.

Solution:

  • Let all blockchain downloaded (by running ./siad)
  • Encrypt wallet with your current recovery seed:
    • Run ./siac wallet init-seed
    • Input your current recovery seed
    • Wait for a while (few minutes)
  • Now your Sia Wallet is completed.
  • Decrypt wallet with your current password:
    • Run ./siac wallet unlock
    • Input your current 29-word long password
    • Wait few minutes for scanning clock height, then done.
  • Now you can use ./siac wallet [flag/command] again.

Run ./siad (Sia Daemon) with specific modules

You can tell siad to do less stuff:

$ siad -M [module-name]

Use the -M or –modules flag to only run specific modules. Modules are
independent components of Sia. This flag should only be used by developers or
people who want to reduce overhead from unused modules. Modules are specified by
their first letter. If the -M or –modules flag is not specified the default
modules are run.

Continue reading

Comparison between 3528 LEDs and 5050 LEDs: What are SMD 3528 and SMD 5050 LEDs?

Comparison between 3528 LEDs and 5050 LEDs: What are SMD 3528 and SMD 5050 LEDs?

Here’s an easy-to-understand comparison between LED chip numbers and sizes.

(Hint: the numbers are only the size of the chip!)

New to LEDs? What are LED strip lights and what can they do?

smd-led-comparison-of-5050-2835-3528-3014

Continue reading