• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Core library for Obyte

Obyte core library (Ocore)

This is a library used in Obyte clients. Some of the clients that require the library:

  • GUI wallet - GUI wallet for Mac, Windows, Linux, iOS, and Android.
  • Headless wallet - headless wallet, primarily for server side use.
  • Obyte Relay - relay node for Obyte network. It doesn't hold any private keys.
  • Obyte Hub - hub for Obyte network. Includes the relay, plus can store and forward end-to-end encrypted messages among devices on the Obyte network.

Developer guides

See the Developer resources site. Also, you'll find loads of examples in other Obyte repositories. For internal APIs, see the exports of node.js modules.

This repo is normally used as a library and not installed on its own, but if you are contributing to this project then fork, git pull, npm install, and npm test to run the tests.

Configuring

The default settings are in the library's conf.js, they can be overridden in your project root's conf.js (see the clients above as examples), then in conf.json in the app data folder. The app data folder is:

  • macOS: ~/Library/Application Support/<appname>
  • Linux: ~/.config/<appname>
  • Windows: %LOCALAPPDATA%\<appname>

<appname> is name in your package.json.

Settings

This is the list of some of the settings that the library understands (your app can add more settings that only your app understands):

conf.port

The port to listen on. If you don't want to accept incoming connections at all, set port to null, which is the default. If you do want to listen, you will usually have a proxy, such as nginx, accept websocket connections on standard port 443 and forward them to your Obyte daemon that listens on port 6611 on the local interface.

conf.storage

Storage backend -- mysql or sqlite, the default is sqlite. If sqlite, the database files are stored in the app data folder. If mysql, you need to also initialize the database with SQL file and set connection params, e.g. in conf.json in the app data folder:

{
	"port": 6611,
	"storage": "mysql",
	"database": {
		"max_connections": 30,
		"host"     : "localhost",
		"user"     : "obyte_user",
		"password" : "yourmysqlpassword",
		"name"     : "obyte_db"
	}
}

conf.bLight

Work as light client (true) or full node (false). The default is full client.

conf.bServeAsHub

Whether to serve as hub on the Obyte network (store and forward e2e-encrypted messages for devices that connect to your hub). The default is false.

conf.myUrl

If your node accepts incoming connections, this is its URL. The node will share this URL with all its outgoing peers so that they can reconnect in any direction in the future. By default the node doesn't share its URL even if it accepts connections.

conf.bWantNewPeers

