On 11/08/2013 03:43 AM, Michael Pearce wrote:
> Hey all.
> 
> I'm wanting to use Freenet to store small pieces of JSON data.  I'm
> wanting to do the following operations:
> 
> * Generate a new Public / Private Key Pair
> * Insert / Update a JSON string of data using the above private key
> * Get the JSON string using the public key
> 
> In the documentation for SSK, it shows an example of doing this via
> telnet (on port 2323, which i can't connect to):
> https://wiki.freenetproject.org/Signed_Subspace_Key.  I attempted the
> MAKESSK telnetting to port 9481 but it didn't work.  From what i can
> tell, this may no longer be the preferred way to do things.
> 
> I then looked at the FCP docs at
> https://wiki.freenetproject.org/FCPv2, which i'm gonna guess is what
> i should be doing.  I then tried the following:
> 
> ~/projects/ $ telnet 127.0.0.1 9481 Trying 127.0.0.1... Connected to
> localhost. Escape character is '^]'. GenerateSSK Identifier=My
> Identifier Blah Blah EndMessage Connection closed by foreign host.
> 
> It does not look to have generated a key.
> 
> Is there any example that i may have missed in my googling?
> 
> Thanks!
> 
> -mike

Sorry for the confusion! It looks like there's a bug. In this case the
node should have responded before closing the connection:

ProtocolError
Fatal=true
CodeDescription=ClientHello must be first message
Code=1
Global=false
EndMessage

So to generate an SSK keypair:

$ telnet localhost 9481
...
ClientHello
Name=TestingStuff
ExpectedVersion=2.0
End

The node will give a NodeHello.

GenerateSSK
End

The identifier field is not required for GenerateSSK. [1]

That said, there's no particular need to build your own library unless
you'd like to. For instance, there is lib-pyFreenet for Python. [2]
Inserting and fetching files are basic operations, and I hope would not
require special work to use.

-Steve

[0] https://wiki.freenetproject.org/FCPv2/ClientHello
[1] https://wiki.freenetproject.org/FCPv2/GenerateSSK
[2] https://github.com/freenet/lib-pyFreenet-staging

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: 
<https://emu.freenetproject.org/pipermail/tech/attachments/20131109/15fdce6c/attachment.pgp>

Reply via email to