Node commands

From wiki.cellframe.net
Jump to navigation Jump to search


Network services managment

Orders list

Orders list, all or by UID and/or class net_srv -net <chain net name> order find [-srv_uid <Service UID>] [-srv_class <Service Class>] [-price_unit <price unit>] [-price_min <Price minimum>] [-price_max <Price maximum>]

Order delete

Delete order from global_db. IMPORTANT! It doesn't affect the conditioned transaction if it was present net_srv -net <chain net name> order delete -id <Proposal ID>

Order create

net_srv -net <chain net name> order create -srv_uid <Service UID> -srv_class <Service Class> -price <Price> -price_unit <Price Unit> -node_addr <Node Address> -tx_cond <TX Cond Hash> [-expires <Unix time when expires>]

dag: DAG commands DAG consists from events, every event nests only one datum and usualy few more hash links to another events. Round while forming is in GDB, not in chains and could have different rules for the forming. DAG commands: dag -net <chain net name> -chain <chain name> event create -datum <datum hash> [-H hex|base58(default)] Create event from datum mempool element dag -net <chain net name> -chain <chain name> event cancel -event <event hash> Remove event from forming new round and put back its datum to mempool dag -net <chain net name> -chain <chain name> event sign -event <event hash> Add sign to event <event hash> in round.new. Hash doesn't include other signs so event hash doesn't changes after sign add to event. dag -net <chain net name> -chain <chain name> event dump -event <event hash> -from < events | events_lasts | round.new | round.<Round id in hex> > [-H hex|base58(default)] Dump event info dag -net <chain net name> -chain <chain name> event list -from < events | events_lasts | round.new | round.<Round id in hex> Show event list dag -net <chain net name> -chain <chain name> round complete Complete the current new round, verify it and if everything is ok - publish new events in chain

dag_poa: DAG PoA commands DAG PoA commands:

Sign event <event hash> in the new round pool with its authorize certificate

net: Network commands Network commands: Find and establish links and stay online net -net <chain net name> go < online | offline > Look at current status net -net <chain net name> get status

net -net <chain net name> stats tx [-from <From time>] [-to <To time>] [-prev_sec <Seconds>] Transactions statistics. Time format is <Year>-<Month>-<Day>_<Hours>:<Minutes>:<Seconds> or just <Seconds> net -net <chain net name> sync < all | gdb | chains > Syncronyze gdb, chains or everything net -net <chain net name> link < list | add | del | info | establish > List, add, del, dump or establish links net -net <chain net name> ca add {-cert <cert name> | -hash <cert hash>} Add certificate to list of authority cetificates in GDB group net -net <chain net name> ca list Print list of authority cetificates from GDB group net -net <chain net name> ca del -hash <cert hash> [-H hex|base58(default)] Delete certificate from list of authority cetificates in GDB group by it's hash

net_srv: Network services managment Network services managment: net_srv -net <chain net name> order find [-direction <sell|buy>][-srv_uid <Service UID>] [-price_unit <price unit>]\

                                       [-price_token <Token ticker>] [-price_min <Price minimum>] [-price_max <Price maximum>]

Orders list, all or by UID and/or class net_srv -net <chain net name> order delete -hash <Order hash> Order delete net_srv -net <chain net name> order dump -hash <Order hash> Order dump info net_srv -net <chain net name> order create -direction <sell|buy> -srv_uid <Service UID> -price <Price>\

      -price_unit <Price Unit> -price_token <Token ticker> [-node_addr <Node Address>] [-tx_cond <TX Cond Hash>] \
      [-expires <Unix time when expires>] [-ext <Extension with params>]\

Order create

vpn_client: VPN client control VPN client control: vpn_client [start -addr <server address> -port <server port>| stop | status] -net <net name>


global_db: Work with global database Work with global database: global_db cells add -cell <cell id> global_db flush

node: Work with node Work with node: node add -net <net name> -addr {<node address> | -alias <node alias>} {-port <port>} -cell <cell id> {-ipv4 <ipv4 external address> | -ipv6 <ipv6 external address>} node del -net <net name> -addr <node address> | -alias <node alias> node link {add|del} -net <net name> {-addr <node address> | -alias <node alias>} -link <node address> node alias -addr <node address> -alias <node alias> node connect {<node address> | -alias <node alias> | auto} node handshake {<node address> | -alias <node alias>} node dump -net <net name> [ -addr <node address> | -alias <node alias>] [-full]