Whether your node wants to learn about new peers from its current peers (true, the default) or not (false). Set it to false to run your node in stealth mode so that only trusted peers can see its IP address (e.g. if you have online wallets on your server and don't want potential attackers to learn its IP).

conf.socksHost, conf.socksPort, and conf.socksLocalDNS

Settings for connecting through optional SOCKS5 proxy. Use them to connect through TOR and hide your IP address from peers even when making outgoing connections. This is useful and highly recommended when you are running an online wallet on your server and want to make it harder for potential attackers to learn the IP address of the target to attack. Set socksLocalDNS to false to route DNS queries through TOR as well.

conf.httpsProxy

Setting for connecting through an optional HTTPS proxy. Use it when your local network can only access the Internet via an http proxy server. When both socks5 and http proxy are set, socks5 takes precedence. The configuration value is the full URL to the proxy server, eg. http://proxy:3128

conf.smtpTransport, conf.smtpRelay, conf.smtpPort, conf.smtpUser, and conf.smtpPassword

Settings for sending email. They are used e.g. if your node needs to send notifications. smtpTransport can take one of three values:

  • local: send email using locally installed sendmail. Normally, sendmail is not installed by default and when installed, it needs to be properly configured to actually send emails. If you choose this option, no other conf settings are required for email. This is the default option.
  • direct: send email by connecting directly to the recipient's SMTP server. This option is not recommended.
  • relay: send email through a relay server, like most email apps do. You need to also configure the server's host smtpRelay, its port smtpPort if it differs from the default port 25, and smtpUser and smtpPassword for authentication to the server.

MySQL conf for faster syncing

To lower disk load and increase sync speed, you can optionally disable flushing to disk every transaction, instead doing it once a second. This can be done by setting innodb_flush_log_at_trx_commit=0 in your MySQL server config file (my.ini)

Accepting incoming connections

Obyte network works over secure WebSocket protocol wss://. To accept incoming connections, you'll need a valid TLS certificate (you can get a free one from letsencrypt.org) and a domain name (you can get a free domain from Freenom). Then you accept connections on standard port 443 and proxy them to your locally running Obyte daemon.

This is an example configuration for nginx to accept websocket connections at wss://byteball.one/bb and forward them to locally running daemon that listens on port 6611:

If your server doesn't support IPv6, comment or delete the two lines containing [::] or nginx won't start

server {
	listen 80 default_server;
	listen [::]:80 default_server;
	listen 443 ssl;
	listen [::]:443 ssl;
	ssl_certificate "/etc/letsencrypt/live/byteball.one/fullchain.pem";
	ssl_certificate_key "/etc/letsencrypt/live/byteball.one/privkey.pem";

	if ($host != "byteball.one") {
		rewrite ^(.*)$ https://byteball.one$1 permanent;
	}
	if ($https != "on") {
		rewrite ^(.*)$ https://byteball.one$1 permanent;
	}

	location = /bb {
		proxy_pass http://localhost:6611;
		proxy_http_version 1.1;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
	}

	root /var/www/html;
	server_name _;
}

By default Node limits itself to 1.76GB the RAM it uses. If you accept incoming connections, you will likely reach this limit and get this error after some time:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
...
...
12: 0x3c0f805c7567
Out of memory

To prevent this, increase the RAM limit by adding --max_old_space_size=<size> to the launch command where size is the amount in MB you want to allocate.

For example --max-old-space-size=4096, if your server has at least 4GB available.

Donations

We accept donations through Kivach and forward a portion of the donations to other open-source projects that made Obyte possible.

Kivach

More Repositories

1

obyte-gui-wallet

Smart payments made simple
JavaScript
419
star
2

headless-obyte

Headless Obyte wallet
JavaScript
26
star
3

obyte-hub

Hub for Obyte network
JavaScript
19
star
4

ico-bot

A bot for running an ICO
JavaScript
18
star
5

flight-delays-insurance

Flight delays insurance bot
JavaScript
17
star
6

stablecoin-t1-arbitrage

Arbitrage bot for trading between T1 and the reserve currency on bonded stablecoins
JavaScript
17
star
7

obyte-witness

Order provider (witness) for Obyte network
JavaScript
15
star
8

stablecoin-interest-arbitrage

JavaScript
13
star
9

go-byteballcore

Golang implementation of byteballcore
Go
12
star
10

odex-frontend

Frontend for ODEX decentralized exchange https://odex.ooo
JavaScript
10
star
11

sports-oracle

An oracle that posts results of sports events into Byteball database
JavaScript
10
star
12

counterstake-bridge

Assistant/watchdog for Counterstake Bridge https://counterstake.org
JavaScript
10
star
13

btc-exchange

Exchange between Bytes and BTC in chatbot interface
JavaScript
8
star
14

counterstake-sdk

Counterstake SDK for integrating cross-chain transactions in your dapps https://counterstake.org
JavaScript
8
star
15

counterstake-bridge-ui

Cross-chain bridge based on Counterstake protocol https://counterstake.org
JavaScript
7
star
16

obyte-web

Obyte.org website
HTML
7
star
17

obyte-exchange

Trustless exchange of public assets issued on Byteball platform
JavaScript
7
star
18

btc-oracle

An oracle that posts data about recent Bitcoin payments into Obyte distributed ledger
JavaScript
7
star
19

obyte-explorer

View the DAG and all public transactions https://explorer.obyte.org
JavaScript
6
star
20

buy-with-card

This bot helps to buy Bytes with Visa or Mastercard
JavaScript
5
star
21

rpcify

RPCify node.js modules
JavaScript
4
star
22

obyte-relay

Relay for Byteball network
JavaScript
4
star
23

bonded-stablecoin-buffer

An Autonomous Agent that helps to buy T2 tokens of bonded stablecoins with minimum fee
JavaScript
4
star
24

liquidity-providers-distribution

Get rewarded for providing liquidity to selected Oswap.io pools.
JavaScript
4
star
25

obyte-data-feed

Oracle that posts a data feed to Obyte decentralized ledger
JavaScript
4
star
26

prediction-markets-ui

Prediction markets based on bonding curves https://prophet.ooo
JavaScript
4
star
27

bonded-stablecoin-ui

UI for bonded stablecoins https://ostable.org
JavaScript
3
star
28

OIPs

Obyte Improvement Proposals
3
star
29

obyte-faucet

Faucet for Byteball testnet
JavaScript
3
star
30

real-name-attestation

Real name attestation bot
JavaScript
3
star
31

flight-delays-oracle

Oracle that reports flight delays
JavaScript
3
star
32

bot-example

Example source code for Byteball chatbot
JavaScript
3
star
33

odex-wallet

Wallet of ODEX decentralized exchange https://odex.ooo
JavaScript
3
star
34

odex-orderbook-replication

Order book replication bot for creating liquidity on ODEX
JavaScript
3
star
35

email-attestation

A bot that attests the user's email address
JavaScript
3
star
36

steem-attestation

A bot that attests the user's Steem username
JavaScript
3
star
37

stablecoins-stats-api

Stats API for ostable.org
JavaScript
3
star
38

oscript-vscode-plugin

VSCode plugin for editing Oscript files and writing Autonomous Agents
JavaScript
3
star
39

arbstore_front

Arbstore decentralized escrow https://arbstore.org
Vue
2
star
40

poll-bot

Obyte chatbot to help collect votes in polls
JavaScript
2
star
41

token-registry-ui

UI for token name registry https://tokens.ooo
TypeScript
2
star
42

stable-oswap-arb

Arbitrage AA and bot for arbitraging between Ostable and 2 Oswap pools
JavaScript
2
star
43

bonded-stablecoin

Bonded stablecoins AA https://ostable.org
JavaScript
2
star
44

telegram-quiz

Telegram chatbot that allows users to pass a quiz and get some Bytes
JavaScript
2
star
45

username-attestation

A bot that sells usernames. Usernames allow to send money to @username instead of Byteball address.
JavaScript
2
star
46

obyte-merchant

Chatbot for a merchant on Byteball network
JavaScript
2
star
47

aa-channels-lib

General purpose library for payment channels
JavaScript
2
star
48

pay-per-call-API

JavaScript
2
star
49

discount-stablecoin-ui

Frontend for Discount Stablecoins https://discount.ostable.org
JavaScript
2
star
50

conditional-token-sale

A bot that sells a token via conditional payment smart contracts
JavaScript
2
star
51

line

LINE Token
Solidity
1
star
52

accredited-investor-attestation

A bot for attestation of accredited investor status
JavaScript
1
star
53

aabot

An Obyte node for interacting with Autonomous Agents and tracking their state
JavaScript
1
star
54

obyte-explorer-frontend

Obyte DAG explorer https://explorer.obyte.org
JavaScript
1
star
55

oswap-triangular-arb

Triangular arbitrage among Oswap pools
JavaScript
1
star
56

obyte-cascading-donations

Cascading donations AA https://kivach.org
JavaScript
1
star
57

stablecoins-discord-bot

Watch Obyte bonded stablecoins and post event notifications on Discord
JavaScript
1
star
58

aa-stats-front

AA Statistics Frontend https://aa-stats.obyte.org
TypeScript
1
star
59

aa_stats

AA Statistics API https://aa-stats.obyte.org
JavaScript
1
star
60

oswap-v2-aa

AAs for Oswap v2
JavaScript
1
star
61

odds-maker-interface

Sell betting tokens easily on Odex exchange
Vue
1
star
62

cascading-donations-ui

Cascading donations https://kivach.org
TypeScript
1
star
63

upbit-orderbook-replication

Upbit order book replication bot
JavaScript
1
star
64

oscript-editor

Online editor for Oscript - a language of autonomous agents https://oscript.org
JavaScript
1
star
65

bitz-orderbook-replication

Bit-Z order book replication bot
JavaScript
1
star
66

sports-betting

Sports betting with tokens
JavaScript
1
star
67

discount-stablecoin-aa

Autonomous Agent for Discount Stablecoins https://discount.ostable.org
JavaScript
1
star
68

odex-backend

Backend of ODEX decentralized exchange
Go
1
star
69

aa-hooks

Library for working with autonomous agent events
JavaScript
1
star
70

oswap-v2-sdk

SDK for interacting with Oswap v2
JavaScript
1
star
71

oswap-token-aa

AA that issues OSWAP token
JavaScript
1
star
72

prediction-markets-backend

Prediction markets based on bonding curves https://prophet.ooo
JavaScript
1
star