Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting with new API.. questions and issues #2

Closed
noglance opened this issue Feb 11, 2018 · 34 comments
Closed

starting with new API.. questions and issues #2

noglance opened this issue Feb 11, 2018 · 34 comments

Comments

@noglance
Copy link

noglance commented Feb 11, 2018

new bin files was compiled for Debian fine: #1

but now there is one more issue.

I'm starting bytecoind and 2 walletd instances like this:
./bytecoind --priority-node-address=45.76.29.96:8080
and:
walletd --wallet-file=/path/.wallet --wallet-password=<password> --walletd-bind-address=<server_ip>:<port_to_connect_to_apr_rpc_from_other_server_to_query_transactions>

and it's not working as before..

new man:

_...Usage:
  walletd [options] --wallet-file=<file> | --export-blocks=<directory>
  walletd --help | -h
  walletd --version | -v

Options:
  --wallet-file=<file>                 Path to wallet file to open.
  --wallet-password=<password>         DEPRECATED. Password to decrypt wallet file. If not specified, will prompt user.
  --generate-wallet                    Create wallet file with new random keys. Must be used with --wallet-file option.
  --set-password=<password>            DEPRECATED. Reencrypt wallet file with the new password.
  --set-password                       Prompt user for new password and reencrypt wallet file.

  --allow-local-ip                     Allow local ip add to peer list, mostly in debug purposes.
  --export-blocks=<directory>          Export blockchain into specified directory as blocks.bin and blockindexes.bin, then exit. This overwrites existing files.
  --export-view-only=<file>            Export view-only version of wallet file with the same password, then exit.
  --hide-my-port                       DEPRECATED. Do not announce yourself as peer list candidate. Use --p2p-external-port=0 instead.
  --testnet                            Configure for testnet.
  --p2p-bind-address=<ip:port>         Interface and port for P2P network protocol [default: 0.0.0.0:8080].
  --p2p-external-port=<port>           External port for P2P network protocol, if port forwarding used with NAT [default: 8080].
  --walletd-bind-address=<ip:port>     Interface and port for walletd RPC [default: 127.0.0.1:8070].
  --bytecoind-bind-address=<ip:port>   Interface and port for bytecoind RPC [default: 0.0.0.0:8081].
  --bytecoind-remote-address=<ip:port> Connect to remote bytecoind and suppress running built-in bytecoind.
  --seed-node-address=<ip:port>        Specify list (one or more) of nodes to start connecting to.
  --priority-node-address=<ip:port>    Specify list (one or more) of nodes to connect to and attempt to keep the connection open.
  --exclusive-node-address=<ip:port>   Specify list (one or more) of nodes to connect to only. All other nodes including seed nodes will be ignored.

  --help, -h                           Show this screen.
  --version, -v                        Show version._

why --wallet-password DEPRECATED?

should walletd work in pair with bytecoind or it's standalone app? is it good practise to keep own bytecoind node?

there is new errors like:

terminate called after throwing an instance of 'platform::ExclusiveLock::FailedToLock'
  what():  ExclusiveLock fail at path=/root/.bytecoin/bytecoind.lock
Aborted

they rappers when you try to start second walletd process if no bytecoind lunched or if this is first walletd launch but bytecoind already running. looks like its available to use only one app with one db instance. is it true?

@SoraKohaku
Copy link

good to hear bcn make move in ruby installed. will try if travis work~

@bcndev
Copy link
Owner

bcndev commented Feb 14, 2018

@noglance You can not start more than one instance of bytecoind on a host and it's fully intentional. Don't do that.
walletd is really designed to be paired up with bytecoind. Currently, when run without explicit parameters of remote Bytecoin Node, Wallet Service starts an in-process bytecoind (built-in). This might change during stabilization period. Anyway, we recommend to set up a separate wholly owned Bytecoin Node for experienced users or even professional parties.
--wallet-password is set deprecated due to security reasons. Entering wallet file's password via stdin is considered better practice nowadays.

@noglance
Copy link
Author

@bcndev I don't need to start second bytecoind but I'd like to start several walletd (two in my case) as I'd like to used one .wallet file for tests and second for production. Later I could split them in two servers but now I'd like to start them at one server with different ports for RPC connections as it was in first version of walletd

