Windows 10 VirtualBox N33Bcoin: Difference between revisions

From CompleteNoobs
Jump to navigation Jump to search
AwesomO (talk | contribs)
AwesomO (talk | contribs)
 
Line 28: Line 28:
netsh advfirewall firewall show rule name="N33Bcoin Testnet"
netsh advfirewall firewall show rule name="N33Bcoin Testnet"
</pre>
</pre>
* To Delete a Rule:
<code>netsh advfirewall firewall delete rule name="N33Bcoin Mainnet"</code>
* If you wish to tunnel all traffic from the VB to a VPS you can using wireguard, just make sure to open the port on the windows firewall for wireguard [[N33Bcoin_0.0.1#In_Container_wireguard_installation_and_setup| (tested working same as container)]]:
<code>netsh advfirewall firewall add rule name="WireGuard port" dir=in action=allow protocol=TCP localport=51820</code>


==Install Ubuntu 1804 in VirtualBox==
==Install Ubuntu 1804 in VirtualBox==

Latest revision as of 17:37, 29 April 2025

Installing Virtual box in windows 10

depends on c++

https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version

VirtualBox and extension pack

https://www.virtualbox.org/wiki/Downloads

Ubuntu 1804 iso

https://cdimage.ubuntu.com/ubuntu-mate/releases/18.04/release/

Windows open ports pass firewall

  • Run "PowerShell" As Administrator
netsh advfirewall firewall add rule name="N33Bcoin Mainnet" dir=in action=allow protocol=TCP localport=3333

netsh advfirewall firewall add rule name="N33Bcoin Testnet" dir=in action=allow protocol=TCP localport=13333

  • verify with:
netsh advfirewall firewall show rule name="N33Bcoin Mainnet"

netsh advfirewall firewall show rule name="N33Bcoin Testnet"

  • To Delete a Rule:

netsh advfirewall firewall delete rule name="N33Bcoin Mainnet"

  • If you wish to tunnel all traffic from the VB to a VPS you can using wireguard, just make sure to open the port on the windows firewall for wireguard (tested working same as container):

netsh advfirewall firewall add rule name="WireGuard port" dir=in action=allow protocol=TCP localport=51820

Install Ubuntu 1804 in VirtualBox

Did unattended install with 2GB ram and 25gb HD.

  • NOTE: you may want to change display resolution. MENU (TOP RIGHT) > Preferences > Displays

Your going to want Ubuntu pro.

  • Ubuntu pro is free for upto 5 boxes/installs running at once

Sign up to ubuntu and on the https://ubuntu.com/pro/dashboard you will see a long token Like:K34ssudkjVFe5334sDF For some reason when installing through VirtualBox Unattended install user is not in the sudo group and cannot use sudo.

  • which to root user

su root

  • Adduser to sudoers

adduser vboxuser sudo

  • Need to update and upgrade before adding pro

apt update && apt upgrade -y

  • Upgrade 1804 to PRO for updates - Recommended Step, not required.

pro attach YOUR_LONG_TOKEN

  • again after pro, update & upgrade & restart

apt update && apt upgrade -y && reboot

Installing depends to build coin

sudo apt install build-essential

sudo apt install autoconf libtool pkg-config libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libevent-dev libcanberra-gtk-module libdb++-dev qtbase5-dev qt5-qmake libdb-dev libdb++-dev -y

wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz

sha256sum db-4.8.30.NC.tar.gz

  • hash should return:12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef

tar -xf db-4.8.30.NC.tar.gz

cd db-4.8.30.NC/build_unix

export BDB_PREFIX=$(pwd)

../dist/configure --disable-shared --enable-cxx --with-pic --prefix=$BDB_PREFIX CXXFLAGS="-fno-builtin-__atomic_compare_exchange"

Try the build: make

sudo make install

Download N33Bcoin

  • Now thats done we can carry on

cd ~/

  • Download N33Bcoins

wget https://raw.github.com/CompleteNoobs/N33Bcoin/main/N33Bcoin.0.0.1.tar.gz

  • Check Sum should return:0695dceaa4a88967560695f92c753d2fe4abc0f1b0cfb2673bf945fc83fb1225

sha256sum N33Bcoin.0.0.1.tar.gz

  • extract

tar xzvf N33Bcoin.0.0.1.tar.gz

  • Make sure in correct path/directory

cd ~/N33Bcoin

./autogen.sh

./configure CPPFLAGS="-I${BDB_PREFIX}/include/ -O2" LDFLAGS="-L${BDB_PREFIX}/lib/"

  • Note: -j2 will use 2 cores (i have 4 cores with 2 in the vm), you can use just make (will use 1 core) or use any amount of cores you want from system with -j<number>

make -j2

Start Coin and Config

  • Start node

src/n33bcoind -daemon

If you forgot to include -daemon:

The -daemon will have n33bcoind run in background, as a daemon. If you did not include you can use the kill command to close.

  • ps aux | grep n33bcoin
vboxuser  12345  1.0  0.5 123456 7890 ?  S  12:00  0:01 src/n33bcoind
  • kill -9 <number>
  • stop node

src/n33bcoin-cli stop

  • $EDITOR is a place holder for an editor of your choice - use nano or can be done in gui with pluma

$EDITOR ~/.n33bcoin/n33bcoin.conf

rpcuser=coinuser
rpcpassword=coinpassword
rpcallowip=127.0.0.1
rpcbind=127.0.0.1
rpcport=3366
daemon=1
server=1
addnode=node.n3wbcoin.com:3333
  • Note: once daemon=1 is included in n33bcoin.conf, you no longer need to append -daemon

src/n33bcoind

  • Get address

src/n33bcoin-cli getnewaddress

Install n33bcoin

  • Installing n33bcoin means we no longer are required to use path
  • Make sure you are in correct path:

cd ~/N33Bcoin/

  • Install n33bcoin

sudo make install

mining

sudo apt install -y build-essential libcurl4-openssl-dev git

cd ~

git clone https://github.com/pooler/cpuminer.git

cd cpuminer

./autogen.sh

./configure

make

sudo make install


  • OK lets mine us some coins
    • Syntax:minerd -o <pool_url> -u <username> -p <password> --coinbase-addr=<public_key>

minerd -a sha256d -o http://127.0.0.1:3366 -u coinuser -p coinpassword --coinbase-addr=19S2thMqbYhwB6doLYQamStkzEyuqZs5Yn

  • Generate your own address (don’t use the example 19S2thMqbYhwB6doLYQamStkzEyuqZs5Yn)


  • YAY, back to the days when you could find bitcoin blocks with a simple CPU

Wallet Basics

Get Balance

  • getbalance

n33bcoin-cli getbalance

  • If you found a block, it will me immature for another 100 blocks, but you can see them in your immature_balance by using getwalletinfo
    • immature_balance: Mined coins not yet spendable (wait for 100 confirmations).
  • getwalletinfo

n33bcoin-cli getwalletinfo

list Account Addresses

  • listreceivedbyaddress 0 true

n33bcoin-cli listreceivedbyaddress 0 true

Create New Address

  • getnewaddress

n33bcoin-cli getnewaddress

Sending coins

  • Syntax: n33bcoin-cli sendtoaddress "<address>" <amount>

n33bcoin-cli sendtoaddress "1Ak9irgvsb6GecB5TUnoTdMZ9EpqvpJhfz" 33

  • This comand will return a hash in your terminal out put.
f4e5e498a204c0ddc50eff3a96c21df9c7dea4145f58850878e0b73d609033b7

See Transaction Details from hash

  • the transaction hash is from the above send coins example
  • Syntax: n33bcoin-cli gettransaction "<transaction_hash>"

n33bcoin-cli gettransaction "f4e5e498a204c0ddc50eff3a96c21df9c7dea4145f58850878e0b73d609033b7"

{
  "amount": -33.00000000,
  "fee": -0.00004520,
  "confirmations": 4,
  "blockhash": "000000001de9c3c29b7e56f0b99915819e9b05390f4dfa6131975e0be2353025",
  "blockindex": 1,
  "blocktime": 1744553765,
  "txid": "f4e5e498a204c0ddc50eff3a96c21df9c7dea4145f58850878e0b73d609033b7",
  "walletconflicts": [
  ],
  "time": 1744553764,
  "timereceived": 1744553764,
  "bip125-replaceable": "no",
  "details": [
    {
      "account": "",
      "address": "1Ak9irgvsb6GecB5TUnoTdMZ9EpqvpJhfz",
      "category": "send",
      "amount": -33.00000000,
      "vout": 0,
      "fee": -0.00004520,
      "abandoned": false
    }
  ],
  "hex": "020000000150a37ad36c761374df6a14c20bd2c016208358bf1f20af06c5acbe4827250ee7000000006a4730440220582f2094aca19d63744d8d128c3dea907cddd4eeb5728d6f064c4168d7a36b9c0220649b2397635fe0b8899fea4535b0072e856a164235f8ab8feb91f3dbfa9e3ddc012103dd8d842cd0c2b167b507b9e8ee580fc726262bb218abc5c6487668b72e5673a3feffffff020001b2c4000000001976a9146ae24c8430bcd30bc1b812f946229fcc563eb0ef88ac589a23fc060000001976a9141e0606800605f94643f5da7e0a31e435e030855788acbe000000"
}

List Transactions from account

  • listtransactions
  • n33bcoin-cli listtransactions
  • This command will show all transactions send and receive.
[
  {
    "account": "",
    "address": "1Ak9irgvsb6GecB5TUnoTdMZ9EpqvpJhfz",
    "category": "receive",
    "amount": 33.00000000,
    "label": "",
    "vout": 0,
    "confirmations": 6,
    "blockhash": "000000001de9c3c29b7e56f0b99915819e9b05390f4dfa6131975e0be2353025",
    "blockindex": 1,
    "blocktime": 1744553765,
    "txid": "f4e5e498a204c0ddc50eff3a96c21df9c7dea4145f58850878e0b73d609033b7",
    "walletconflicts": [
    ],
    "time": 1744553766,
    "timereceived": 1744553766,
    "bip125-replaceable": "no"
  }
]

Address With Label

  • Create New Address With Label
    • Syntax: getnewaddress "<Label>"
  • NOTE: Label name is case sensitive.

n33bcoin-cli getnewaddress "Mining"

1AteBLozx2DE1mXyXSoZryjGjaoUyaLYiB
  • See Accounts in Label

n33bcoin-cli getaddressesbyaccount "Mining"

  • a Label can hold many addresses
[
  "1AteBLozx2DE1mXyXSoZryjGjaoUyaLYiB"
]
  • Lists transactions for the labeled account.

n33bcoin-cli listtransactions "Mining"

  • Tracking with a label - Shows total balance for addresses in the labeled account.

n33bcoin-cli getbalance "Mining"

  • Label an existing address - Assigns an existing address to a named account.

n33bcoin-cli setaccount "<address>" "<label>"

  • Change Label of Address

n33bcoin-cli setaccount "<address>" "<newlabel>"