ping: Send ICMP ECHO_REQUEST to network hosts Send ICMP ECHO_REQUEST to network hosts: ping [-c <count>] host

traceroute: Print the hops and time of packets trace to network host Print the hops and time of packets trace to network host: traceroute host

tracepath: Traces path to a network host along this path Traces path to a network host along this path: tracepath host

help: Description of command parameters ?: Synonym for "help"

wallet: Wallet operations Wallet operations: Create a wallet (automatic signature sig_dil): wallet new -w <wallet_name> ✔ Creating a wallet with a non-standard signature (sig_bliss, sig_tesla, sig_picnic): wallet new -w <wallet_name> -sign <sign_type>✔ Creating a wallet with the ability to restore it: wallet new -w <wallet_name> -restore <hex value> (example -restore 0x123)✔ Restore the wallet in case of loss of the wallet, that is, with the same <hex value>, the same wallet will be generated: wallet new -w -restore <hex value>✔ Overwrite an existing wallet with the same name, if it already exists: wallet new -w <wallet_name> -force ✔ See the full list of wallets: wallet list ✔ Wallet balance and its address: wallet info -addr <addr> | -w <wallet_name> -net <net_name>✔

token_decl: Token declaration Перед созданием токена желательно создать сертификат cellframe-node-tool cert create <certificate_name> <sign_type>✔(Нужно добавить обратную связь при выполнение команды) После создания сертификата нужно внесни изминения в [dag-pos] section в файле etc/network/kelvin-testnet.cfg Далее нужно перегрузить ноду. Declare new simple token for <netname>:<chain name> with ticker <token ticker>, maximum emission <total supply> and <signs for emission> from <signs total> signatures on valid emission. После создания токена нужно сделать cellframe-node-cli global_db flush ✔ token_decl -net <net name> -chain <chain name> -token <token name> -total_supply <total supply> -signs_total <sign total> -signs_emission <signs for emission> -certs <certificate_name>✔

Extended private token declaration: приватный токен обязательно должен иметь хотябы одну подпись.
token_decl -net <net name> -chain <chain name> -token <token name> -type private -flags -sign <sign_type>  < [<Flag 1>][,<Flag 2>]...[,<Flag N>]...  [-<Param name 1> <Param Value 1>] [-Param name 2> <Param Value 2>] ...[-<Param Name N> <Param Value N>]✔
  Declare new token for <netname>:<chain name> with ticker <token ticker>, flags <Flag 1>,<Flag2>...<Flag N>    and custom parameters list <Param 1>, <Param 2>...<Param N>.

==Flags== ALL_BLOCKED: Blocked all permissions, usefull add it first and then add allows what you want to allow

ALL_ALLOWED:  Allowed all permissions if not blocked them. Be careful with this mode
ALL_FROZEN:  All permissions are temprorary frozen
ALL_UNFROZEN:  Unfrozen permissions
STATIC_ALL:  No token manipulations after declarations at all. Token declares staticly and can't variabed after
STATIC_FLAGS:  No token manipulations after declarations with flags
STATIC_PERMISSIONS_ALL:  No all permissions lists manipulations after declarations
STATIC_PERMISSIONS_DATUM_TYPE:  No datum type permissions lists manipulations after declarations
STATIC_PERMISSIONS_TX_SENDER:  No tx sender permissions lists manipulations after declarations
STATIC_PERMISSIONS_TX_RECEIVER:  No tx receiver permissions lists manipulations after declarations

Params

General:

-flags <value>:  List of flags from <value> to token declaration
-total_supply <value>:  Set total supply - emission's maximum - to the <value>
-total_signs_valid <value>:  Set valid signatures count's minimum
-signs <value>:  Signature's fingerprint list

Datum type allowed/blocked:

-datum_type_allowed <value>(all):  Set allowed datum type(s)
-datum_type_blocked <value>(all):  Set blocked datum type(s)

Tx receiver addresses allowed/blocked:

-tx_receiver_allowed <value>(all):  Set allowed tx receiver(s)
-tx_receiver_blocked <value>(all):  Set blocked tx receiver(s)

Tx sender addresses allowed/blocked:

-tx_sender_allowed <value>(all):  Set allowed tx sender(s)
-tx_sender_blocked <value>(all):  Set allowed tx sender(s)

