Post
Topic
Board Pools
Re: Multipool - the pool mining pool (with source code)
by
mf
on 05/07/2011, 19:10:57 UTC
I never did get the perl CPAN dependencies (...)
Can't locate JSON/RPC/Client.pm
I appreciate the gentleman running Multiclone but I'd like to run one myself for my own use.
I guess I need to try again sometime, perhaps with a newer distro than Centos 5

Why not today?

Use cpanm (http://search.cpan.org/~miyagawa/App-cpanminus-1.4008/lib/App/cpanminus.pm) to install modules -locally- rather than as root.

Example, for Multipool I created a new user, disabled password and all, got the source and then installed the dependencies in a "local lib" with cpanm.

I'll re-do bits of it for you, so you can get comfortable with the process Wink

I'll first create a new user:

Code:
root@xxx:~# adduser --disabled-password teensy
Adding user `teensy' ...
...

Switch to it:
Code:
$ su - teensy

Fetch cpanm:
Code:
teensy@xxx:~$ curl -L http://cpanmin.us > cpanm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  163k  100  163k    0     0  78241      0  0:00:02  0:00:02 --:--:--  377k
teensy@xxx:~$ chmod +x cpanm

Tell it to install JSON::RPC::Client in the local ./lib directory:

Code:
teensy@xxx:~$ ./cpanm -l ./lib JSON::RPC::Client
--> Working on JSON::RPC::Client
Fetching http://search.cpan.org/CPAN/authors/id/M/MA/MAKAMAKA/JSON-RPC-0.96.tar.gz ... OK
Configuring JSON-RPC-0.96 ... OK
Building and testing JSON-RPC-0.96 ... OK
Successfully installed JSON-RPC-0.96
1 distribution installed

Now, if you look under lib/ you will see there are a bunch of directories which you need added to Perl's path for libraries.
In my case, these are: lib/lib/perl5, and lib/lib/perl5/x86_64-linux-gnu-thread-multi.

To see it worked,

Code:
$ perl -MJSON::RPC::Client -e1
Can't locate JSON/RPC/Client.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .).
BEGIN failed--compilation aborted.
$ PERL5LIB="lib/lib/perl5/x86_64-linux-gnu-thread-multi:lib/lib/perl5" perl -MJSON::RPC::Client -e1

So, what you then can do is either:
* use that PERL5LIB= line before launching Multipool.pl, a la: $ PERL5LIB=xxxx perl Multilib.pl, or
* properly install cpanm and local::lib (search for tutorials on the web, or ask me for more info), or
* modify Multilib.pl to have " use lib './lib/lib/perl5', 'lib/lib/perl5/x86_64-linux-gnu-thread-multi'; " at its beginning after "use strict"

There you go Smiley