@noglance
Copy link
Author

"This might change during stabilization period" ? "built-in" ... so I don't need to start walletd for RPC?

"--wallet-password is set deprecated due to security reasons. Entering wallet file's password via stdin"
I'm starting walletd as daemon service at server so I don't like to log in manually. It could be reloaded an start automatically in background. How this case server with RPC API should work, log in manually every time? Are you crazy?)) ?

@SoraKohaku
Copy link

SoraKohaku commented Feb 15, 2018 via email

@bcndev
Copy link
Owner

bcndev commented Feb 15, 2018

@noglance

  • Our Wiki has an example of running two walletd instances on the same host.
  • There is no need to enter password manually only, just use echo "pwd" | walletd --walletfile=... in your scripts.

@SoraKohaku
Copy link

SoraKohaku commented Feb 15, 2018 via email

@kiahmed
Copy link

kiahmed commented Feb 17, 2018

can you run this on testnet ? I dont see any command options for that ? Also any faucet for test coins ?

@SoraKohaku
Copy link

SoraKohaku commented Feb 18, 2018 via email

@noglance
Copy link
Author

noglance commented Feb 20, 2018

@bcndev

starting walletd:
Command line option --remote-bytecoind-address=127.0.0.1:8081 has no meaning (typo?)

starting bytecoind:
white screen about minute or more (strange. not very good without any hello world message)
and then:

oldest tip cd=200673536690758 bid=a850fbaea601097877f91520ae96df06452445cbbe1b4d5a35292d2141fc5332
tip cd=200673536690758 bid=a850fbaea601097877f91520ae96df06452445cbbe1b4d5a35292d2141fc5332
tip cd=200756713080016 bid=414e85bd3050589af563d96eddd50136e366d598f748d9a56b9beb3f8cfd8637
tip cd=204736355924710 bid=99262c4797a393444abf09f13029c4d49384eff94d9bfb1acf38853f28220da4
tip cd=207596065499703 bid=2dccbbc8dfe8db926e67dca56bff18a6585d6c4e1eedb3dbba57a151e3c97fb7
tip cd=207772642432244 bid=aa143a0018ab3eb4675aa7b330886dbd625b9505cebf9312bdfedbe37506d051
tip cd=208329916137463 bid=e4419558f1209c1336c7e557c6c230fff79e3bc2a30bb010a324a53d86fc3824
children counter=0 bid=2dccbbc8dfe8db926e67dca56bff18a6585d6c4e1eedb3dbba57a151e3c97fb7
children counter=2 bid=3ad840671ab1777477b457f752ad94628d0980a69945bdab42149f1369a3610c
children counter=0 bid=414e85bd3050589af563d96eddd50136e366d598f748d9a56b9beb3f8cfd8637
children counter=2 bid=595cb1c57a669a82beeb87ebf9a280b095feefef60d401cc9bf57088745c8ee2
children counter=2 bid=6294e55ccc6f5585f23c749702e6e4bc06cfa9f5e07bc6df37485e708897dfc2
children counter=0 bid=99262c4797a393444abf09f13029c4d49384eff94d9bfb1acf38853f28220da4
children counter=0 bid=a850fbaea601097877f91520ae96df06452445cbbe1b4d5a35292d2141fc5332
children counter=0 bid=aa143a0018ab3eb4675aa7b330886dbd625b9505cebf9312bdfedbe37506d051
children counter=0 bid=e4419558f1209c1336c7e557c6c230fff79e3bc2a30bb010a324a53d86fc3824
children counter=2 bid=ea9af3f5769a53da2cc0919450bd45378c6335180f8d9de8a202995f065800b5
children counter=2 bid=eec750dc19fcf33e15ff69b46140cba05ffc323fc6842fce635b5adb89c3bd8a
Starting multicore ring checker using 2/3 cpus

@noglance
Copy link
Author

There is no need to enter password manually only, just use echo "pwd" | walletd --walletfile=... in your scripts.

strange practice.. and what for? may be it would be good to add this to wiki

@noglance
Copy link
Author

and what it is in bytecoind log?

