[SOLVED] Am I the only person that can not sign name Tx with epoch?

I followed the instructions at: https://dev.aepps.com/tutorials/naming-workflow-in-node-console.html with the ROMA binary release 1.1.0 at github.

Everything seems OK at the beginning,

(epoch@localhost)16> {ok, PreClaimTx} = CreatePreClaimTx(Name, Salt, Nonce).
{ok,{aetx,name_preclaim_tx,aens_preclaim_tx,79,
{ns_preclaim_tx,{id,account,<<“ÆÔ\r£|§v+B=6\fIêzê[纔…>>},
1,
{id,commitment,
<<203,156,79,64,38,240,244,113,30,26,216,13,168,123,74,
…>>},
20000,18000}}}

but finally, I got:

(epoch@localhost)17> SignAndPushTx(PreClaimTx).
** exception error: no match of right hand side value
<<144,216,107,146,255,130,103,44,86,198,18,160,207,105,
165,229,206,9,130,131,77,147,225,235,8,139,244,206,123,
…>>

There is similar problem when I send coins in the console: https://github.com/aeternity/tutorials/blob/master/spend-transaction-in-node-console.md

Am I the only one that can not claim test name successfully?

did you use the network_id ?

1 Like

Impossible to tell without seeing the whole shell history, but my guess would be that you have already bound a variable (Erlang is assign once) so something is not matching…

For example if you first did

% verify keys to be correct
SampleMsg = <<"random message">>, 
Signature = enacl:sign_detached(SampleMsg, PrivKey),
{ok, SampleMsg} == enacl:sign_verify_detached(Signature, SampleMsg, PubKey),

and then in the same shell define:

f(SignAndPushTx), SignAndPushTx = fun(Tx) ->
...
  Signature = enacl:sign_detached(TxBinMainnet, PrivKey),
...

Then you will try to match the first Signature with the result of enacl:sign_detached(TxBinMainnet, PrivKey) in the function. This is probably not what you want… A better way to define SignAndPushTx is:

f(SignAndPushTx), f(TxBin), f(TxBinMainnet), f(Signature), f(SignedTx), 
SignAndPushTx = fun(Tx) ->
...
end.
2 Likes

Thanks~I used the default instructions and yes,there is a network_id

Thanks very much and happy new year!

I spitted SignAndPushTx function into single commands, and it seems OK.

I’ll try deeper.

1 Like