token_emit: Token emission Token emission to wallet (addr) token_emit -net <net name> -chain_emission <chain for emission> -chain_base_tx <chain for base tx> -addr <addr> -token <token ticker> -certs <cert> -emission_value <val>✔ После эмисси нужно делать mempool_proc

mempool_list: List mempool entries for selected chain network and chain id: Выдает ошибку, что нужно написать -net, хотя не написан -chain, а -net написан. mempool_list -net <net name> -chain <chain name> ✔

mempool_proc: Proc mempool entries for selected chain network and chain id: mempool_proc -net <net name> -chain <chain name> -datum<datum hash>✔

mempool_delete: Delete event with hash <datum hash> from mempool: mempool_delete -net <net name> -chain <chain name> -datum <datum hash> ✔

mempool_add_ca: Add pubic certificate into the mempool to prepare its way to chains Add pubic certificate into the mempool to prepare its way to chains: mempool_add_ca -net <net name> -chain <chain name> -ca_name <Certificate name>✔ Нода падает если ввести команду не верно.

tx_create: Make transaction Make transaction (chain for transaction plasma): tx_create -net <net name> -chain <chain name> -from_wallet <name> -to_addr <addr> -token <token ticker> -value <value> [-fee <addr> -value_fee <val>]

tx_cond_create: Make cond transaction Make cond transaction: tx_cond_create -net <net name> -token <token_ticker> -wallet_f <wallet_from> -wallet_t <wallet_to>-value <value_datoshi> -unit <mb|kb|b|sec|day> -service <vpn>

tx_verify: Verifing transaction Verifing transaction: tx_verify -wallet <wallet name>

tx_history: Transaction history (for address or by hash) Transaction history (for address or by hash): tx_history [-addr <addr> | -w <wallet name> | -tx <tx_hash>] -net <net name> -chain <chain name>

print_log: Print log info Print log info: print_log [ts_after <timestamp >] [limit <line numbers>]

stats: Print statistics Print statistics: stats cpu

exit: Stop application and exit Stop application and exit: exit

srv_xchange: eXchange service commands eXchange service commands: srv_xchange price create -net_sell <net name> -token_sell <token ticker> -net_buy <net_name> -token_buy <token ticker>-wallet <name> -coins <value> -rate <value> Create a new price with specified amount of datoshi to exchange with specified rate (sell : buy) srv_xchange price remove -net_sell <net name> -token_sell <token ticker> -net_buy <net_name> -token_buy <token ticker> Remove price with specified tickers within specified net names srv_xchange price list List all active prices srv_xchange price update -net_sell <net name> -token_sell <token ticker> -net_buy <net_name> -token_buy <token ticker>{-coins <value> | rate <value> | -wallet <name>} Update price with specified tickers within specified net names srv_xchange orders -net <net name> Get the exchange orders list within specified net name srv_xchange purchase -order <order hash> -net <net name> -wallet <wallet_name> -coins <value> Exchange tokens with specified order within specified net name. Specify how datoshies to buy srv_xchange enable Enable eXchange service srv_xchange disable Disable eXchange service

srv_stake: Delegated stake service commands Delegated stake service commands: srv_stake order create -net <net name> -from_addr <addr> -token <ticker> -coins <value> -cert <name> -fee_percent <value> Create a new order with specified amount of datoshi to delegate it to the specified address.The fee with specified percent with this delagation will be returned to the fee address pointed by delegator srv_stake order remove -net <net name> -order <order hash> [-H hex|base58(default)] Remove order with specified hash srv_stake order update -net <net name> -order <order hash> -cert <name> [-H hex|base58(default)]{-from_addr <addr> | -token <ticker> -coins <value> | -fee_percent <value>} Update order with specified hash srv_stake order list -net <net name> Get the stake orders list within specified net name srv_stake delegate -order <order hash> -net <net name> -wallet <wallet_name> -fee_addr <addr> Delegate tokens with specified order within specified net name. Specify fee address srv_stake transactions -net <net name> {-addr <addr from>} Show the list of active stake transactions (optional delegated from addr) srv_stake invalidate -net <net name> -tx <transaction hash> -wallet <wallet name> Invalidate stake transaction by hash within net name and return stake to specified wallet


