Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7166013
Change logic for transaction serialization/deserialization (WIP)
noandrea Mar 1, 2019
615f652
New logic for transaction packing/unpacking
noandrea Mar 2, 2019
5357332
Update aens with new transaction management
noandrea Mar 2, 2019
3179447
Update contracts with new transaction management
noandrea Mar 2, 2019
cd28f3b
Refactor support submodules
noandrea Mar 2, 2019
b7da1e7
Update oracles with new transaction management
noandrea Mar 2, 2019
02f9a00
Move default values into separate file
noandrea Mar 2, 2019
1aa77fc
Refactor config to be part of the node submodule
noandrea Mar 2, 2019
fd01a2c
Api version check moved to the openapi client
noandrea Mar 2, 2019
8a78669
Update cli interface with new transaction management
noandrea Mar 2, 2019
18a6a5b
Update tests
noandrea Mar 2, 2019
61dd64b
Fix defaults parameters
noandrea Mar 2, 2019
4f47eaa
Add field nonce to account
noandrea Mar 2, 2019
64ab6f0
Fix return type for transactions methods
noandrea Mar 2, 2019
bcc212b
Fix lint error
noandrea Mar 2, 2019
a1165c0
Estimate expiration date for ttl
noandrea Mar 3, 2019
bcef821
Add network-id command to print the network id
noandrea Mar 3, 2019
b440195
Refactor naming to avoid too early claims
noandrea Mar 3, 2019
225a85c
Remove legacy config file
noandrea Mar 3, 2019
d261014
Remove legacy config file
noandrea Mar 3, 2019
533a8ec
Add wait_for_confirmation method to the node client
noandrea Mar 3, 2019
d269977
Fix namehash algorithm
noandrea Mar 3, 2019
3566c05
More consistency in cli output
noandrea Mar 3, 2019
3123bbe
Update test
noandrea Mar 3, 2019
f13ea90
Fix typo
noandrea Mar 3, 2019
31724ba
Fix lint error
noandrea Mar 3, 2019
3b993f4
Add new example for spend transaction
noandrea Mar 3, 2019
1714314
Reorganize options for cli
noandrea Mar 3, 2019
c1ffe42
Update readme
noandrea Mar 4, 2019
0a844c5
Fix transaction _id decoding
noandrea Mar 4, 2019
693c55e
Fix close tag for signatures
noandrea Mar 4, 2019
6726feb
Fix params for tx spend
noandrea Mar 4, 2019
bc567c8
Update tests for cli
noandrea Mar 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 45 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,48 +66,49 @@ Commands:

Use the environment variables

- `EPOCH_URL`
- `EPOCH_URL_DEBUG`
- `NODE_URL`
- `NODE_URL_DEBUG`

### Example usage

The following is a walkthrough to execute an offline spend transaction on the *sdk-edgenet* network
The following is a walkthrough to execute an offline spend transaction on the *testnet* network

1. Set the environment variables
```
export EPOCH_URL=https://sdk-testnet.aepps.com
export EPOCH_URL_DEBUG=https://sdk-testnet.aepps.com
export NODE_URL=https://sdk-testnet.aepps.com
```

❗ When not set the command line client will connect to mainnet

