Btcix - Golang implementation for BTCIX Network

Related tags

Cryptography btcix
Overview

BTCIX Mainnet client

Golang implementation for BTCIX Network

Mainnet information [For geth, also mentioned in config.toml]

NetworkId = 19845
SyncMode = "full"

Public Chain information [For metamask]

Chain ID: 19845
Mainnet RPC URL : seed.btcix.org
Block Explorer: http://btcixscan.com
Symbol:BTCIX

Programmatically interfacing geth nodes

HTTP based JSON-RPC API options:

  • --http Enable the HTTP-RPC server
  • --http.addr HTTP-RPC server listening interface (default: localhost)
  • --http.port HTTP-RPC server listening port (default: 8545)
  • --http.api API's offered over the HTTP-RPC interface (default: eth,net,web3)
  • --http.corsdomain Comma separated list of domains from which to accept cross origin requests (browser enforced)
  • --ws Enable the WS-RPC server
  • --ws.addr WS-RPC server listening interface (default: localhost)
  • --ws.port WS-RPC server listening port (default: 8546)
  • --ws.api API's offered over the WS-RPC interface (default: eth,net,web3)
  • --ws.origins Origins from which to accept websockets requests
  • --ipcdisable Disable the IPC-RPC server
  • --ipcapi API's offered over the IPC-RPC interface (default: admin,debug,eth,miner,net,personal,shh,txpool,web3)
  • --ipcpath Filename for IPC socket/pipe within the datadir (explicit paths escape it) If you want to access RPC from other containers and/or hosts then you can expose your http rpc by --http.addr 0.0.0.0 [ Caution: this will expose it to all of btcix geth nodes]. By default, geth binds to the local interface and RPC endpoints is not accessible from the outside. there are secure ways to do it using nginx security which adds http authentication over geth layer. Please follow extra_security.md for nginx security.

Operating a geth full node

Become Root

sudo su

Create bitco User

sudo useradd -m bitco

Switch To The New User's Home

cd /home/bitco

Download The Client

wget https://github.com/Bitcolojix/btcix/releases/download/v1.10.14/geth_linux
chmod +x geth_linux
wget https://github.com/Bitcolojix/btcix/releases/download/v1.10.14/btcix_genesis.json
wget https://github.com/Bitcolojix/btcix/releases/download/v1.10.14/config.toml
./geth_linux init btcix_genesis.json -datadir ./btcix 

Above command will end with following message "Successfully wrote genesis state " it will also create a directory called btcix in /home/bitco

Create start.sh and console.sh


echo './geth_linux --http --http.addr '127.0.0.1' --http.corsdomain "*" --http.port 8503 --http.api 'eth,net,web3,txpool,personal'  --allow-insecure-unlock --config config.toml' > start.sh

chmod +x start.sh

echo "./geth_linux attach ipc:btcix/geth.ipc" > console.sh
chmod +x console.sh

[Optional]

echo "./geth_linux --datadir ./btcix "$@"" > cli.sh
chmod +x cli.sh

Setup systemd

sudo nano /lib/systemd/system/btcix.service

Then paste the following;

[Unit]
Description=Btcix Full node

[Service]
User=bitco
Type=simple
WorkingDirectory=/home/bitco
ExecStart=/bin/bash /home/bitco/start.sh
Restart=on-failure
RestartSec=5

[Install]
WantedBy=default.target

After that;