2018-Feb-17 17:43:05.220825 INFO [Node] jsonrpc request method not found - getBalance
2018-Feb-17 17:43:12.982195 INFO [Node] jsonrpc request method not found - getBalance
2018-Feb-17 17:43:46.085612 INFO [Node] jsonrpc request method not found - createAddress
2018-Feb-17 17:43:54.209739 INFO [Node] jsonrpc request method not found - createAddress
2018-Feb-17 17:43:57.329678 INFO [Node] jsonrpc request method not found - createAddress
2018-Feb-17 17:43:58.101704 INFO [Node] jsonrpc request method not found - createAddress
2018-Feb-17 17:44:01.557681 INFO [Node] jsonrpc request method not found - createAddress
2018-Feb-17 17:44:02.737639 INFO [Node] jsonrpc request method not found - createAddress
2018-Feb-17 17:44:44.109721 INFO [Node] jsonrpc request method not found - createAddress

@kiahmed
Copy link

kiahmed commented Feb 20, 2018

@FndNur1Labs did you run on testnet or mainnet?

@SoraKohaku
Copy link

SoraKohaku commented Feb 21, 2018 via email

@bcndev
Copy link
Owner

bcndev commented Feb 21, 2018

@noglance

  • Option --remote-bytecoind-address is really incorrect, right version is --bytecoind-remote-address.
  • getBalance is the old name of getting balance method. Use the new one.

@noglance
Copy link
Author

@bcndev
it's started:

Enter current wallet password: Starting multicore transaction preparator using 2/3 cpus
walletd started seconds=0.218

help
top
man
exit

and what next?

@noglance
Copy link
Author

$data = array("params" => 
                array('address' => ''),
                "jsonrpc" => "2.0",
                "id" => "burmar42",
                "method" => "getStatus");


$data_string = json_encode($data);

$opts = array('http' =>
        array(
                'method'  => 'POST',
                'timeout' => 10,
                'header' => array('Content-Type: application/json'."\r\n"
//                                    . 'Authorization: username:key'."\r\n"
                                    . 'Content-Length: ' . strlen($data_string) . "\r\n"),
                'content' => $data_string
                )
        );
$context = stream_context_create($opts);

returns

failed to open stream: Connection refused

@bcndev
Copy link
Owner

bcndev commented Feb 21, 2018

@noglance What's the result of executing curl -X POST http://<walletd-rpc-address>:<walletd-rpc-port>/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "0", "method": "get_status", "params": {}}'; echo?
PS: Don't miss replacing <walletd-rpc-address>:<walletd-rpc-port> with your address and port.

@noglance
Copy link
Author

@bcndev

{"id":"0","jsonrpc":"2.0","result":{"incoming_peer_count":0,"next_block_effective_median_size":100000,"outgoing_peer_count":1,"recommended_fee_per_byte":100,"top_block_difficulty":1340121886,"top_block_hash":"e08434e69c5f1ee80859d61f6474ddbf8f0fd26ab11da5577669ca86a76ecd91","top_block_height":1468659,"top_block_timestamp":1519167188,"top_block_timestamp_median":0,"top_known_block_height":1469175,"transaction_pool_version":1}}

@noglance
Copy link
Author

oh. there is new names for methods

@noglance
Copy link
Author

noglance commented Feb 21, 2018

@bcndev
first it started like this:
walletd --wallet-file=/<path>/<name>.wallet --wallet-password=<password> --walletd-bind-address=<public-local-ip>:<port>
yes, with not correct params.
but now it's not working after restart

when trying to start walletd manually:
ExclusiveLock fail at path=/root/.bytecoin/bytecoind.lock
or
ExclusiveLock fail at path=/root/.bytecoin/wallet_cache/<code>.lock
or
white screen and nothing happening and

curl -X POST http://<adr>:<port>/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "0", "method": "get_status", "params": {}}'; echo
curl: (7) Failed to connect to

@noglance
Copy link
Author

noglance commented Feb 21, 2018

@bcndev "What's the result of executing curl -X POST http://<walletd-rp" why http not https?

@Nurlan199206
Copy link

@bcndev how to restore or turn off 2 FA web wallet?