2. Retrieve the top block
```
./aecli chain top
<none>
$ aecli chain top
<top for node at https://sdk-testnet.aepps.com >
Beneficiary _______________________________________ ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688
Hash ______________________________________________ kh_2CkQuFZbxMh7KEjWQYphWxaTsTaL1tXrMDLyDwikKbwG1jNuRL
Height ____________________________________________ 12465
Miner _____________________________________________ ak_q6LAEutWqrmMLvSWE1dG4hN3dmLb8ixsJnkZUhsybGEti7Biv
Nonce _____________________________________________ 13307153327850546964
Prev hash _________________________________________ kh_oNMbgX3jW55tg3cr1DMpniCNfrJgQuqQUFEsXaozfhTca4rJt
Prev key hash _____________________________________ kh_oNMbgX3jW55tg3cr1DMpniCNfrJgQuqQUFEsXaozfhTca4rJt
State hash ________________________________________ bs_LaWiuHdYQ7Z1KBxXMeaPtYCG7JeCWU6ZqxfsGLTxYJU9cbsRq
Target ____________________________________________ 538660660
Time ______________________________________________ 2018-12-23T22:15:34.290000+00:00
Version ___________________________________________ 1
</none>
Hash ______________________________________________ kh_WTqMQQRsvmbtP5yrKPxd4p2PPKiA51AuPyCkVJk7d7HVtkhS6
Height ____________________________________________ 46049
Info ______________________________________________ cb_Xfbg4g==
Miner _____________________________________________ ak_24yQXT3g2jNryZbY2veHYcgQn3PspfTnkTHbXMwNYDQd9NZAs5
Nonce _____________________________________________ 17848795956567990671
Prev hash _________________________________________ kh_B5Q3F7Gxbmg2z3prkay2uYohvhv4xXUKQzKKkbTdm7Z3GuQxU
Prev key hash _____________________________________ kh_B5Q3F7Gxbmg2z3prkay2uYohvhv4xXUKQzKKkbTdm7Z3GuQxU
State hash ________________________________________ bs_bkP3QdFKCWNetDHfwL3rJG2hEgRzZRAQN6jh33SKwUd17tBjp
Target ____________________________________________ 538409724
Time ______________________________________________ 2019-03-03T23:38:49.720000+00:00
Version ___________________________________________ 2
</top for node at https://sdk-testnet.aepps.com >
```

3. Create a new account

```
aecli account create TEST.json
aecli account create Bob.json
Enter the account password []:
<account>
Address ___________________________________________ ak_tMZTyGmbpZYdKde9pfjh8bnxD2PPEEXM4KQjarLNNaoPpwrxn
Path ______________________________________________ /..../TEST.json
Address ___________________________________________ ak_BobY97QUVR4iDLg4k3RKmy6shZYx9FR75nLaN33GsVmSnhWxn
Path ______________________________________________ /.../Bob.json
</account>

```

❗ Make sure that you use a long and difficult-to-guess password for an account that you plan to use on mainnet
Expand All @@ -125,6 +126,7 @@ aecli inspect th_2CV4a7xxDYj5ysaDjXNoCSLxnkowGM5bbyAvtdoPvHZwTSYykX
Hash ______________________________________________ th_2CV4a7xxDYj5ysaDjXNoCSLxnkowGM5bbyAvtdoPvHZwTSYykX
<signatures 1>
Signature #1 ____________________________________ sg_WtPeyKWN4zmcnZZXpAxCT8EvjF3qSjiUidc9cdxQooxe1JCLADTVbKDFm9S5bNwv3yq57PQKTG4XuUP4eTzD5jymPHpNu
</signatures>
<tx>
Amount __________________________________________ 5000000000000000000
Fee _____________________________________________ 20000
Expand All @@ -142,37 +144,46 @@ aecli inspect th_2CV4a7xxDYj5ysaDjXNoCSLxnkowGM5bbyAvtdoPvHZwTSYykX
6. Create another account

```
aecli account create TEST1.json
aecli account create Alice.json
Enter the account password []:
<account>
Address ___________________________________________ ak_2rT82n7BYbH9JCsgxWqJc4BbPb9UybxCeAGS2RtXc8pPxhWJDu
Path ______________________________________________ /..../TEST1.json
Address ___________________________________________ ak_9j8akv2PE2Mnt5khFeDvS9BGc3TBBrJkfcgaJHgBXcLLagX8M
Path ______________________________________________ /.../Alice.json
</account>
```


7. Transfer some tokens to an account to the other