Привет. Сел хелпник делать и нода чудит, она ведь автозапускаться должна при старте системы, она этого не сделала и более того даже запустится не захотела. user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_list -net kelvin-testnet -chain plasma [sudo] password for user: Socket connection err: 111 Can't connect to cellframe-node user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node [08/12/20-16:47:35] [DBG] [dap_config] Looking for config name cellframe-node... [08/12/20-16:47:35] [DBG] [dap_config] Opened config cellframe-node [08/12/20-16:47:35] [WRN] [dap_config] Empty array! [08/12/20-16:47:35] [DBG] [main] Parsing command line args [08/12/20-16:47:35] [ATT] [main] *** NORMAL MODE *** [08/12/20-16:47:35] [DAP] [main] *** CellFrame Node version: 3 *** [08/12/20-16:47:35] [ * ] [server] dap_server_init() threads 1 [08/12/20-16:47:35] [ * ] [server] Initialized socket server module [08/12/20-16:47:35] [ * ] [dap_client_remote] Initialized socket client module [08/12/20-16:47:35] [ * ] [dap_events_socket] Initialized socket client module [08/12/20-16:47:35] [ * ] [dap_events] Initialized socket server module [08/12/20-16:47:35] [ * ] [server] Start loop listener socket thread 0 efd 5 [08/12/20-16:47:35] [ * ] [http_client] Initialized HTTP client module [08/12/20-16:47:35] [ * ] [http_header] Initialized HTTP headers module [08/12/20-16:47:35] [ * ] [http_client] Initialized HTTP client module [08/12/20-16:47:35] [ * ] [dap_http] Initialized HTTP server module [08/12/20-16:47:35] [ERR] [dap_chain_global_db_cdb] An error occured while opening CDB: "Opened By Another Process" [08/12/20-16:47:35] [ ! ] [dap_global_db] Hadn't initialized db driver "cdb" on path "/opt/cellframe-node/var/lib/global_db" [08/12/20-16:47:35] [ ! ] [main] Can't init global db module user@debian:/opt/cellframe-node/bin$ user@debian:/opt/cellframe-node/bin$ ps aux | grep cellframe user 2777 0.0 0.0 6076 828 pts/0 S+ 16:50 0:00 grep cellframe Пишет что cdb занят другим процессом и не может ее инициализировать. грепнул на всякий случай процесс и ноды в нем не было. Удалил ноду и поставил заново, не помогло. о, вот о чем я тебе сегодня говорил

@murat.khabriev тебе надо либо из директории global_db рекурсивно удалить все файлы pid.lock (или как-то так, они внутри других папок) Либо же, проще, грохнуть global_db и заново сходить на синхронизацию (edited)

user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_list -net kelvin-testnet -chain plasma [sudo] password for user: kelvin-testnet.plasma: Found 1 records : hash 7jRZQcF6eL6QWJayqFjB7exkbwRr7jZAzXNZij1X1kBr: type_id=DATUM_TX data_size=6203 ts_create=Mon Aug 10 14:52:44 2020

user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_delete -net kelvin-testnet -chain plasma -datum 7jRZQcF6eL6QWJayqFjB7exkbwRr7jZAzXNZij1X1kBr Datum 7jRZQcF6eL6QWJayqFjB7exkbwRr7jZAzXNZij1X1kBr deleted user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_list -net kelvin-testnet -chain plasma kelvin-testnet.plasma: Not found records

@murat.khabriev Насколько знаю, удалив что-то из мемпулла, ты удалишь только из своего мемпулла. Т.е., прекратишь попытки это "что-то" обработать. 5:50 Другое дело, конечно - любой из сети может ордера грохать. Это да. 1 5:51 Хотя не знаю, как с подписанными ордерами - может, с ними этой проблемы нет.