@bcndev
Copy link
Owner

bcndev commented Feb 26, 2018

Discussion within this issue seems too vague and imprecise. If you are still not satisfied with our replies, please open separate issues for specific problems.

@bcndev bcndev closed this as completed Feb 26, 2018
@noglance
Copy link
Author

it looks like you made huge update 6-7 days ago.

@noglance
Copy link
Author

/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp: In function ‘uint64_t common::base58::{anonymous}::uint_8be_to_64(const uint8_t*, size_t)’:
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:74:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;

/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:75:2: note: here
case 2:
^~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:77:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;
~~~~^~~~~~~~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:78:2: note: here
case 3:
^~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:80:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;
~~~~^~~~~~~~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:81:2: note: here
case 4:
^~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:83:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;
~~~~^~~~~~~~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:84:2: note: here
case 5:
^~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:86:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;
~~~~^~~~~~~~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:87:2: note: here
case 6:
^~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:89:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;
~~~~^~~~~~~~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:90:2: note: here
case 7:
^~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:92:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
res |= *data++;
~~~~^~~~~~~~~~
/var/www/bytecoin2.1/bytecoin/src/common/Base58.cpp:93:2: note: here
case 8:
^~~~

@kiahmed
Copy link

kiahmed commented Feb 27, 2018

where is the rpc api doc? Anybody knows

@noglance
Copy link
Author

here is output of the new walletd (2nd beta version):

startwalletd.sh
lmdb libversion=LMDB 0.9.70: (December 19, 2015)
Starting multicore transaction preparator using 2/3 cpus
lmdb libversion=LMDB 0.9.70: (December 19, 2015)


