3.2.1. mijin account creation¶
Note
mijin Catapult(v.2) to operate, you create an account and use that account to submit transactions.Also note that you must have a base currency (cat.currency) balance in your account if you are in commissionable mode as specified during deployment.
- creation-day:
Aug. 1, 2022
- update date:
January 17, 2023
3.2.1.1. Install nodejs and yarn¶
Install nodejs to use mijin-catapult-tools. Install nodejs using NodeSource
$ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - && sudo apt-get install -y nodejs
$ node --version
$ sudo npm install -g yarn
3.2.1.2. Installing mijin-catapult-tools¶
Use yarn to install mijin-catapult-tools.
$ yarn global add @tech-bureau/mijin-catapult-tools
$ echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
Verify that mijin-catapult-tools is available.
$ mijin-catapult-tools
3.2.1.3. Create an account¶
First, let’s create an account to be used for testing. Here we will use test1Account test2Account and store them in mijin.json.
3.2.1.3.1. Create Account¶
$ mijin-catapult-tools account generate -u http://localhost:3000 -w mijin.json -s
2023-01-17T06:34:59.412Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:34:59.413Z [info] : Network: 96
2023-01-17T06:34:59.413Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:34:59.413Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:34:59.413Z [info] : Start Account Generate...
2023-01-17T06:34:59.475Z [info] : Write Config File: mijin.json
2023-01-17T06:34:59.476Z [info] : New Account: {
"url": "http://localhost:3000",
"workAccount": {
"publicKey": "425F06A8870381A00BD83E2D1083BB690F9FCB815F0919DFFA1A53A68E144D06",
"privateKey": "9E9C660164AB344030DF5E77539952D9F5B380311C978369BA08923F577D8DAB",
"address": "MC5VTRZO7IGJUG2VPQXBD4GDO4A74YLFUCVZZGI"
},
"balanceAccount": {
"publicKey": "",
"privateKey": "",
"address": ""
},
"mainAccount": {
"publicKey": "F2985009341A526B17E954EB6EA3EC77E1A0B33AE31EB29F86A69D9BB283AF67",
"privateKey": "FF9A552ED35D930378F1E6B349A677771F19A06BCA0C4D5DCA621F354F5C6956",
"address": "MCV66SABR6MBWT2I56YI3ULCPYWREJFX5DHHGDQ"
},
"keylink": {
"vrf": {
"publicKey": "C074A57A0EDF633414DDD764C6771926E91596481E0C2CAD4D9C3EFAAA432BCE",
"privateKey": "C07D9A63B8DD8B0E639AAAE6059D7FA6C554082677926B7CACF0514E3940692C",
"address": "MBLYBGODVGLT3HED6EXAQAXJE4CHHVRWGIAS45Y"
},
"voting": {
"publicKey": "F6571CBC420A4EBA09E027AA53E5DD9486642911CDC11E0D3A6D1B2E4BC228D1",
"privateKey": "FD5744779348F77F6EA6288232D0C8944E2F3C9E24D2E0FB1E93A8C4F9DD9BA5",
"address": "MD2M6SDIE64O6ZWF2IJ7R4R5RDKOT2FNJDUIYOQ"
}
},
"test1Account": {
"publicKey": "CB51613497A40D9A256B17932579BC64D5037A04B29737B944965C1ADADD6E04",
"privateKey": "8D5969EF1796F5F90256C92B5017396E40786ED87995169D4E26C9E5E01D7F8C",
"address": "MAS36UGDCOGG6GYCBDPX3ROISABSNPZ6JQXMJSA"
},
"test2Account": {
"publicKey": "5CC14799D5B2643914C8E574C8D073A7EE9AE2A405F1339A53612B566498AB1D",
"privateKey": "FDE625C1D53AF04533FEB06A3556679FC02C4C6246952D3A534EB3E19CF83C56",
"address": "MC5AH4UGBPPHNCMPTVNSY6LRDPIMEDODS2O373A"
}
}
$ catapult@catapult:~$ mijin-catapult-tools account info -r mijin.json -t test1
2023-01-17T06:36:26.600Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:36:26.601Z [info] : Network: 96
2023-01-17T06:36:26.601Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:36:26.601Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:36:26.601Z [info] : Start Account Info
2023-01-17T06:36:26.620Z [error] : Address Not Found
$ mijin-catapult-tools account info -r mijin.json -t test2
2023-01-17T06:36:43.387Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:36:43.387Z [info] : Network: 96
2023-01-17T06:36:43.387Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:36:43.387Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:36:43.387Z [info] : Start Account Info
2023-01-17T06:36:43.405Z [error] : Address Not Found
3.2.1.3.2. About Fees and Commissions¶
Fees are charged by transactions issued in the following items and must be paid in the base currency (cat.currency).
transaction fee
Mosaic Rental Fee
Namespace Rental Fees
Locked guarantee deposit
3.2.1.4. Create and transfer Mosaic¶
First, let’s create and transfer the basic Mosaic.
3.2.1.4.1. Create Mosaic¶
Issue one issue of Mosaic(Token) with the test1 account as the owner.
$ mijin-catapult-tools transaction mosaic create -r mijin.json -o test1 -s 1 -d 0
2023-01-17T06:42:51.942Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:42:51.942Z [info] : Network: 96
2023-01-17T06:42:51.942Z [info] : Create Mosaic...
2023-01-17T06:42:51.955Z [info] : Mosaic Owener Account: MAS36UGDCOGG6GYCBDPX3ROISABSNPZ6JQXMJSA
2023-01-17T06:42:51.955Z [info] : MosaicId: 3D86C9FE5D52DE6F
2023-01-17T06:42:51.955Z [info] : Mosaic Flags: supplymutable:true, transferable:true, restrictable:true, revokable:false
2023-01-17T06:42:51.955Z [info] : Mosaic Supply: divisibility:0, supply:1
2023-01-17T06:42:51.964Z [info] : Transaction Fee: 0
2023-01-17T06:42:51.964Z [info] : Mosaic Rental Fee: 0
2023-01-17T06:42:51.964Z [info] : Start Aggregate Transaction...
2023-01-17T06:43:00.967Z [info] : End Aggregate Transaction
2023-01-17T06:43:00.967Z [info] : http://localhost:3000/transactionStatus/39BBE7E083460C3B85EB7D5FA2FB486F9786CA3FF1E0F976214F5753E527383A
2023-01-17T06:43:00.967Z [info] : http://localhost:3000/transactions/confirmed/39BBE7E083460C3B85EB7D5FA2FB486F9786CA3FF1E0F976214F5753E527383A
Checking the information on account A, we can see that it has only 1 MosaicId 3D86C9FE5D52DE6F.
$ mijin-catapult-tools account info -r mijin.json -t test1
2023-01-17T06:43:43.349Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:43:43.350Z [info] : Network: 96
2023-01-17T06:43:43.350Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:43:43.350Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:43:43.350Z [info] : Start Account Info
2023-01-17T06:43:43.365Z [info] : test1 Account: {
"publicKey": "CB51613497A40D9A256B17932579BC64D5037A04B29737B944965C1ADADD6E04",
"address": "MAS36UGDCOGG6GYCBDPX3ROISABSNPZ6JQXMJSA",
"mosaics": [
{
"id": "3D86C9FE5D52DE6F",
"amount": "1",
"currency": false,
"harvest": false
}
],
"keylink": {
"vrf": {
"publicKey": ""
},
"voting": {
"publicKey": "",
"startEpoch": "",
"endEpoch": ""
}
}
}
3.2.1.4.2. Transfer Mosaic¶
Transfer the Mosaic 3D86C9FE5D52DE6F you just created from test1 to test2.
$ mijin-catapult-tools transaction transfer -r mijin.json -f test1 -d test2 -m 3D86C9FE5D52DE6F -a 1
2023-01-17T06:44:46.983Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:44:46.984Z [info] : Network: 96
2023-01-17T06:44:46.984Z [info] : Start Transfer Account...
2023-01-17T06:44:46.996Z [info] : From Account Address: MAS36UGDCOGG6GYCBDPX3ROISABSNPZ6JQXMJSA
2023-01-17T06:44:46.996Z [info] : Dest Account Address: MC5AH4UGBPPHNCMPTVNSY6LRDPIMEDODS2O373A
2023-01-17T06:44:47.005Z [info] : Start Transfer Transaction...
2023-01-17T06:44:52.197Z [info] : End Transfer Transaction
2023-01-17T06:44:52.197Z [info] : http://localhost:3000/transactionStatus/454DFDC48F00852A3DE355D7D2AD4B581D718D999BA177E1BB392AECD1656C6A
2023-01-17T06:44:52.197Z [info] : http://localhost:3000/transactions/confirmed/454DFDC48F00852A3DE355D7D2AD4B581D718D999BA177E1BB392AECD1656C6A
$ mijin-catapult-tools account info -r mijin.json -t test1
2023-01-17T06:45:51.931Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:45:51.931Z [info] : Network: 96
2023-01-17T06:45:51.931Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:45:51.931Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:45:51.931Z [info] : Start Account Info
2023-01-17T06:45:51.946Z [info] : test1 Account: {
"publicKey": "CB51613497A40D9A256B17932579BC64D5037A04B29737B944965C1ADADD6E04",
"address": "MAS36UGDCOGG6GYCBDPX3ROISABSNPZ6JQXMJSA",
"mosaics": [],
"keylink": {
"vrf": {
"publicKey": ""
},
"voting": {
"publicKey": "",
"startEpoch": "",
"endEpoch": ""
}
}
}
$ mijin-catapult-tools account info -r mijin.json -t test2
2023-01-17T06:46:41.737Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:46:41.738Z [info] : Network: 96
2023-01-17T06:46:41.738Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:46:41.738Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:46:41.738Z [info] : Start Account Info
2023-01-17T06:46:41.754Z [info] : test1 Account: {
"publicKey": "0000000000000000000000000000000000000000000000000000000000000000",
"address": "MC5AH4UGBPPHNCMPTVNSY6LRDPIMEDODS2O373A",
"mosaics": [
{
"id": "3D86C9FE5D52DE6F",
"amount": "1",
"currency": false,
"harvest": false
}
],
"keylink": {
"vrf": {
"publicKey": ""
},
"voting": {
"publicKey": "",
"startEpoch": "",
"endEpoch": ""
}
}
}
3.2.1.5. (Extra)How to move the base currency when in commissionable mode¶
3.2.1.5.1. Register for a key currency holding account¶
Note
Import the above private_key in symbol-cli.If you already have a mijin.json file, only balanceAccount can be appended.
$ mijin-catapult-tools account generate -r mijin.json -w mijin.json -s -p 90EEBCB77A767F8F5CCCE9D0F89A60CB2D7FCD5FD8F469E2F8BDFC0CDD8B8A2F
2023-01-17T06:55:52.167Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:55:52.167Z [info] : Network: 96
2023-01-17T06:55:52.167Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:55:52.167Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:55:52.167Z [info] : Start Account Generate...
2023-01-17T06:55:52.229Z [info] : Write Config File: mijin.json
2023-01-17T06:55:52.233Z [info] : New Account: {
"url": "http://localhost:3000",
"workAccount": {
"publicKey": "425F06A8870381A00BD83E2D1083BB690F9FCB815F0919DFFA1A53A68E144D06",
"privateKey": "9E9C660164AB344030DF5E77539952D9F5B380311C978369BA08923F577D8DAB",
"address": "MC5VTRZO7IGJUG2VPQXBD4GDO4A74YLFUCVZZGI"
},
"balanceAccount": {
"publicKey": "4FAAC9BF9881893CB31BC2065E8A8D0B12364423E2A08DAF4F77E1FEF5D5B2E8",
"privateKey": "90EEBCB77A767F8F5CCCE9D0F89A60CB2D7FCD5FD8F469E2F8BDFC0CDD8B8A2F",
"address": "MCPYNELDE5QS63QBRZ2L7OLNZ63YPQJSOCEWXQI"
},
"mainAccount": {
"publicKey": "F2985009341A526B17E954EB6EA3EC77E1A0B33AE31EB29F86A69D9BB283AF67",
"privateKey": "FF9A552ED35D930378F1E6B349A677771F19A06BCA0C4D5DCA621F354F5C6956",
"address": "MCV66SABR6MBWT2I56YI3ULCPYWREJFX5DHHGDQ"
},
"keylink": {
"vrf": {
"publicKey": "C074A57A0EDF633414DDD764C6771926E91596481E0C2CAD4D9C3EFAAA432BCE",
"privateKey": "9E9C660164AB344030DF5E77539952D9F5B380311C978369BA08923F577D8DAB",
"address": "MBLYBGODVGLT3HED6EXAQAXJE4CHHVRWGIAS45Y"
},
"voting": {
"publicKey": "F6571CBC420A4EBA09E027AA53E5DD9486642911CDC11E0D3A6D1B2E4BC228D1",
"privateKey": "FD5744779348F77F6EA6288232D0C8944E2F3C9E24D2E0FB1E93A8C4F9DD9BA5",
"address": "MD2M6SDIE64O6ZWF2IJ7R4R5RDKOT2FNJDUIYOQ"
}
},
"test1Account": {
"publicKey": "CB51613497A40D9A256B17932579BC64D5037A04B29737B944965C1ADADD6E04",
"privateKey": "8D5969EF1796F5F90256C92B5017396E40786ED87995169D4E26C9E5E01D7F8C",
"address": "MAS36UGDCOGG6GYCBDPX3ROISABSNPZ6JQXMJSA"
},
"test2Account": {
"publicKey": "5CC14799D5B2643914C8E574C8D073A7EE9AE2A405F1339A53612B566498AB1D",
"privateKey": "FDE625C1D53AF04533FEB06A3556679FC02C4C6246952D3A534EB3E19CF83C56",
"address": "MC5AH4UGBPPHNCMPTVNSY6LRDPIMEDODS2O373A"
}
}
Warning
This ID will be a different value for each mijin created, and the base currency will be the ID displayed as “currency”: true
$ mijin-catapult-tools account info -r mijin.json -t balance
2023-01-17T06:56:51.299Z [info] : mijin URL: http://localhost:3000
2023-01-17T06:56:51.299Z [info] : Network: 96
2023-01-17T06:56:51.299Z [info] : Mosaic Currency Id: 268CF9B2D33FBD22
2023-01-17T06:56:51.299Z [info] : Mosaic Harvest Id: 4C39D26C386E3182
2023-01-17T06:56:51.299Z [info] : Start Account Info
2023-01-17T06:56:51.315Z [info] : balance Account: {
"publicKey": "4FAAC9BF9881893CB31BC2065E8A8D0B12364423E2A08DAF4F77E1FEF5D5B2E8",
"address": "MCPYNELDE5QS63QBRZ2L7OLNZ63YPQJSOCEWXQI",
"mosaics": [
{
"id": "268CF9B2D33FBD22",
"amount": "8998977498000000",
"currency": true,
"harvest": false
},
{
"id": "4C39D26C386E3182",
"amount": "15000000",
"currency": false,
"harvest": true
}
],
"keylink": {
"vrf": {
"publicKey": "2A88BA2689D584B03A3D4B829347F0A8B63AF55A8E9F176F1D2327F9E87E22D8"
},
"voting": {
"publicKey": "22BB9DCA05D483E4D4DDE764E8742E741ADA676F461D5F3E6663840C5290320F",
"startEpoch": 1,
"endEpoch": 26280
}
}
}