Author Topic: Setting up a Site, Node, etc.  (Read 2358 times)

0 Members and 1 Guest are viewing this topic.

Offline Sshadow

Setting up a Site, Node, etc.
« on: March 18, 2018, 04:20:01 am »
I am working on setting up "the works" you may call it. I have been following the few guides I can find(which aren't comprehensive) and pretty much have everything up and running. I am using an Ubuntu server. There are a few points I seem to be stuck on and was hoping I could get some advice or assistance.

So far I have a Trusted node, a Delayed node, and a wallet running. I also have the UI set up and can connect to it just fine. The following are the commands I use to run everything so you can see what ports are for what.

Code: [Select]
./programs/witness_node/witness_node --data-dir=trusted_node/ --rpc-endpoint="127.0.0.1:8090" --max-ops-per-account 100 --partial-operations true

./programs/delayed_node/delayed_node --trusted-node="127.0.0.1:8090" --rpc-endpoint="127.0.0.1:8091" -d delayed_node -s "0.0.0.0:0" --p2p-endpoint="0.0.0.0:0" --seed-nodes "[]" --max-ops-per-account 100 --partial-operations true

./programs/cli_wallet/cli_wallet --server-rpc-endpoint="ws://127.0.0.1:8090" --rpc-http-endpoint="127.0.0.1:8092"

There are 2 things I seem to be stuck on. Firstly is what the site should be connecting to. Should it be connecting to the Trusted node, Delayed node, or the Wallet? When I go into settings I have tried all 3 ports using localhost and all say unreachable even though everything is running on the same machine. The Delayed node didn't seem to have a problem  connecting to the trusted node though.

Secondly on the actual site(the UI) you can navigate around just fine using the links etc. However lets say your on the settings page and hit refresh it gives the error "The requested URL /settings was not found on this server." Does this happen to have something to do with rewrites in Apache? Do I need to add something to my .htaccess?

I appreciate any help. I have searched and troubleshooted for a few days with no luck. Hopefully someone here can help me.

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4549
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Setting up a Site, Node, etc.
« Reply #1 on: March 18, 2018, 09:31:02 am »
Light wallet should be able to connect to the trusted node.

Web wallet by default can only connect via wss, that said, it's recommended to setup an nginx reverse proxy to serve secure connections and offload and forward plain requests to the trusted node.
https://steemit.com/bitshares/@ihashfury/distributed-access-to-the-bitshares-decentralised-exchange

« Last Edit: March 18, 2018, 09:35:13 am by abit »
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
Re: Setting up a Site, Node, etc.
« Reply #2 on: March 18, 2018, 09:34:33 am »
UI should connect to the trusted node.

Delayed node is mostly for use by gateways to ensure transactions are irreversible.

As far as your UI error is concerned, i believe youre missing something like this in your .htaccess

Code: [Select]

<IfModule mod_rewrite.c>

  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-l
  RewriteRule . /index.html [L]

</IfModule>

What URL do you enter for the wallet to connect to?

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
Re: Setting up a Site, Node, etc.
« Reply #3 on: March 18, 2018, 09:35:33 am »
Web wallet by default can only connect via wss, that said, it's recommended to setup an nginx reverse proxy to serve secure connections and offload and forward plain requests to the trusted node.

Only if the web wallet is served via https.

If youre serving the wallet in http, ws:// will be allowed too

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #4 on: March 19, 2018, 03:45:59 am »
Ok thank you for your help so far. That was an easy fix for the UI error and it seems to be working correctly now. I am using https for the site and I still can't connect to my node using wss://127.0.0.1:8090. I am sure it is something simple I am doing wrong. There wouldn't be anything I need to add to the firewall would there? Since everything is on the same box I figured leaving the port closed would be the most secure thing.

Edit - I meant to add the site is https://cryptobits.tech
« Last Edit: March 19, 2018, 03:48:15 am by Sshadow »

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4549
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Setting up a Site, Node, etc.
« Reply #5 on: March 19, 2018, 04:22:48 pm »
Ok thank you for your help so far. That was an easy fix for the UI error and it seems to be working correctly now. I am using https for the site and I still can't connect to my node using wss://127.0.0.1:8090. I am sure it is something simple I am doing wrong. There wouldn't be anything I need to add to the firewall would there? Since everything is on the same box I figured leaving the port closed would be the most secure thing.

Edit - I meant to add the site is https://cryptobits.tech

1. can not use IP address with wss but only FQDN. I remember there is a starndard
2. How did you configure wss with 8090 port?

I suggest you follow the link I posted above. Use Nginx.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #6 on: March 20, 2018, 07:31:49 am »
I used a combination of this for setting up my nodes http://docs.bitshares.org/integration/exchanges/step-by-step.html and this for getting me going as a witness http://docs.bitshares.org/tutorials/witness-create.html

I have looked but haven't had any luck. Do you know of a way to do this with Apache?

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4549
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Re: Setting up a Site, Node, etc.
« Reply #7 on: March 20, 2018, 10:44:10 am »
I used a combination of this for setting up my nodes http://docs.bitshares.org/integration/exchanges/step-by-step.html and this for getting me going as a witness http://docs.bitshares.org/tutorials/witness-create.html

I have looked but haven't had any luck. Do you know of a way to do this with Apache?

Are you looking to run a node for your own use, or a web wallet service, or an exchange-like service, or what else? This may help us get you the most helpful info.

You've mentioned "site", so I guess you're going to run web wallet service.

The tutorials you linked don't contain info about web wallets. The link I provided has it. https://steemit.com/bitshares/@ihashfury/distributed-access-to-the-bitshares-decentralised-exchange .

Web wallet services usually don't need to run delayed nodes. That's for 3rd-party integration, e.g. exchanges and other businesses that need to observe certain transactions on the blockchain.

By the way, I don't use Apache. Wish someone else can help you if you have to use it.
BTS account: abit
BTS committee member: abit
BTS witness: in.abit

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #8 on: March 20, 2018, 09:46:37 pm »
I am running the node as a witness. I am wanting to also use the UI to run my own exchange.

Offline sschiessl

Re: Setting up a Site, Node, etc.
« Reply #9 on: March 20, 2018, 09:49:27 pm »
Are you aiming to run a private net or a customized, possibly white listed wallet using the existing bitshares Blockchain?

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #10 on: March 20, 2018, 10:31:52 pm »
Are you aiming to run a private net or a customized, possibly white listed wallet using the existing bitshares Blockchain?
Yes I do plan to customize it once the backend is running correctly. I am wanting to run it open to everyone. I may go back and follow the tutorial abit posted starting from scratch. Just save the databases I have created already. I am assuming I can still run it that way and still use my witness info in the config.

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #11 on: March 21, 2018, 07:54:02 am »
I used a combination of this for setting up my nodes http://docs.bitshares.org/integration/exchanges/step-by-step.html and this for getting me going as a witness http://docs.bitshares.org/tutorials/witness-create.html

I have looked but haven't had any luck. Do you know of a way to do this with Apache?

Are you looking to run a node for your own use, or a web wallet service, or an exchange-like service, or what else? This may help us get you the most helpful info.

You've mentioned "site", so I guess you're going to run web wallet service.

The tutorials you linked don't contain info about web wallets. The link I provided has it. https://steemit.com/bitshares/@ihashfury/distributed-access-to-the-bitshares-decentralised-exchange .

Web wallet services usually don't need to run delayed nodes. That's for 3rd-party integration, e.g. exchanges and other businesses that need to observe certain transactions on the blockchain.

By the way, I don't use Apache. Wish someone else can help you if you have to use it.
Ok, so I have reconfigured everything to use Nginx. Everything looks good. I can connect via wss: etc. That guide seems a little out dated as I can't find the source file to edit to make my node default when I rebuild the UI. Nginx also behaves different from apache so I can't use the rewrites I am used to for the UI issue I fixed earlier. Any tips on those 2 issues? I am very relieved to solve the connection issue so thanks for that :)

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #12 on: March 23, 2018, 02:22:59 am »
I think I have everything running as desired. Thank you all so much for the help!