user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_list -net kelvin-testnet -chain zerochain kelvin-testnet.zerochain: Found 9 records : hash BEMHndKxxYuNhow1g5V55gXpUEfAPDshhKWWMf6SRD32: type_id=DATUM_TOKEN_DECL data_size=125 ts_create=Tue Jun 30 22:10:07 2020 ==Datum Token Declaration ticker: VAHTANG size: 125 type: PRIVATE_DECL flags: ALL_ALLOWED signatures: <NONE> hash AxufujrZkaLtcx1nN4LKzM2D7nHEFLMykeUauv2nPQrJ: type_id=DATUM_TOKEN_DECL data_size=125 ts_create=Tue Jun 30 22:11:29 2020 ==Datum Token Declaration ticker: VAHTANG size: 125 type: PRIVATE_DECL flags: ALL_ALLOWED signatures: <NONE> hash iZaXxA4oGCvcyFQFVJ7MjQmgf2j88mptmUvEwZ35U3n: type_id=DATUM_TX data_size=4609 ts_create=Tue Jun 30 22:32:21 2020 hash 21JcLd6KqYAiX827j4S8pg7rVrUVLRQhtXzVUR6Cbeia: type_id=DATUM_TX data_size=4691 ts_create=Tue Jun 30 23:47:02 2020 hash AobFsuiu9gHjpWGeKFeazvvuH24r8KrDDyeKPGax77T3: type_id=DATUM_TX data_size=4691 ts_create=Wed Jul 1 20:27:56 2020 hash 7rXmRgPag5u69cT3KpXjSjFL3TCpWDo6B2b85XzijuAJ: type_id=DATUM_TX data_size=4691 ts_create=Wed Jul 1 20:49:44 2020 hash 3AVubAJK7bvFVL9NANRqkCCQj5ekXx4qQJycXdAt7ogf: type_id=DATUM_TX data_size=6584 ts_create=Mon Aug 10 19:10:07 2020 hash 6n6L374d6QjSqeHDcyM68p1WZ3JmQzkqUKLHS55SToXP: type_id=DATUM_TX data_size=6584 ts_create=Mon Aug 10 19:22:32 2020 hash GLyEvQWYwv6hd1UhgQqAdrj9jVLwC7RogkiMoSkkUQW5: type_id=DATUM_TX data_size=6584 ts_create=Mon Aug 10 19:23:40 2020

user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_proc -net kelvin-testnet -chain zerochain -datum iZaXxA4oGCvcyFQFVJ7MjQmgf2j88mptmUvEwZ35U3n hash iZaXxA4oGCvcyFQFVJ7MjQmgf2j88mptmUvEwZ35U3n: type_id=DATUM_TX ts_create=Tue Jun 30 22:32:21 2020 data_size=4609 Error! Datum doesn't pass verifications, examine node log files

user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_proc -net kelvin-testnet -chain zerochain -datum BEMHndKxxYuNhow1g5V55gXpUEfAPDshhKWWMf6SRD32 hash BEMHndKxxYuNhow1g5V55gXpUEfAPDshhKWWMf6SRD32: type_id=DATUM_TOKEN_DECL ts_create=Tue Jun 30 22:10:07 2020 data_size=125 Error! Datum doesn't pass verifications, examine node log files

user@debian:/opt/cellframe-node/bin$ sudo ./cellframe-node-cli mempool_proc -net kelvin-testnet -chain zerochain -datum 6n6L374d6QjSqeHDcyM68p1WZ3JmQzkqUKLHS55SToXP hash 6n6L374d6QjSqeHDcyM68p1WZ3JmQzkqUKLHS55SToXP: type_id=DATUM_TX ts_create=Mon Aug 10 19:22:32 2020 data_size=6584 Error! Datum doesn't pass verifications, examine node log files




==Datum Token Declaration ticker: hellotoke size: 193 type: PRIVATE_DECL flags: ALL_ALLOWED total_supply: 5000 datum_type_allowed: all tx_receiver_allowed: all tx_sender_allowed: all signatures: <NONE>


Утилита для генерации сертификатов:

/opt/cellframe-node/bin/cellframe-node-tool если вызвать без параметров, вызовет справку.

Команды для создания сертификата:

/opt/cellframe-node/bin/cellframe-node-tool cert create <cert name> <key type> [<key length>] - просто файл с приватным ключем с которым вы что-то подписывайте. (пример использования: при создания своего токина, подтверждать свое владения им)

Пример: sudo /opt/cellframe-node/bin/cellframe-node-tool cert create testw sig_dil

Проверка созданного сертификата: ls /opt/cellframe-node/var/lib/ca/

Добавить подпись в токен уже лежащий в мемпуле:

/opt/cellframe-node/bin/cellframe-node-cli help token_decl_sign - вызов справки по команде
/opt/cellframe-node/bin/cellframe-node-cli token_decl_sign -net <net name> -chain <chain name> -datum <datum_hash> -certs <certs list>

-net - сеть (может быть ваша собственная)(тестовая сеть core-t) -chain - zero chain - для объявление токинов (есть еще plasma - для транзакций) -datum - присваевыется токену при создание (пример: datum 0x8949B08BE850CC75928BA2CEV7D1C7ECAA720B9BA971872BADB7FD8772DC834E) -certs - имя сертификата

Пример:

Один токен может подписать несколько человек, например, если вы с товарищами решили декларировать токен и нужно его всем подписать.