You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 20, 2023. It is now read-only.
Setup a clean Ubuntu 20.04 install (VM)
Ran through all updates and downloads per https://github.com/oliverw/miningcore
Building from Source - all completed
NOTES: dotnet publish -c Release --framework net6.0 -o ../../build
results in OK but several warnings
g++ -g -Wall -fPIC -fpermissive -O2 -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-sign-compare -std=c++11 -c -o odocrypt.o odocrypt.cpp
cc -g -Wall -c -fPIC -O2 -Wno-pointer-sign -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-discarded-qualifiers -Wno-unused-const-variable -c -o x25x.o x25x.c
x25x.c: In function ‘x25x_hash’:
x25x.c(183,42): warning G3125B9F7: passing argument 2 of ‘blake2s’ makes integer from pointer without a cast [-Wint-conversion] [/home/USER/miningcore/src/Miningcore/Miningcore.csproj]
In file included from x25x.c:33:
blake2/sse/blake2.h:179:34: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘void *’
179 | int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen );
| ~~~~~~~^~~~~~
x25x.c(183,60): warning G07A8F574: passing argument 5 of ‘blake2s’ makes pointer from integer without a cast [-Wint-conversion]
cc -g -Wall -c -fPIC -maes -O2 -I. -Icontrib/epee/include -Wno-strict-aliasing -c -o crypto/oaes_lib.o crypto/oaes_lib.c
crypto/oaes_lib.c: In function ‘oaes_get_seed’:
crypto/oaes_lib.c(514,2): warning G44D93E38: ‘ftime’ is deprecated [-Wdeprecated-declarations]
In file included from ./serialization/crypto.h:37,
from cryptonote_basic/cryptonote_basic.h:44,
from cryptonote_basic/cryptonote_basic_impl.h:33,
from cryptonote_basic/cryptonote_format_utils.h:33,
from cryptonote_basic/cryptonote_format_utils.cpp:39:
./crypto/chacha.h: In function ‘void crypto::generate_chacha_key(const void*, size_t, crypto::chacha_key&)’:
./crypto/chacha.h(76,46): warning G6F341BBD: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘using chacha_key = tools::scrubbed_arr<unsigned char, 32>’ {aka ‘struct tools::scrubbed<std::array<unsigned char, 32> >’}; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
and many more generic warning on copy-assignment...
but it seems to build ok
Then I try to create user per instruction and it tells me
Command 'createuser' not found, but can be installed with:
sudo apt install postgresql-client-common
This is where things go off for me every time...
Peer authentication issues and more basic stuff for permissions - I just don't use postgres - ever - so trying to sort it.
I go back to home dir for my user (not miningcore linux user - not established yet)
--------------------------------- postgres installs ok
trying to follow instruction in doc is meaningless at this point
createuser miningcore
createuser: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "MYUSER" does not exist
so I read some posts and do this:
sudo apt-get install postgresql postgresql-contrib libpq-dev
now I can ad myself as super user:
sudo -u postgres createuser --superuser $USER
sudo -u postgres createdb $USER
touch .psql_history
Then I can:
createuser miningcore
createdb miningcore
psql
alter user miningcore with encrypted password 'some-secure-password';
grant all privileges on database miningcore to miningcore;
\q
So then I try:
psql -d miningcore -U miningcore -f createdb_postgresql_11_appendix.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "miningcore"
Try again from start sql
psql -d miningcore -U miningcore -f createdb.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "miningcore"
So I read on Glitter old messages to do this:
sudo -u postgres psql -d miningcore < createdb.sql
which then seems to create the table and populate as expected.
Trying to continue to advanced setup - I get hosed again...
psql -d miningcore -U miningcore -f createdb_postgresql_11_appendix.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "miningcore"
I open up psql
psql
I want to see the tables and db.. sl
\list
Shows miningcore with owner MyUser
I test and can connect as the linux MyUser
\c miningcore
You are now connected to database "miningcore" as user "MyUser".
OK so I need to sort user miningcore to connect to miningcore db
so I am connected at least as MyUser and I can list Roles...
du
shows
Role Name:
miningcore -- with no roles or attributes and nothing listed for member of
postgres -- with superuser, creat replicate bypass etc.. - no member of
MyUser -- SuperUser, Create role, Create DB --- no member of
Getting closer damn I wish I paid attention to this 10 years ago in college...
grant all privileges on database miningcore to miningcore;
du still shows the same...
So I quit out and check user pass for miningcore and reset again
Brilliant idea to just make a linux user named "miningcore"
Weirdly I can now as my main system user
psql
\c miningcore
\list
and now I see db miningcore, owned by MyUser (linux main system user) with access lists
but I still cannot get miningcore sql to load in right...
\q out of that
If I change out the miningcore User name for my system linux user name I can make it work..
psql -d miningcore -U miningcore -f createdb_postgresql_11_appendix.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user
"miningcore"
psql -d miningcore -U MyUser -f createdb_postgresql_11_appendix.sql
SET
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
So at least the sql setup is there... but still getting lost on system user and db user permissions for db user miningcore
if I run it all as the system user I can do everything just fine...
What do I need to do to make this secure and run under the linux user "miningcore" instead of my own system user (that has sudo access)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Setup a clean Ubuntu 20.04 install (VM)
Ran through all updates and downloads per https://github.com/oliverw/miningcore
Building from Source - all completed
NOTES: dotnet publish -c Release --framework net6.0 -o ../../build
results in OK but several warnings
g++ -g -Wall -fPIC -fpermissive -O2 -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-sign-compare -std=c++11 -c -o odocrypt.o odocrypt.cpp
cc -g -Wall -c -fPIC -O2 -Wno-pointer-sign -Wno-char-subscripts -Wno-unused-variable -Wno-unused-function -Wno-strict-aliasing -Wno-discarded-qualifiers -Wno-unused-const-variable -c -o x25x.o x25x.c
x25x.c: In function ‘x25x_hash’:
x25x.c(183,42): warning G3125B9F7: passing argument 2 of ‘blake2s’ makes integer from pointer without a cast [-Wint-conversion] [/home/USER/miningcore/src/Miningcore/Miningcore.csproj]
In file included from x25x.c:33:
blake2/sse/blake2.h:179:34: note: expected ‘size_t’ {aka ‘long unsigned int’} but argument is of type ‘void *’
179 | int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen );
| ~~~~~~~^~~~~~
x25x.c(183,60): warning G07A8F574: passing argument 5 of ‘blake2s’ makes pointer from integer without a cast [-Wint-conversion]
cc -g -Wall -c -fPIC -maes -O2 -I. -Icontrib/epee/include -Wno-strict-aliasing -c -o crypto/oaes_lib.o crypto/oaes_lib.c
crypto/oaes_lib.c: In function ‘oaes_get_seed’:
crypto/oaes_lib.c(514,2): warning G44D93E38: ‘ftime’ is deprecated [-Wdeprecated-declarations]
g++ -Wall -Wno-unused-function -fPIC -fpermissive -std=c++0x -fexceptions -frtti -O2 -g -I. -Icontrib/epee/include -c -o cryptonote_basic/cryptonote_format_utils.o cryptonote_basic/cryptonote_format_utils.cpp
In file included from ./serialization/crypto.h:37,
from cryptonote_basic/cryptonote_basic.h:44,
from cryptonote_basic/cryptonote_basic_impl.h:33,
from cryptonote_basic/cryptonote_format_utils.h:33,
from cryptonote_basic/cryptonote_format_utils.cpp:39:
./crypto/chacha.h: In function ‘void crypto::generate_chacha_key(const void*, size_t, crypto::chacha_key&)’:
./crypto/chacha.h(76,46): warning G6F341BBD: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘using chacha_key = tools::scrubbed_arr<unsigned char, 32>’ {aka ‘struct tools::scrubbed<std::array<unsigned char, 32> >’}; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
and many more generic warning on copy-assignment...
but it seems to build ok
Then I try to create user per instruction and it tells me
This is where things go off for me every time...
Peer authentication issues and more basic stuff for permissions - I just don't use postgres - ever - so trying to sort it.
I go back to home dir for my user (not miningcore linux user - not established yet)
psql not found - duh -not installed yet...
so I do:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
--------------------------------- postgres installs ok
trying to follow instruction in doc is meaningless at this point
createuser miningcore
createuser: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "MYUSER" does not exist
so I read some posts and do this:
sudo apt-get install postgresql postgresql-contrib libpq-dev
now I can ad myself as super user:
sudo -u postgres createuser --superuser $USER
sudo -u postgres createdb $USER
touch .psql_history
Then I can:
createuser miningcore
createdb miningcore
psql
alter user miningcore with encrypted password 'some-secure-password';
grant all privileges on database miningcore to miningcore;
\q
So then I try:
psql -d miningcore -U miningcore -f createdb_postgresql_11_appendix.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "miningcore"
Went back and dl the main creatdb.sql
wget https://raw.githubusercontent.com/coinfoundry/miningcore/master/src/Miningcore/Persistence/Postgres/Scripts/createdb.sql
Try again from start sql
psql -d miningcore -U miningcore -f createdb.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "miningcore"
So I read on Glitter old messages to do this:
sudo -u postgres psql -d miningcore < createdb.sql
which then seems to create the table and populate as expected.
Trying to continue to advanced setup - I get hosed again...
psql -d miningcore -U miningcore -f createdb_postgresql_11_appendix.sql
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "miningcore"
I open up psql
psql
I want to see the tables and db.. sl
\list
Shows miningcore with owner MyUser
I test and can connect as the linux MyUser
\c miningcore
You are now connected to database "miningcore" as user "MyUser".
OK so I need to sort user miningcore to connect to miningcore db
so I am connected at least as MyUser and I can list Roles...
du
shows
Role Name:
miningcore -- with no roles or attributes and nothing listed for member of
postgres -- with superuser, creat replicate bypass etc.. - no member of
MyUser -- SuperUser, Create role, Create DB --- no member of
Getting closer damn I wish I paid attention to this 10 years ago in college...
grant all privileges on database miningcore to miningcore;
du still shows the same...
So I quit out and check user pass for miningcore and reset again
Brilliant idea to just make a linux user named "miningcore"
Weirdly I can now as my main system user
psql
\c miningcore
\list
and now I see db miningcore, owned by MyUser (linux main system user) with access lists
but I still cannot get miningcore sql to load in right...
\q out of that
If I change out the miningcore User name for my system linux user name I can make it work..
SET
DROP TABLE
CREATE TABLE
CREATE INDEX
CREATE INDEX
So at least the sql setup is there... but still getting lost on system user and db user permissions for db user miningcore
if I run it all as the system user I can do everything just fine...
What do I need to do to make this secure and run under the linux user "miningcore" instead of my own system user (that has sudo access)?
Beta Was this translation helpful? Give feedback.
All reactions