Offline clockwork

  • Committee member
  • Sr. Member
  • *
  • Posts: 376
    • View Profile
  • BitShares: clockwork
Re: Setting up a Site, Node, etc.
« Reply #13 on: March 23, 2018, 06:25:24 am »
I used a combination of this for setting up my nodes http://docs.bitshares.org/integration/exchanges/step-by-step.html and this for getting me going as a witness http://docs.bitshares.org/tutorials/witness-create.html

I have looked but haven't had any luck. Do you know of a way to do this with Apache?

Are you looking to run a node for your own use, or a web wallet service, or an exchange-like service, or what else? This may help us get you the most helpful info.

You've mentioned "site", so I guess you're going to run web wallet service.

The tutorials you linked don't contain info about web wallets. The link I provided has it. https://steemit.com/bitshares/@ihashfury/distributed-access-to-the-bitshares-decentralised-exchange .

Web wallet services usually don't need to run delayed nodes. That's for 3rd-party integration, e.g. exchanges and other businesses that need to observe certain transactions on the blockchain.

By the way, I don't use Apache. Wish someone else can help you if you have to use it.
Ok, so I have reconfigured everything to use Nginx. Everything looks good. I can connect via wss: etc. That guide seems a little out dated as I can't find the source file to edit to make my node default when I rebuild the UI. Nginx also behaves different from apache so I can't use the rewrites I am used to for the UI issue I fixed earlier. Any tips on those 2 issues? I am very relieved to solve the connection issue so thanks for that :)

I think for nginx it's as simple as:

Code: [Select]
location / {
    try_files $uri /index.html;
}

Offline Sshadow

Re: Setting up a Site, Node, etc.
« Reply #14 on: March 23, 2018, 07:23:24 am »
I used a combination of this for setting up my nodes http://docs.bitshares.org/integration/exchanges/step-by-step.html and this for getting me going as a witness http://docs.bitshares.org/tutorials/witness-create.html

I have looked but haven't had any luck. Do you know of a way to do this with Apache?

Are you looking to run a node for your own use, or a web wallet service, or an exchange-like service, or what else? This may help us get you the most helpful info.

You've mentioned "site", so I guess you're going to run web wallet service.

The tutorials you linked don't contain info about web wallets. The link I provided has it. https://steemit.com/bitshares/@ihashfury/distributed-access-to-the-bitshares-decentralised-exchange .

Web wallet services usually don't need to run delayed nodes. That's for 3rd-party integration, e.g. exchanges and other businesses that need to observe certain transactions on the blockchain.

By the way, I don't use Apache. Wish someone else can help you if you have to use it.
Ok, so I have reconfigured everything to use Nginx. Everything looks good. I can connect via wss: etc. That guide seems a little out dated as I can't find the source file to edit to make my node default when I rebuild the UI. Nginx also behaves different from apache so I can't use the rewrites I am used to for the UI issue I fixed earlier. Any tips on those 2 issues? I am very relieved to solve the connection issue so thanks for that :)

I think for nginx it's as simple as:

Code: [Select]
location / {
    try_files $uri /index.html;
}
You are correct. After a bit more searching that night I found mention of how to convert an apache rewrite for a wordpress site. I just had to change the file extension to match my needs. Thank you though. Maybe that being here will help someone in the future. Never thought to post what solution I found.