2.0.3 • Published 2 years ago

vischain v2.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Viscoin

Official Typescript implementation of the Viscoin protocol.

What is Viscoin?

Viscoin is an experimental digital currency that lives on the internet. Payments can be made by anyone, to anyone, at any time, anywhere in the world, and are carried out collectively by the network with the use of peer-to-peer technology. Cryptography makes trusting a central authority obsolete when anyone with a computer can verify that a transaction is valid.

Coin Specifications

SpecificationValue
Mining algorithmArgon2d (Argon2)
Approximate block time1 minute
Initial mining reward1 Viscoin
Precision1e-8 (0.00000001)
Genesis timestamp1609459200000 (Fri, 01 Jan 2021 00:00:00 GMT)
Block halvingEvery 2100000 blocks (Roughly every 4 years)
Max block size65536 bytes
Port9333

Setup & Installation

  1. git clone https://github.com/viscoin/viscoin
  2. cd viscoin
  3. npm run setup

Configuration

Create a .env file in the root of the project.

HTTP_API=:80
TCP_API=:9332
TCP_NODE=:9333
DEBUG=0
ADDRESS=your_mining_address

Wallet

  • node wallet

Miner

  • node miner

Fullnode

  1. node net-config
  2. Add addresses to other nodes that are part of the Viscoin network.
  3. *Using pm2* pm2 start fullnode.js *or with docker* docker-compose up -d.

Tor hidden service

/etc/tor/torrc

HiddenServiceDir /var/lib/tor/viscoin-service/
HiddenServicePort 9333 127.0.0.1:9333

.env

USE_PROXY=1
ONION_ADDRESS=XXXXXXXXXXX.onion

Important

If your system clock is off by more than 3 seconds the network will reject your blocks. Check with Time.is if you are synchronized with the official atomic clock time for any time zone.

Package usage

Installation

npm install viscoin

Examples

Generating a wallet

import { Wallet } from 'viscoin'
const wallet = new Wallet()
console.log(wallet.address)

Get latest block (HTTP Request)

import { HTTPApi } from 'viscoin'
(async () => {
    const block = await HTTPApi.getLatestBlock({ host: 'localhost', port: 80 })
    console.log(block)
})()

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.