[OpenDHT-Users] put_removable not working with Ruby
Alyed Tzompa
alyed.tzompa@simitel.com
Tue, 2 May 2006 11:31:35 -0700
This is a multi-part message in MIME format.
------_SmarterMail_NextPart_8072708358341225
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
=0D=0A Many thnx!=0D=0A=0D=0AHad a look at your code and it was quite help=
full. =0D=0A=0D=0AActually what I was doing wrong was the XMLRPC protocol c=
all.=0D=0A=0D=0AChanging from:=0D=0AdhtKey64 =3D Base64.encode64(dhtKey) =
=0D=0AdhtValue64 =3D Base64.encode64(dhtValue) =0D=0A=0D=0Ato:=0D=0AdhtKey6=
4 =3D XMLRPC::Base64.new(dhtKey,:dec)=0D=0AdhtValue64 =3D XMLRPC::Base64.ne=
w(dhtValue,:dec)=0D=0A=0D=0Adid the magic (change the call also in my "toSh=
a" method)=0D=0A=0D=0AThe remarks made by Sean in the other thread gave me =
a good hint also.=0D=0A=0D=0Awill try now the "get" and "remove", but now I=
'm quite confident about them.=0D=0A=0D=0Aregards,=0D=0A=0D=0AAlyed =0D=0A=
=0D=0A----------------------------------------=0D=0A=0D=0AReturn-Path: <ope=
ndht-users-admin@opendht.org> Mon May 01 09:42:29 2006=0D=0AReceived: from =
gibbon.cs.berkeley.edu [128.32.37.195] by mail11.webcontrolcenter.com with =
SMTP;=0D=0AMon, 1 May 2006 09:42:29 -0700=0D=0AReceived: from localhost=0D=
=0A=0D=0AI have used the following construct:=0D=0A=0D=0Adef binary(value)=
=0D=0AXMLRPC::Base64.new(value,:dec)=0D=0Aend=0D=0A=0D=0AAnd then further a=
long:=0D=0A=0D=0Adef []=3D(key,data)=0D=0Ashash =3D keyhash(get_secret(data=
))=0D=0Ares =3D @server.call("put_removable", keyhash(key),=0D=0Abinary(dat=
a), "SHA", shash,=0D=0A@ttl, "put");=0D=0A....=0D=0A=0D=0AIf you are intere=
sted to take a look at some working code, I've put it=0D=0Aat http://stdio.=
be/dg/bamboo.rb - although it's more a mockup I've=0D=0Abeen playing with, =
so beware its ugliness.=0D=0A=0D=0AImprovements are welcome.=0D=0A=0D=0Ache=
ers,=0D=0Aandrew=0D=0A=0D=0AOn 5/1/06, Alyed Tzompa wrote:=0D=0A>=0D=0A>=0D=
=0A> Hi there!=0D=0A>=0D=0A> I'm having problems making a "put_removable" (=
actually not even a "put"=0D=0A> works for me) to openDHT. I'm using Ruby 1=
.8.4-16 and get the following=0D=0A> message:=0D=0A>=0D=0A> java.lang.NoSuc=
hMethodException:=0D=0A> bamboo.dht.Gateway$XmlRpcPutRemovableHandler.put_r=
emovable(java.lang.String,=0D=0A> java.lang.String, java.lang.String, java.=
lang.String, int, java.lang.String,=0D=0A> java.lang.String, java.net.InetS=
ocketAddress, bamboo.util.Curry$Thunk1)=0D=0A>=0D=0A> Searched on the maili=
ng list but only found a similiar problem whose=0D=0A> solution was placing=
the parameters in the correct order. I've checked mines=0D=0A> (Key,Value,=
"SHA",hashed_secret,TTL, Appl_name) but keep on=0D=0A> receiving the same m=
essage.=0D=0A>=0D=0A> Any ideas?=0D=0A>=0D=0A> Alyed=0D=0A>=0D=0A> --------=
------------------------------=0D=0A> #code extract=0D=0A>=0D=0A> dhtServer=
=3D XMLRPC::Client.new("169.229.50.15","/",5851)=0D=0A> dhtKey64 =3D Base6=
4.encode64(dhtKey)=0D=0A> dhtValue64 =3D Base64.encode64(dhtValue)=0D=0A>=
=0D=0A> begin=0D=0A>=0D=0A> dhtStatus =3D=0D=0A> dhtServer.call("put_remova=
ble",dhtKey64,dhtValue64,"SHA",secret.toSha,60.to_i,"my_app")=0D=0A> rescue=
XMLRPC::FaultException =3D> error=0D=0A> puts error.faultCode=0D=0A> puts =
error.faultString=0D=0A>=0D=0A> end=0D=0A> --------------------------------=
--=0D=0A>=0D=0A>=0D=0A>=0D=0A=0D=0A________________________________________=
_______=0D=0AOpenDHT-Users mailing list=0D=0AOpenDHT-Users@opendht.org=0D=
=0Ahttp://opendht.org/cgi-bin/mailman/listinfo/opendht-users=0D=0A=0D=0A
------_SmarterMail_NextPart_8072708358341225
Content-Type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
=0D=0A <font face=3D"arial" size=3D"2">Many thnx!<br /><br />Had a look at=
your code and it was quite helpfull. <br /><br />Actually what I was doing=
wrong was the XMLRPC protocol call.<br /><br />Changing from:<br /><font f=
ace=3D"Times New Roman" size=3D"3">dhtKey64 =3D Base64.encode64(dhtKey)</fo=
nt><br /><font face=3D"Times New Roman" size=3D"3">dhtValue64 =3D Base64.en=
code64(dhtValue)</font><br /><br />to:<br />dhtKey64 =3D XMLRPC::Base64.new=
(dhtKey,:dec)<br />dhtValue64 =3D XMLRPC::Base64.new(dhtValue,:dec)<br /><b=
r />did the magic (change the call also in my "toSha" method)<br /><br />Th=
e=A0remarks=A0made by=A0Sean in the other thread gave me a good hint also.<=
br /><br />will try now the "get" and "remove", but now I'm quite confident=
about them.<br /><br />regards,<br /><br />Alyed <br /></font>=0D=0A <br =
/>=0D=0A <font face=3D"Tahoma, Arial, Sans-Serif" size=3D"2">=0D=0A <hr=
align=3D"center" width=3D"100%" size=3D"2" />=0D=0AReturn-Path: <opendh=
t-users-admin@opendht.org> Mon May 01 09:42:29 2006<br />Received: from =
gibbon.cs.berkeley.edu [128.32.37.195] by mail11.webcontrolcenter.com with =
SMTP;<br />Mon, 1 May 2006 09:42:29 -0700<br />Received: from localhost<br =
/></font>=0D=0A <br />=0D=0A <br />I have used the following construct:<b=
r /><br />def binary(value)<br />XMLRPC::Base64.new(value,:dec)<br />end<br=
/><br />And then further along:<br /><br />def []=3D(key,data)<br />shash =
=3D keyhash(get_secret(data))<br />res =3D @server.call("put_removable", ke=
yhash(key),<br />binary(data), "SHA", shash,<br />@ttl, "put");<br />....<b=
r /><br /><br />If you are interested to take a look at some working code, =
I've put it<br />at http://stdio.be/dg/bamboo.rb - although it's more a moc=
kup I've<br />been playing with, so beware its ugliness.<br /><br />Improve=
ments are welcome.<br /><br />cheers,<br />andrew<br /><br /><br />On 5/1/0=
6, Alyed Tzompa <alyed.tzompa@simitel.com>wrote:<br />><br />><br />&=
gt; Hi there!<br />><br />> I'm having problems making a "put_removab=
le" (actually not even a "put"<br />> works for me) to openDHT. I'm usin=
g Ruby 1.8.4-16 and get the following<br />> message:<br />><br />>=
; java.lang.NoSuchMethodException:<br />> bamboo.dht.Gateway$XmlRpcPutRe=
movableHandler.put_removable(java.lang.String,<br />> java.lang.String, =
java.lang.String, java.lang.String, int, java.lang.String,<br />> java.l=
ang.String, java.net.InetSocketAddress, bamboo.util.Curry$Thunk1)<br />>=
<br />> Searched on the mailing list but only found a similiar problem w=
hose<br />> solution was placing the parameters in the correct order. I'=
ve checked mines<br />> (Key,Value,"SHA",hashed_secret,TTL, Appl_name) b=
ut keep on<br />> receiving the same message.<br />><br />> Any id=
eas?<br />><br />> Alyed<br />><br />> ------------------------=
--------------<br />> #code extract<br />><br />> dhtServer =3D XM=
LRPC::Client.new("169.229.50.15","/",5851)<br />> dhtKey64 =3D Base64.en=
code64(dhtKey)<br />> dhtValue64 =3D Base64.encode64(dhtValue)<br />>=
<br />> begin<br />><br />> dhtStatus =3D<br />> dhtServer.call=
("put_removable",dhtKey64,dhtValue64,"SHA",secret.toSha,60.to_i,"my_app")<b=
r />> rescue XMLRPC::FaultException =3D> error<br />> puts error.f=
aultCode<br />> puts error.faultString<br />><br />> end<br />>=
----------------------------------<br />><br />><br />><br /><br =
/>_______________________________________________<br />OpenDHT-Users mailin=
g list<br />OpenDHT-Users@opendht.org<br />http://opendht.org/cgi-bin/mailm=
an/listinfo/opendht-users<br /><br /></alyed.tzompa@simitel.com>
------_SmarterMail_NextPart_8072708358341225--