oldest tip cd=200673536690758 bid=a850fbaea601097877f91520ae96df06452445cbbe1b4d5a35292d2141fc5332
tip cd=200673536690758 bid=a850fbaea601097877f91520ae96df06452445cbbe1b4d5a35292d2141fc5332
tip cd=200756713080016 bid=414e85bd3050589af563d96eddd50136e366d598f748d9a56b9beb3f8cfd8637
tip cd=204736355924710 bid=99262c4797a393444abf09f13029c4d49384eff94d9bfb1acf38853f28220da4
tip cd=207596065499703 bid=2dccbbc8dfe8db926e67dca56bff18a6585d6c4e1eedb3dbba57a151e3c97fb7
tip cd=207772642432244 bid=aa143a0018ab3eb4675aa7b330886dbd625b9505cebf9312bdfedbe37506d051
tip cd=208774968957751 bid=df823ab692d124450950556c1c41e7a0a19f6fc62f439d95a1fc792a973be8d3
tip cd=209291029415099 bid=f2096b956da07c5046ff49b715b9ba4d5c727dfd86aee9c4734a4f10169c4f70
tip cd=210123909127964 bid=a9382c1615e524771b5af9f6bd6e3162311652f0af82019876453919bbc9b0d3
tip cd=210488732755083 bid=219f9b81fc2943bf85bce533951efdbd1db12e5355b75eb5e9c4a382a7b46153
tip cd=210929588054986 bid=3b6780f0c266465fba8b9b17bb3cecdaa0b3e8b636a539ea3f7af593d22e3da0
tip cd=211890537373451 bid=efe3dc851f3d0585b1b27032126bce580eb9090c52df9939ce468897a44ee91c
tip cd=212941763660174 bid=73cad3c376817e731c65db69f3214cb72aed8450cbf79306c21218a902974fbd
tip cd=214258644183402 bid=4eafa373e217536014aeaeda83c7612d989c1d690d716e1dac400a94234d9f88
children counter=2 bid=0e203dc4fdd6b345f6f088361243fe7b5305a1537cbcc6961304656e78a26f83
children counter=2 bid=11d1a1ee44e2d1546c34cf63a87108a3382bb8e1618adba81ae9e11df87ab1f5
children counter=0 bid=219f9b81fc2943bf85bce533951efdbd1db12e5355b75eb5e9c4a382a7b46153
children counter=0 bid=2dccbbc8dfe8db926e67dca56bff18a6585d6c4e1eedb3dbba57a151e3c97fb7
children counter=2 bid=3ad840671ab1777477b457f752ad94628d0980a69945bdab42149f1369a3610c
children counter=0 bid=3b6780f0c266465fba8b9b17bb3cecdaa0b3e8b636a539ea3f7af593d22e3da0
children counter=0 bid=414e85bd3050589af563d96eddd50136e366d598f748d9a56b9beb3f8cfd8637
children counter=0 bid=4eafa373e217536014aeaeda83c7612d989c1d690d716e1dac400a94234d9f88
children counter=2 bid=56519850ccf4d0df2fa0508465661817373ecb0db83dfa662a9e5913477740ff
children counter=2 bid=595cb1c57a669a82beeb87ebf9a280b095feefef60d401cc9bf57088745c8ee2
children counter=2 bid=5e3f9fc60779b692a3d7b63e3e97afee503719bc531bee1e59c5807149c60f1d
children counter=2 bid=621c32760f38f1e047ada93db763b1ee19d2a76cd520f50dbfc4d5b11b9bbab9
children counter=2 bid=6294e55ccc6f5585f23c749702e6e4bc06cfa9f5e07bc6df37485e708897dfc2
children counter=0 bid=73cad3c376817e731c65db69f3214cb72aed8450cbf79306c21218a902974fbd
children counter=0 bid=99262c4797a393444abf09f13029c4d49384eff94d9bfb1acf38853f28220da4
children counter=0 bid=a850fbaea601097877f91520ae96df06452445cbbe1b4d5a35292d2141fc5332
children counter=0 bid=a9382c1615e524771b5af9f6bd6e3162311652f0af82019876453919bbc9b0d3
children counter=0 bid=aa143a0018ab3eb4675aa7b330886dbd625b9505cebf9312bdfedbe37506d051
children counter=2 bid=c8379f8d52513f6d7436cb2ff79d52ba4ed6fd05ea4320aa45545f0d83538d32
children counter=0 bid=df823ab692d124450950556c1c41e7a0a19f6fc62f439d95a1fc792a973be8d3
children counter=2 bid=ea9af3f5769a53da2cc0919450bd45378c6335180f8d9de8a202995f065800b5
children counter=2 bid=eec750dc19fcf33e15ff69b46140cba05ffc323fc6842fce635b5adb89c3bd8a
children counter=0 bid=efe3dc851f3d0585b1b27032126bce580eb9090c52df9939ce468897a44ee91c
children counter=0 bid=f2096b956da07c5046ff49b715b9ba4d5c727dfd86aee9c4734a4f10169c4f70
children counter=2 bid=fd7a85f04d9e39bb59479a230ca77ff9801d7f6cc379bcd5d2d0a3c29b430172
Starting multicore ring checker using 2/3 cpus
lmdb libversion=LMDB 0.9.70: (December 19, 2015)

result:

curl -X POST http://<domain>:<port>/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "0", "method": "get_status", "params": {}}'; echo
curl: (7) Failed to connect to <domain> port <port>: Connection refused

@noglance
Copy link
Author

wow. it started from second reboot:

curl -X POST http://<domain>:<port>/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "id": "0", "method": "get_status", "params": {}}'; echo
{"id":"0","jsonrpc":"2.0","result":{"incoming_peer_count":0,"next_block_effective_median_size":100000,"outgoing_peer_count":2,"recommended_fee_per_byte":100,"top_block_difficulty":812082032,"top_block_hash":"31eb2441a790e4946fbd11ff5542e8582d710e243aec34e858fab0f9c16e9eb4","top_block_height":1469800,"top_block_timestamp":1519303889,"top_block_timestamp_median":0,"top_known_block_height":1473320,"transaction_pool_version":1}}

@noglance
Copy link
Author

noglance commented Feb 27, 2018

not starting from 1st and 3rd reboot

~/.bytecoin/logs/walletd-errors_0.log and walletd-verbose_0.log — empty

@noglance
Copy link
Author

@SoraKohaku
Copy link

SoraKohaku commented Feb 28, 2018 via email

@CooperLee123
Copy link

where is .wallet file?

@MisterTimur
Copy link

MisterTimur commented Sep 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants