From ea937f186437f4fcaf640214f71c1703c69c1c85 Mon Sep 17 00:00:00 2001
From: Dmitriy Gerasimov <naeper@demlabs.net>
Date: Wed, 14 Apr 2021 20:53:16 +0700
Subject: [PATCH] [+] Darwin-specific files

---
 .gitignore                                    |   2 +-
 dist.darwin/etc/network/core-t/chain-0.cfg    |  28 +++++
 .../etc/network/core-t/chain-plasma.cfg       |  31 +++++
 .../etc/network/kelvin-testnet/chain-0.cfg    |  29 +++++
 .../network/kelvin-testnet/chain-plasma.cfg   |  30 +++++
 .../etc/network/private.cfg.dbg               |   0
 .../etc/network/private/chain-gdb.cfg         |   0
 .../share/configs/cellframe-node.cfg.tpl      | 118 ++++++++++++++++++
 .../etc/network/core-t/chain-0.cfg            |   0
 .../etc/network/core-t/chain-plasma.cfg       |   0
 .../etc/network/kelvin-testnet/chain-0.cfg    |   0
 .../network/kelvin-testnet/chain-plasma.cfg   |   0
 dist.linux/etc/network/private.cfg.dbg        |  24 ++++
 dist.linux/etc/network/private/chain-gdb.cfg  |  10 ++
 .../share/configs/cellframe-node.cfg.tpl      |   0
 .../share/configs/network/core-t.cfg.tpl      |  23 ++++
 .../configs/network/kelvin-testnet.cfg.tpl    |  30 +++++
 .../share/configs/network/private.cfg.tpl     |  25 ++++
 18 files changed, 349 insertions(+), 1 deletion(-)
 create mode 100644 dist.darwin/etc/network/core-t/chain-0.cfg
 create mode 100644 dist.darwin/etc/network/core-t/chain-plasma.cfg
 create mode 100644 dist.darwin/etc/network/kelvin-testnet/chain-0.cfg
 create mode 100644 dist.darwin/etc/network/kelvin-testnet/chain-plasma.cfg
 rename {dist => dist.darwin}/etc/network/private.cfg.dbg (100%)
 rename {dist => dist.darwin}/etc/network/private/chain-gdb.cfg (100%)
 create mode 100644 dist.darwin/share/configs/cellframe-node.cfg.tpl
 rename {dist => dist.linux}/etc/network/core-t/chain-0.cfg (100%)
 rename {dist => dist.linux}/etc/network/core-t/chain-plasma.cfg (100%)
 rename {dist => dist.linux}/etc/network/kelvin-testnet/chain-0.cfg (100%)
 rename {dist => dist.linux}/etc/network/kelvin-testnet/chain-plasma.cfg (100%)
 create mode 100644 dist.linux/etc/network/private.cfg.dbg
 create mode 100644 dist.linux/etc/network/private/chain-gdb.cfg
 rename {dist => dist.linux}/share/configs/cellframe-node.cfg.tpl (100%)
 create mode 100644 dist.linux/share/configs/network/core-t.cfg.tpl
 create mode 100644 dist.linux/share/configs/network/kelvin-testnet.cfg.tpl
 create mode 100644 dist.linux/share/configs/network/private.cfg.tpl

diff --git a/.gitignore b/.gitignore
index e97c60912..667d2f23f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,7 @@ test/build
 *.ko
 *.obj
 *.elf
-
+.DS_Store
 # Linker output
 *.ilk
 *.map