chown -R bitco.bitco /home/bitco/*
systemctl enable btcix
systemctl start btcix

Check info of node

./console.sh

CLI Usages


./cli.sh account new
./cli.sh account list

Securing Node

Create alpha numeric strings from here
1. 6+ chars long  nginx username
2. 32 chars long  nginx password


nginx user:MMxf9RMA
nginx Pass:DkfjW3FJSGLlBg0XvYrMudFDTCFszmpYYvkc


Creating First account

./cli.sh account new

Or 

./console.sh

then type 

 personal.newAccount()
passPhrase:
Repeast Password:
prompt will ask
Your new account is locked with a password. Please give a password. Do not forget this password.
Enter your first account pass
Password:claEHfMZmHvY5dqoTU6BtHIecFhV4Z6SFJjt
Repeat Password:claEHfMZmHvY5dqoTU6BtHIecFhV4Z6SFJjt

Result
Public address of the key:   0xG124634534650A355456453665436544365
Path of the secret key file: mainnet/keystore/UTC--2022-01-06T06-46-38.255700718Z--G124634534650A355456453665436544365

- You can share your public address with anyone. Others need it to interact with you.
- You must NEVER share the secret key with anyone! The key controls access to your funds!
- You must BACKUP your key file! Without the key, it's impossible to access account funds!
- You must REMEMBER your password! Without the password, it's impossible to decrypt the key!

Cross Checking if password you entered is correct [its must to avoid loosing funds]

personal.unlockAccount("0xG124634534650A355456453665436544365") Unlock account claEHfMZmHvY5dqoTU6BtHIecFhV4Z6SFJjt Passphrase:claEHfMZmHvY5dqoTU6BtHIecFhV4Z6SFJjt true

When it says true then it means password is correct .

@todo Now backup following file [This is a json file ]

mainnet/keystore/UTC--2021-08-27T06-46-38.255700718Z--G124634534650A355456453665436544365

and save your password for first account somewhere same.

Nginx Security Installation

Installing nginx on Ubuntu 20 ref: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04

sudo apt update
sudo apt install nginx
systemctl status nginx

@todo adjust firewall to allow ip of nginx from only your reliable ip

sudo sh -c "echo -n 'MMxf9RMA:' >> /etc/nginx/.htpasswd"
sudo sh -c "openssl passwd -apr1 >> /etc/nginx/.htpasswd"

password for nginx=DkfjW3FJSGLlBg0XvYrMudFDTCFszmpYYvkc

sudo nano /etc/nginx/sites-available/default
server {
 listen 8503;
 listen [::]:8503;
 # ADDED THESE TWO LINES FOR AUTHENTICATION
auth_basic "No Access";
auth_basic_user_file /etc/nginx/.htpasswd; 
 #server_name example.com;
 location / {
      proxy_pass http://localhost:5469/;
      proxy_set_header Host $host;
 }
}
sudo service nginx reload

Now your Ethereum RPC apis would be available via [if your server ip is 222.333.444.555

nginx user:MMxf9RMA nginx Pass:DkfjW3FJSGLlBg0XvYrMudFDTCFszmpYYvkc

http://MMxf9RMA:[email protected]:5469

License

The go-ethereum library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The go-ethereum binaries (i.e. all code inside of the cmd directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

You might also like...
Practicing network programming using Go. These are some fundamental APIs

Go Networking This repository is a collection of Network Programming APIs or sim

 Ethereum Consortium Network Deployments Made Easy
Ethereum Consortium Network Deployments Made Easy

Ethereum Consortium Network Deployments Made Easy Overview The next phase of our support of blockchain on Microsoft Azure is the release of the Ethere

Boxen - put your network operating systems in a box!

boxen boxen -- put your network operating systems in a box (or if you speak 🇩🇪 , fight them! 🤣 )! boxen is a cli tool written in Go that allows you

Minlib - Multi-Identifier Network Development Library

minlib 1. Install git clone https://gitea.qjm253.cn/PKUSZ-future-network-lab/min

FabricPing: Network tools for service fabric

FabricPing Network debugging tools for Service Fabric Install Windows powershell

A simplified blockchain implementation in Golang

A simplified blockchain implementation in Golang

Interblockchain communication protocol (IBC) implementation in Golang.

ibc-go Interblockchain communication protocol (IBC) implementation in Golang built as a SDK module. Components Core The core/ directory contains the S

Celer cBridge relay node implementation in Golang

cBridge Relay Node Official implementation of cBridge relay node in Golang. Prerequisites Prepare Machine To run a cBridge relay node, it is recommend

Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated builds are available for stable releases and the unstable master branch

Owner
BITCOLOJIX
Bitcolojix Ai System
BITCOLOJIX
An implementation of the Filecoin Distributed Storage Network

Project Lotus - 莲 Lotus is an implementation of the Filecoin Distributed Storage Network. For more details about Filecoin, check out the Filecoin Spec

null 0 Oct 27, 2021
XDC.Network Rosetta API Implementation

Rosetta XDC.Network ROSETTA XDC.Network IS CONSIDERED ALPHA SOFTWARE. USE AT YOUR OWN RISK! COINBASE ASSUMES NO RESPONSIBILITY OR LIABILITY IF THERE I

null 3 Nov 28, 2022
This is a close to decentralized RSS3 Network implementation of RSS3 protocol v0.4.0 with full indexing function in Go

This is a close to decentralized RSS3 Network implementation of RSS3 protocol v0.4.0 with full indexing function in Go

Natural Selection Labs 48 Aug 4, 2022
Yet another Binance Smart Chain client based on TrustFi Network

TrustFi Smart Chain The goal of TrustFi Smart Chain is to bring programmability and interoperability to Binance Chain. In order to embrace the existin

TrustFi Network 19 Mar 27, 2021
Community-run technology powering the cryptocurrency, and decentralized applications on TrustFi Network

Go TrustFi-Ethereum Official Golang implementation of the TrustFi-Ethereum protocol. Automated builds are available for stable releases and the unstab

TrustFi Network 786 May 26, 2021
Split and distribute your private keys securely amongst untrusted network

cocert An experimental tool for splitting and distributing your private keys safely* cocert, generates ECDSA - P521 key and uses a technique known as

Furkan Türkal 189 Dec 5, 2022
LEO (Low Ethereum Orbit) is an Ethereum Portal Network client.

LEO LEO (Low Ethereum Orbit) is an Ethereum Portal Network client. What makes LEO different from other Portal Network clients is that it uses libp2p f

Valist, Inc. 10 Apr 19, 2022
Uniform interface for interacting with network hardware via telnet/ssh

jgivc/console This package provides a uniform interface for interacting with network hardware via telnet/ssh This package uses part of reiver/go-telne

null 0 Dec 9, 2021
Avalanche: a network composed of multiple blockchains

Coreth and the C-Chain Avalanche is a network composed of multiple blockchains.

Ava Labs 132 Dec 14, 2022