```
aecli account spend TEST.json ak_2rT82n7BYbH9JCsgxWqJc4BbPb9UybxCeAGS2RtXc8pPxhWJDu 1000000000000000000 --network-id ae_uat
aecli account spend Bob.json ak_9j8akv2PE2Mnt5khFeDvS9BGc3TBBrJkfcgaJHgBXcLLagX8M 1000000000000000000
Enter the account password []:
<spend transaction>
Sender account ____________________________________ ak_2ioQbdSViNKjknaLUWphdRjpbTNVpMHpXf9X5ZkoVrhrCZGuyW
Recipient account _________________________________ ak_2rT82n7BYbH9JCsgxWqJc4BbPb9UybxCeAGS2RtXc8pPxhWJDu
Unsigned __________________________________________ tx_+FcMAaEB4pu+lXqNvHL+V7e1uq4GhGOTR6GA6xF1LNzT1sp/De6hAfP6rN+zuBu1JJBSjeuEBufFkXQ1fRK0iYsik1KyXgWWiA3gtrOnZAAAgk4ggjKtAYANBwQ3
Signed ____________________________________________ tx_+KELAfhCuEBlJaNys8hURnXUAqVYsmgjSApQh7PbGm+r4KoJQwUH+zU+0z2+Y+Q/ecU/bdBvwqO7UcOyVnWlvVEoDFLUXfAFuFn4VwwBoQHim76Veo28cv5Xt7W6rgaEY5NHoYDrEXUs3NPWyn8N7qEB8/qs37O4G7UkkFKN64QG58WRdDV9ErSJiyKTUrJeBZaIDeC2s6dkAACCTiCCMq0BgBH1MuI=
Hash ______________________________________________ th_2PbPcfBMJGXe4GeAYWVT1CiY3DocgAe1RPP47VP1xaU2X5quJd
<data>
Tag _____________________________________________ 12
Vsn _____________________________________________ 1
Sender id _______________________________________ ak_BobY97QUVR4iDLg4k3RKmy6shZYx9FR75nLaN33GsVmSnhWxn
Recipient id ____________________________________ ak_9j8akv2PE2Mnt5khFeDvS9BGc3TBBrJkfcgaJHgBXcLLagX8M
Amount __________________________________________ 1000000000000000000
Fee _____________________________________________ 16860000000000
Ttl _____________________________________________ 0
Nonce ___________________________________________ 4
Payload _________________________________________
</data>
Metadata
Tx ________________________________________________ tx_+KMLAfhCuEAKN05UwTV0fSgO5woziVNnAMBcDrh46XlNFTZTJQlI05fz/8pVSyrb1guCLcw8n7++O887k/JEu6/XHcCSHOMMuFv4WQwBoQEYh8aMDs7saMDBvys+lbKds3Omnzm4crYNbs9xGolBm6EBE9B4l/BeyxMO//3ANxwyT+ZHL52j9nAZosRe/YFuK4eIDeC2s6dkAACGD1WGT5gAAASAN24JGA==
Hash ______________________________________________ th_2gAL72dtnaeDcZoZA9MbfSL1JrWzNErMJuikmTRvBY8zhkGh91
Signature _________________________________________ sg_2LX9hnJRiYGSspzpS34QeN3PLT9bGSkFRbad9LXvLj5QUFoV5eHRf9SueDgLiiquCGbeFEBPBe7xMJidf8NMSuF16dngr
Network id ________________________________________ ae_uat
</spend transaction>
```

❗ You dont need to set the `network-id` parameter for the mainnet!

8. Verify the balance of the new account
```
aecli inspect ak_2rT82n7BYbH9JCsgxWqJc4BbPb9UybxCeAGS2RtXc8pPxhWJDu
aecli inspect ak_9j8akv2PE2Mnt5khFeDvS9BGc3TBBrJkfcgaJHgBXcLLagX8M
<account>
Balance ___________________________________________ 1000000000000000000
Id ________________________________________________ ak_2rT82n7BYbH9JCsgxWqJc4BbPb9UybxCeAGS2RtXc8pPxhWJDu
Id ________________________________________________ ak_9j8akv2PE2Mnt5khFeDvS9BGc3TBBrJkfcgaJHgBXcLLagX8M
Nonce _____________________________________________ 0
</account>
```
Expand Down
Loading