diff --git a/dist.darwin/etc/network/core-t/chain-0.cfg b/dist.darwin/etc/network/core-t/chain-0.cfg
new file mode 100644
index 000000000..65e532297
--- /dev/null
+++ b/dist.darwin/etc/network/core-t/chain-0.cfg
@@ -0,0 +1,28 @@
+[chain]
+id=0x0000000000000000
+shard_id=0x0000000000000000
+name=zerochain
+load_priority=1
+# Possible values [token, emission, transaction]
+datum_types=[token,emission,shard,ca,transaction]
+mempool_auto_types=[emission,transaction]
+consensus=dag_poa
+
+[files]
+storage_dir=/Applications/Cellframe.app/Contents/Resources/var/lib/network/core-t/zerochain/
+
+[dag]
+is_single_line=true
+is_celled=false
+is_add_directly=true
+datum_add_hashes_count=1
+
+is_static_genesis_event=true
+static_genesis_event=0x65D9E91CD08DBDEFAAF30AEC316DC87F8BEE482843B3EA128FF2566B53E5AFA8
+
+[dag-poa]
+auth_certs_prefix=core-t
+auth_certs_number=3
+auth_certs_number_verify=1 
+auth_certs_dir=/Applications/Cellframe.app/Contents/Resources/share/ca
+
diff --git a/dist.darwin/etc/network/core-t/chain-plasma.cfg b/dist.darwin/etc/network/core-t/chain-plasma.cfg
new file mode 100644
index 000000000..50a761a26
--- /dev/null
+++ b/dist.darwin/etc/network/core-t/chain-plasma.cfg
@@ -0,0 +1,31 @@
+[chain]
+id=0x0000000000000001
+name=plasma
+load_priority=2
+# Possible values [token, emission, transaction]
+datum_types=[transaction,ca]
+mempool_auto_types=[transaction]
+consensus=dag_pos
+
+[dag]
+is_single_line=false
+is_celled=true
+is_add_directly=true
+datum_add_hashes_count=3
+
+is_static_genesis_event=true
+static_genesis_event=0x39827168F25185FFBD0A44A41AF43265EB85D6E4A92544E72364E536C9A29D87
+
+# Proof-of-State consensus config
+[dag-pos]
+# Tokens hold and hold_value must be equel size
+# KELT - test token, KEL - main tokem
+tokens_hold=[CFNT]
+# 1000 coins for both
+tokens_hold_value=[1000000000000]
+# Confirmations minimum
+confirmations_minimum=1
+
+[files]
+storage_dir=/Applications/Cellframe.app/Contents/Resources/var/lib/network/core-t/plasma
+
diff --git a/dist.darwin/etc/network/kelvin-testnet/chain-0.cfg b/dist.darwin/etc/network/kelvin-testnet/chain-0.cfg
new file mode 100644
index 000000000..5fbe774a1
--- /dev/null
+++ b/dist.darwin/etc/network/kelvin-testnet/chain-0.cfg
@@ -0,0 +1,29 @@
+[chain]
+id=0x0000000000000000
+shard_id=0x0000000000000000
+name=zerochain
+load_priority=1
+# Possible values [token, emission, transaction] 
+datum_types=[token,emission,shard,ca,transaction]
+mempool_auto_types=[emission]
+consensus=dag_poa
+
+[files]
+storage_dir=/Applications/Cellframe.app/Contents/Resources/var/lib/network/kelvin-testnet/zerochain/
+
+[dag]
+is_single_line=true
+is_celled=false
+is_add_directly=true
+datum_add_hashes_count=1
+
+# Switched off to false because hash symbols below are not well recognized
+
+is_static_genesis_event=true
+static_genesis_event=0x642DEBE847A73FA0505C6648C1086675B6B4ADDDC4A8D333DCCD4169228E1E97
+
+[dag-poa]
+auth_certs_prefix=kelvin.testnet.root
+auth_certs_number=5
+auth_certs_number_verify=1 #4
+auth_certs_dir=/Applications/Cellframe.app/Contents/Resources/share/ca
diff --git a/dist.darwin/etc/network/kelvin-testnet/chain-plasma.cfg b/dist.darwin/etc/network/kelvin-testnet/chain-plasma.cfg
new file mode 100644
index 000000000..38babc7f2
--- /dev/null
+++ b/dist.darwin/etc/network/kelvin-testnet/chain-plasma.cfg
@@ -0,0 +1,30 @@
+[chain]
+id=0x0000000000000001
+name=plasma
+load_priority=2
+# Possible values [token, emission, transaction] 
+datum_types=[transaction,ca]
+mempool_auto_types=[transaction]
+consensus=dag_pos
+
+[dag]
+is_single_line=false
+is_celled=true
+is_add_directly=true
+datum_add_hashes_count=3
+is_static_genesis_event=true
+static_genesis_event=0x8EA91DC2E2E9271ECC8F55EFF610ADA9ED21E4CA44108A67DA11FB93831CABD8
+
+# Proof-of-State consensus config
+[dag-pos]
+# Tokens hold and hold_value must be equel size
+# KELT - test token, KEL - main tokem
+tokens_hold=[KELT,KEL]
+# 1000 coins for both
+tokens_hold_value=[1000000000,1000000000]
+# Confirmations minimum
+confirmations_minimum=1
+
+[files]
+storage_dir=/Applications/Cellframe.app/Contents/Resources/var/lib/network/kelvin-testnet/plasma
+
diff --git a/dist/etc/network/private.cfg.dbg b/dist.darwin/etc/network/private.cfg.dbg
similarity index 100%
rename from dist/etc/network/private.cfg.dbg
rename to dist.darwin/etc/network/private.cfg.dbg
diff --git a/dist/etc/network/private/chain-gdb.cfg b/dist.darwin/etc/network/private/chain-gdb.cfg
similarity index 100%
rename from dist/etc/network/private/chain-gdb.cfg
rename to dist.darwin/etc/network/private/chain-gdb.cfg
diff --git a/dist.darwin/share/configs/cellframe-node.cfg.tpl b/dist.darwin/share/configs/cellframe-node.cfg.tpl
new file mode 100644
index 000000000..12662aa27
--- /dev/null
+++ b/dist.darwin/share/configs/cellframe-node.cfg.tpl
@@ -0,0 +1,118 @@
+# General section
+[general]
+# General debug mode
+debug_mode={DEBUG_MODE}
+# Debug stream packets
+debug_dump_stream_headers=false
+# Debug I/O reactor, false by default
+#debug_reactor=false
+# Debug HTTP protocol, false by default
+#debug_http=false
+
+# seed mode. WARNING. Used true only when you start the new network
+#seed_mode=false
+
+# Auto bring up links and sync everything over them
+auto_online={AUTO_ONLINE}
+
+# Server part
+[server]
+#   By default you don't need to open you to the world
+enabled={SERVER_ENABLED}
+news_url_enabled=false
+bugreport_url_enabled=false
+listen_address={SERVER_ADDR}
+listen_port_tcp={SERVER_PORT}
+# External IPv4 address
+#ext_address=8.9.10.11
+# External IPv6 address
+#ext_address6=aaaa:bbbb:deee:96ff:feee:3fff
+#
+# If not set - used listen_port_tcp for node table auto fill
+#ext_port_tcp=8089
+
+
+# Build in DNS client (need for bootstraping)
+[dns_client]
+#request_timeout=10
+
+# Builtin DNS server
+[dns_server]
+#enabled=false
+#bootstrap_balancer=false
+
+# Ledger defaults
+[ledger]
+# More debug output
+# debug_more=true
+
+# DAG defaults
+[dag]
+# More debug output
+# debug_more=true
+
+[srv]
+order_signed_only=false
+
+[srv_dns]
+enabled=false
+pricelist=[]
+
+# Mempool
+[mempool]
+# Automaticaly should be true for master ad root node role
+# auto_proc=false
+
+# Chain network settings
+[chain_net]
+# debug_more=true
+
+[stream_ch_chain]
+# Uncomment to have more debug information in stream channel Chain
+# False by default
+#debug_more=true
+
+# Number of hashes packed into the one update packet
+# Increase it to reduce update latency
+# Decrease if bad networking
+# update_pack_size=100
+
+# VPN stream channel processing module
+[srv_vpn]
+#   Turn to true if you want to share VPN service from you node 
+enabled=false
+geoip_enabled=false
+debug_more=false
+# Grace period for service , 60 second by default
+#grace_period=60 
+#   List of loca security access groups. Built in: expats,admins,services,nobody,everybody
+network_address=10.11.12.0
+network_mask=255.255.255.0
+pricelist=[cellframe-testnet:100:KELT:3600:SEC:mywallet0]
+
+# Console interface server
+[conserver]
+enabled=true
+#listen_port_tcp=12345
+listen_unix_socket_path=/Applications/Cellframe.app/Contents/Resources/var/run/node_cli
+# Default permissions 770
+#listen_unix_socket_permissions=770
+
+# Application Resources
+[resources]
+#   0 means auto detect
+threads_cnt=0 
+# By default notify opens at /tmp/cellframe-node-notify
+#notify_path=/home/myuser/cellframe-node-notify
+#notify_permissions=770
+#notify_user=myuser
+#notify_group=mygroup
+
+pid_path=/Applications/Cellframe.app/Contents/Resources/var/run/cellframe-node.pid
+log_file=/Applications/Cellframe.app/Contents/Resources/var/log/cellframe-node.log
+wallets_path=/Applications/Cellframe.app/Contents/Resources/var/lib/wallet
+geoip_db_path=share/geoip/GeoLite2-City.mmdb
+ca_folders=[/Applications/Cellframe.app/Contents/Resources/var/lib/ca,/opt/cellframe-node/share/ca]
+dap_global_db_path=/Applications/Cellframe.app/Contents/Resources/var/lib/global_db
+dap_global_db_driver=sqlite3
+
diff --git a/dist/etc/network/core-t/chain-0.cfg b/dist.linux/etc/network/core-t/chain-0.cfg
similarity index 100%
rename from dist/etc/network/core-t/chain-0.cfg
rename to dist.linux/etc/network/core-t/chain-0.cfg
diff --git a/dist/etc/network/core-t/chain-plasma.cfg b/dist.linux/etc/network/core-t/chain-plasma.cfg
similarity index 100%
rename from dist/etc/network/core-t/chain-plasma.cfg
rename to dist.linux/etc/network/core-t/chain-plasma.cfg
diff --git a/dist/etc/network/kelvin-testnet/chain-0.cfg b/dist.linux/etc/network/kelvin-testnet/chain-0.cfg
similarity index 100%
rename from dist/etc/network/kelvin-testnet/chain-0.cfg
rename to dist.linux/etc/network/kelvin-testnet/chain-0.cfg
diff --git a/dist/etc/network/kelvin-testnet/chain-plasma.cfg b/dist.linux/etc/network/kelvin-testnet/chain-plasma.cfg
similarity index 100%
rename from dist/etc/network/kelvin-testnet/chain-plasma.cfg
rename to dist.linux/etc/network/kelvin-testnet/chain-plasma.cfg
diff --git a/dist.linux/etc/network/private.cfg.dbg b/dist.linux/etc/network/private.cfg.dbg
new file mode 100644
index 000000000..f9495efa6
--- /dev/null
+++ b/dist.linux/etc/network/private.cfg.dbg
@@ -0,0 +1,24 @@
+# Kelvin Blockchain: development network
+# General section
+[general]
+id=0xFF00000000000001
+name=private
+type=testing
+# Possible values: light, full, archive, master, root
+node-role=full
+#node-alias=addr-%node_addr%
+gdb_groups_prefix=private
+#node-addr=0x10
+# node addr exired time in hours (168h=1w 720h=1m 8760h=1y), by default 720h(1week)
+node-addr-expired=168
+
+seed_nodes_ipv4=[195.154.133.160, 62.210.90.227]
+seed_nodes_port=[8079, 8079]
+seed_nodes_aliases=[kelvin.testnet.root.0,kelvin.testnet.root.1]
+seed_nodes_addrs=[ffff::0000::0000::0001,ffff::0000::0000::0002]
+
+#[dag-poa]
+#events-sign-cert=mycert
+
+#[dag-pos]
+#events-sign-wallet=mywallet
diff --git a/dist.linux/etc/network/private/chain-gdb.cfg b/dist.linux/etc/network/private/chain-gdb.cfg
new file mode 100644
index 000000000..a96e01d84
--- /dev/null
+++ b/dist.linux/etc/network/private/chain-gdb.cfg
@@ -0,0 +1,10 @@
+[chain]
+id=0xf00000000000000f
+name=gdb
+consensus=gdb
+class=gdb
+datum_types=[token,emission,shard,ca,transaction]
+
+[gdb]
+# Celled means sharded
+celled=false
diff --git a/dist/share/configs/cellframe-node.cfg.tpl b/dist.linux/share/configs/cellframe-node.cfg.tpl
similarity index 100%
rename from dist/share/configs/cellframe-node.cfg.tpl
rename to dist.linux/share/configs/cellframe-node.cfg.tpl
diff --git a/dist.linux/share/configs/network/core-t.cfg.tpl b/dist.linux/share/configs/network/core-t.cfg.tpl
new file mode 100644
index 000000000..8bbde617f
--- /dev/null
+++ b/dist.linux/share/configs/network/core-t.cfg.tpl
@@ -0,0 +1,23 @@
+# Core testnet
+# General section
+[general]
+id=0xffffffffffffffff
+name=core-t
+# Possible values: light, full, archive, master, root
+node-role={NODE_TYPE}
+node_addr_type=auto
+seed_nodes_hostnames=[159.89.52.250,167.172.35.90,104.248.41.92]
+seed_nodes_aliases=[core-t.root.0,core-t.root.1,core-t.root.2]
+seed_nodes_addrs=[0000::0000::0000::0001,0000::0000::0000::0002,0000::0000::0000::0003]
+seed_nodes_port=[80,80,80]
+
+
+#[role-master]
+#proc_chains=[0x00000001]
+
+#[dag-poa]
+#events-sign-cert=mycert
+
+#[dag-pos]
+#events-sign-wallet=mywallet
+
diff --git a/dist.linux/share/configs/network/kelvin-testnet.cfg.tpl b/dist.linux/share/configs/network/kelvin-testnet.cfg.tpl
new file mode 100644
index 000000000..7b899786c
--- /dev/null
+++ b/dist.linux/share/configs/network/kelvin-testnet.cfg.tpl
@@ -0,0 +1,30 @@
+# Kelvin Testnet
+# General section
+[general]
+id=0x0000000000000001
+name=kelvin-testnet
+# Possible values: light, full, archive, master, root
+node-role={NODE_TYPE}
+
+seed_nodes_hostnames=[0.root.testnet.klvn.io,1.root.testnet.klvn.io,2.root.testnet.klvn.io,3.root.testnet.klvn.io,4.root.testnet.klvn.io]
+seed_nodes_aliases=[kelvin.testnet.root.0,kelvin.testnet.root.1,kelvin.testnet.root.2,kelvin.testnet.root.3,kelvin.testnet.root.4]
+seed_nodes_addrs=[ffff::0000::0000::0001,ffff::0000::0000::0002,ffff::0000::0000::0003,ffff::0000::0000::0004,ffff::0000::0000::0005]
+seed_nodes_port=[8079,8079,8079,8079,8079]
+
+private=false
+
+#[auth]
+#type=ca
+#acl_accept_ca_list=[]
+#acl_accept_ca_gdb=
+#acl_accept_ca_chains=all
+
+#[role-master]
+#proc_chains=[0x00000001]
+
+#[dag-poa]
+#events-sign-cert=mycert
+
+#[dag-pos]
+#events-sign-wallet=mywallet
+
diff --git a/dist.linux/share/configs/network/private.cfg.tpl b/dist.linux/share/configs/network/private.cfg.tpl
new file mode 100644
index 000000000..3622ae200
--- /dev/null
+++ b/dist.linux/share/configs/network/private.cfg.tpl
@@ -0,0 +1,25 @@
+# Kelvin Blockchain: development network
+# General section
+[general]
+id=0xFF00000000000001
+name=private
+# Possible values: light, full, archive, master, root
+node-role={NODE_TYPE}
+gdb_groups_prefix=my-private
+#node-alias=addr-%node_addr%
+#node-addr=0x10
+# node addr exired time in hours (168h=1w 720h=1m 8760h=1y), by default 720h(1week)
+# node-addr-expired=168
+# type of node addr [auto, static, dinamic]
+node_addr_type=auto
+
+seed_nodes_ipv4=[195.154.133.160, 62.210.90.227]
+seed_nodes_port=[8079, 8079]
+seed_nodes_aliases=[kelvin.testnet.root.0,kelvin.testnet.root.1]
+seed_nodes_addrs=[ffff::0000::0000::0001,ffff::0000::0000::0002]
+
+#[dag-poa]
+#events-sign-cert=mycert
+
+#[dag-pos]
+#events-sign-wallet=mywallet
-- 
GitLab