0

I am making an offline wallet web app to use with my open source airgapped encrypted device - the PrivateKeyVault.

The web app will be modeled after this one which is seen used in this video. The reason I don't just use the wallet app above is because I want to understand how it all works and writing it myself using sample code is a good way to gain understanding. Another reason is that although I believe the sample code was written with the kindest intentions and is not infected with malware of any kind, I have no way to know for sure and I do not have enough skills to perform an audit. So my strategy to reduce the chances of malware infestation is to write the app as simply as possible using only well trusted dependencies.

Right now, I know little about NodeJS, Expressjs, iota.js, or javascript.
To get started I am trying to:
1. Create the signed bundle trytes on the offline computer using NodeJs.
2. Pass the trytes to an online machine.
3. Broadcast the trytes to the tangle from the online machine using NodeJS.

The following NodeJS script is run on my offline device to create a signed bundle which shows up on the console output as what appears to be a very large array of trytes. The array (the signed bundle) is also listed below. Then I copy the "array like" output to the clipboard and make a secure transfer through the airgap to an online device. Then using the online computer at the bash console a NodeJS script containing the signed bundle is executed to broadcast the said signed bundle. This NodeJS script is also listed below. On attempting to run this last script I get an error which is also listed. Can someone please tell me what I am doing wrong and show me how to broadcast the signed bundle using a NodeJS script at the online computer? Thanks

The following file is saved as sign-bundle.js and is run from the offline raspberry pi bash command prompt with the following command. node sign-bundle.js

//////////////////////////////////////
// Sign Bundle Using Offline Computer
//////////////////////////////////////

const { createPrepareTransfers } = require('@iota/core'); 
const { asciiToTrytes } = require('@iota/converter');


let seed = 'FATTCNIQXGTTCSKIUVPRQXNRAGSHDGTGGGTOHQPMDBXHSDCNHPYQRCNI9AXDLIVCCA9KATTHSOSZZOIDV';
let fromAddress = 'AMECMIEELJKYZPQLBVSMJLSVPQFDSDZHTIWGORVJD9OUDGYINMOABRINKLW9HFVSFAKUQSWTJGCGSILS9MGNBSOAIA';
let fromAddressIndex = 1;
let fromAddressBalance = 19500000;
let toAddress = 'J9Q9PHLNIZXIFUNMRYYKDBTGANXNQLWVYNAYMYWIBSSGZDBVWYSHGAWTGH9FCYWQAAHAYEMA9CXTGMILDMLSKVDBXD';
let securityLevel = 2;
let transferAmount = 2000000;
let remainderAddress = 'AYKJNRHMHA9CHSLREPDJBRMYLPOBJRGYPFYYNDSVBJYWEIEVCEQPRBQSEHXSFKLCBQJADSZSYJLUKBCGWKDHOCYROD';
let message = '';


// Construct a transfers object
let transfers = [{
  'address': toAddress,
  'message': asciiToTrytes(message),
  'value': transferAmount,
  'tag': 'JRSOFFLINE'
}];

// Add a remainder address if specified by the user
if (remainderAddress) {
  transfers.push({
    'address': remainderAddress,
    'message': asciiToTrytes(message),
    'value': fromAddressBalance - transferAmount,
    'tag': 'JRSOFFLINE'
  });
}

// Construct an options object that includes the input
let options = {};
if (transferAmount > 0) {
  options = {
    'inputs': [{
      'keyIndex': fromAddressIndex,
      'address': fromAddress,
      'security': securityLevel,
      'balance': fromAddressBalance
    }]
  };
}

// Sign the bundle
createPrepareTransfers()(seed, transfers, options)
  .then((bundleTrytes) => {
    console.log("Success! Transaction bundle signed!");

    console.log(JSON.stringify(bundleTrytes));

  })
  .catch((err) => {
    console.log(`Error: ${err}`);
  });

The following is the array? of trytes produced by the above script.

["VXDXQYG9VOUYNNRVAGBUIGNICNZZXCKYMWPMCUJJQYKFOE9OHETLIAZEMVDMBIDPIDSLOAEOCMWXHGKTWXWBTN9YRHIETLTYRFQEAFJTTSJQGWPCMNPBX9OPYFCDWF9MTOYSMFEHXZSLYQWFWCIFAGSAWTMTATGOBDQKNGPEINAKLLLTVWPTLVMVKGSGBVKNKSHEAAONJUWZSGUTPEVU9PLIACIJGKVICQIBPGLFTHMRHUWVFFZKGEO9HMB9WDRQZATCYJPRMGZCCAURNFEJRFEBZ9MMZLAOJFG9YRTFWZTXCX9FHXKDYTUZKYGNAYMQZUKCJIGWZPPSXJXGNNBZEDBDPOBNLYZRDMPLITFIAAVPOWZMDMFCCLMCLJMSCCSBBGILSCHDLDKJOJWZQLSWDOIKQFDHIKIMUIOUKTKVTFZC9SOFHXJPXBNCRKWQPVZU9PGSJJPWPRA9AYADVHGXILHYKVXFVUISVYBPPAWZNLPLMRJXSRWKNOZEREKYTGLGWANDXS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CSYDIDVPJJKFZGFAANXLQSJVEGEKEEYKPSQTIJEZPXFOR9QUHBBVIQLDVIFOSOEUUDC9JBIIQTJAKQATKJJJPAKDV9BJY9UKUKVEETQHIWBYLZZATFSFLQZ9OSJLVLTQIMBBROBH9LKESTAGHYTOVDFFRMGWPAPIW9ZZMNQTAPECINLJWBKYCHPBDHPHGZCV9GXQHRGFFUAXVDABM9CANKAT9WWQIBOONWIYWHVALCSBSEWZBWYIMSKMZTJCA9CJD9RVVKEWUGZRLALYOX9QIB9MPJYITYNDUBZRDWNXJSGJB99OZOUASNJWXGRLWVYK9TPGZYQAPDESNSLAG9XKYLVFMTMPDFFRE9PAIBHOHGVEDHJPSRIXMWENECAMCHHVKR9RMEKMOQXWPSAQGCEZBXWLZNJNTXWNAMBITFZBKYOAPWJROWRCLVEEVZJHZLVHTNIGSPDLIQAAQVMTNRMFSLKQJGECFVIIGXQWGTGTDAKHNODMRHDJJRDQNOD9WXNFLTMWUDDQ9WIGQPUQA9WRCZQXIWJJDXHW9KQWQNHI9CHLHUZFBFWWIP9BXNZZFDSSKKUEJLQ99IWNUXOHSCFBMVD9DV99ATZUFVBLQEZFXAMECMIEELJKYZPQLBVSMJLSVPQFDSDZHTIWGORVJD9OUDGYINMOABRINKLW9HFVSFAKUQSWTJGCGSILS9999999999999999999999999999999999999999999999999999999XKOEG9D99C99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","IDUGXMZZOBBEFTPBRHCTLUSGEKZIXVFXKYTGBZKKJQUNNKWHQJRBJEGSHZUSA9SXQTXAYLTQKQTBAMUBXRDVJUKATCRJYIGHBOLDOEODBCWZNGKEV9DUDBDGVUHZMF9LVUHHZDFLNKVZ9TEAPPGMBCTDTRHAXRKNNBM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999999999999999999999999999999XKOEG9D99B99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999AYKJNRHMHA9CHSLREPDJBRMYLPOBJRGYPFYYNDSVBJYWEIEVCEQPRBQSEHXSFKLCBQJADSZSYJLUKBCGWDMBYFA999999999999999999999JRSOFFLINE99999999999999999XKOEG9D99A99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999JRSOFFLINE99999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999J9Q9PHLNIZXIFUNMRYYKDBTGANXNQLWVYNAYMYWIBSSGZDBVWYSHGAWTGH9FCYWQAAHAYEMA9CXTGMILDBMPUD9999999999999999999999TVSOFFLINE99999999999999999XKOEG9D99999999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999JRSOFFLINE99999999999999999999999999999999999999999999999999999999999999999999999"]

And the following is the NodeJS script which is run on the online raspberry pi at the bash console which produces the error. The script is saved as Send-IOTA.js and is run with the following command.
node Send-IOTA.js

///////////////////////////////
// Broadcast Signed Bundle Using Online Computer
///////////////////////////////

const iotaLibrary = require('@iota/core');

const iota = iotaLibrary.composeAPI({
  //Lookup healthy nodes at https://iota.dance/
  //provider: 'https://nodes.devnet.thetangle.org:443'
  provider: 'https://nodes.thetangle.org:443'
})



const myTrytes = ["VXDXQYG9VOUYNNRVAGBUIGNICNZZXCKYMWPMCUJJQYKFOE9OHETLIAZEMVDMBIDPIDSLOAEOCMWXHGKTWXWBTN9YRHIETLTYRFQEAFJTTSJQGWPCMNPBX9OPYFCDWF9MTOYSMFEHXZSLYQWFWCIFAGSAWTMTATGOBDQKNGPEINAKLLLTVWPTLVMVKGSGBVKNKSHEAAONJUWZSGUTPEVU9PLIACIJGKVICQIBPGLFTHMRHUWVFFZKGEO9HMB9WDRQZATCYJPRMGZCCAURNFEJRFEBZ9MMZLAOJFG9YRTFWZTXCX9FHXKDYTUZKYGNAYMQZUKCJIGWZPPSXJXGNNBZEDBDPOBNLYZRDMPLITFIAAVPOWZMDMFCCLMCLJMSCCSBBGILSCHDLDKJOJWZQLSWDOIKQFDHIKIMUIOUKTKVTFZC9SOFHXJPXBNCRKWQPVZU9PGSJJPWPRA9AYADVHGXILHYKVXFVUISVYBPPAWZNLPLMRJXSRWKNOZEREKYTGLGWANDXSNJXMXLJUDFW9OVOCBXQVFKRZCVCILGVWENWQ9IUUFYGZAJLXDBFTG9VLDOSCHQFKYMPJWBTNEMCQJANMDCRSINLAXFWUJAMIXRVIIXHVLTOORWYAGLNZCOBOBRFIIHJBR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IMBBROBH9LKESTAGHYTOVDFFRMGWPAPIW9ZZMNQTAPECINLJWBKYCHPBDHPHGZCV9GXQHRGFFUAXVDABM9CANKAT9WWQIBOONWIYWHVALCSBSEWZBWYIMSKMZTJCA9CJD9RVVKEWUGZRLALYOX9QIB9MPJYITYNDUBZRDWNXJSGJB99OZOUASNJWXGRLWVYK9TPGZYQAPDESNSLAG9XKYLVFMTMPDFFRE9PAIBHOHGVEDHJPSRIXMWENECAMCHHVKR9RMEKMOQXWPSAQGCEZBXWLZNJNTXWNAMBITFZBKYOAPWJROWRCLVEEVZJHZLVHTNIGSPDLIQAAQVMTNRMFSLKQJGECFVIIGXQWGTGTDAKHNODMRHDJJRDQNOD9WXNFLTMWUDDQ9WIGQPUQA9WRCZQXIWJJDXHW9KQWQNHI9CHLHUZFBFWWIP9BXNZZFDSSKKUEJLQ99IWNUXOHSCFBMVD9DV99ATZUFVBLQEZFXAMECMIEELJKYZPQLBVSMJLSVPQFDSDZHTIWGORVJD9OUDGYINMOABRINKLW9HFVSFAKUQSWTJGCGSILS9999999999999999999999999999999999999999999999999999999XKOEG9D99C99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","IDUGXMZZOBBEFTPBRHCTLUSGEKZIXVFXKYTGBZKKJQUNNKWHQJRBJEGSHZUSA9SXQTXAYLTQKQTBAMUBXRDVJUKATCRJYIGHBOLDOEODBCWZNGKEV9DUDBDGVUHZMF9LVUHHZDFLNKVZ9TEAPPGMBCTDTRHAXRKNNBMXVOI9QOKJBCSPVE9FMVNKGWUSVQPRKYRMNNMYKTIBWENL9AOKWOGYRCW9S9YLVSRPOQJOQUXXWAJAKVBYILYNAFOSVSWLMSHCNJ9Z9JCBWSURRVVSPGKYBKBJZLQON9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HBOYUWXGUKBXNI9A9BCHXTMTFSBORTHZ9BWDPCVWXFIZXJQNEHHPQQZSXPYRXEJVSYGXUMXRYYYJLXEDQYRWRMQAZAJPLBEGKYBMDYEWHCAZXGRRYHTWIY9KJOKVAYLHRMXONAZQGEFUD9NZDTETXMKUZ9LCZWFDBKCEXGOXQDSHNWBUAAOMALZOGNBNFDNOCHMLSHIMDSXTRBXTXUIPIDJ9E9QSSIMWSB9LPRFXVNABTDPQWYXTVJSBBUAMCYXZENEPOCBXDZHWNDTVLOXJANSGQI9CPIQFEBMMJJKVFQSAIXGXHUNFDDUK999SYXAFSLJBRFXZFQBBPPZBLYWQXMMYCITMXOWQ9RYG9MNBNXLLJBBI99HNSCPTQTXWETPAFZUXLSNLJFHCQVKDWAEVXDKLUAYWBBSTXSBVAWDY99PEGQYQRDZONXU9TMSQ9AHUQXIZBNODVIEQTMZCQBTLONDJACMRXMNWYHNNBTKN9FWCPUYJPAXXJPCLYEZ9RRJYOFHPAAFNSONSZR9ZBAHQKFGUBQCF99GJMPIK9TVR9AAZWXRQ9SXJFIJXMFISZGYCN9VRNIUHMOMXNMXXGKJMAEUHRFLSHBBURNGMWWZVUP9IQRHDQDTAMFKE9OIYDNZEWVXMGIOKVMQSNZBTJCSJWQRZJFGPCNXQSULMVAZZWVIMRQPOHLQQVIPAJNRJRNOIDZ9SAO9NCNKHCW9BHVBNPDHIDHIREWBOAHDMLRRLBOFLLXYQFPVNTUPYUYCGXGRUORABJPXHVSAXNKRALJLWXJRVQKIMTDEWWOZLIEAJAHFXFUDSC9JZCIWESINOPCCAMECMIEELJKYZPQLBVSMJLSVPQFDSDZHTIWGORVJD9OUDGYINMOABRINKLW9HFVSFAKUQSWTJGCGSILS9UAHHQZ999999999999999999999999999999999999999999999999XKOEG9D99B99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999AYKJNRHMHA9CHSLREPDJBRMYLPOBJRGYPFYYNDSVBJYWEIEVCEQPRBQSEHXSFKLCBQJADSZSYJLUKBCGWDMBYFA999999999999999999999JRSOFFLINE99999999999999999XKOEG9D99A99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999JRSOFFLINE99999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999J9Q9PHLNIZXIFUNMRYYKDBTGANXNQLWVYNAYMYWIBSSGZDBVWYSHGAWTGH9FCYWQAAHAYEMA9CXTGMILDBMPUD9999999999999999999999TVSOFFLINE99999999999999999XKOEG9D99999999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999JRSOFFLINE99999999999999999999999999999999999999999999999999999999999999999999999"]

let parsedTrytes = "";

parsedTrytes = JSON.parse(myTrytes);



// Create a wrapping function so we can use async/await
const main = async () => {

  try {
    // Send bundle to node.
    const response = await iota.sendTrytes(parsedTrytes, 3, 14);
    console.log('Completed TXs');
    response.map(tx => console.log(tx));
  } catch (e) {
    console.log(e);
  }
}

main()

Finally, the following is the error message returned by NodeJS at the bash console of the online computer which is trying to broadcast the signed bundle.

pi@raspberrypi:~/iota/iota-workshop/code $ node a-4.1-send-tokens-.js
undefined:1
VXDXQYG9VOUYNNRVAGBUIGNICNZZXCKYMWPMCUJJQYKFOE9OHETLIAZEMVDMBIDPIDSLOAEOCMWXHGKTWXWBTN9YRHIETLTYRFQEAFJTTSJQGWPCMNPBX9OPYFCDWF9MTOYSMFEHXZSLYQWFWCIFAGSAWTMTATGOBDQKNGPEINAKLLLTVWPTLVMVKGSGBVKNKSHEAAONJUWZSGUTPEVU9PLIACIJGKVICQIBPGLFTHMRHUWVFFZKGEO9HMB9WDRQZATCYJPRMGZCCAURNFEJRFEBZ9MMZLAOJFG9YRTFWZTXCX9FHXKDYTUZKYGNAYMQZUKCJIGWZPPSXJXGNNBZEDBDPOBNLYZRDMPLITFIAAVPOWZMDMFCCLMCLJMSCCSBBGILSCHDLDKJOJWZQLSWDOIKQFDHIKIMUIOUKTKVTFZC9SOFHXJPXBNCRKWQPVZU9PGSJJPWPRA9AYADVHGXILHYKVXFVUISVYBPPAWZNLPLMRJXSRWKNOZEREKYTGLGWANDXSNJXMXLJUDFW9OVOCBXQVFKRZCVCILGVWENWQ9IUUFYGZAJLXDBFTG9VLDOSCHQFKYMPJWBTNEMCQJANMDCRSINLAXFWUJAMIXRVIIXHVLTOORWYAGLNZCOBOBRFIIHJBRDDGKDP9JYNTZRXR9DBZLW9IJTLLEE9AWBSRNYTIWUJHDBNVTLJSAFMPOS9UNGNOVNOSYOEGVWLOERMRBL9CTKGIZVHP9NUBYWQJRXDWARBZVNPKYBBKFLSWG9EJHKGWPR9IJLCOKCUZGTEAATVFDRKZHRVJFIIEXLG9CINLJSIDBXLMJNGVMGJDZDVDMTXBYNGHSAFIFLBIBQVNONUGVZGNIZMQHNQB9TWHHFCONTCDUODDQCKZCBCQWOGRQCKQUYGONEMZANKNTM9ATGHCWMZSQYQIKRDYQV9FWYN9LVXGPNYKMCLQJEQPDMQJHL9CEZUUJ9ZOAHT9KJHRRVRCUSOSUDSDLXE9FDZKCQDJB9GM

SyntaxError: Unexpected token V in JSON at position 0
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (/home/pi/iota/iota-workshop/code/a-4.1-send-tokens-.js:19:21)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:236:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)
pi@raspberrypi:~/iota/iota-workshop/code $ 

Thanks for your help, John

  • your myTrytes value is already an object (an array), but you have to use JSON.parse on Strings. So either you do myTrytes = '["x", "y"]'; instead of myTrytes = ["x", "y"]; or you omit the JSON.parse for parsedTrytes. – mihi Mar 25 at 20:56
0

Thank you @mihi!
That was it.
Got rid of JSON.parse and put myTrytes directly into the sendTrytes function.
The working code is as follows.

The script is saved as Send-IOTA.js and is run with the following command.
node Send-IOTA.js

///////////////////////////////
// Broadcast Signed Bundle Using Online Computer
///////////////////////////////

const iotaLibrary = require('@iota/core');

const iota = iotaLibrary.composeAPI({
  //Lookup healthy nodes at https://iota.dance/
  //provider: 'https://nodes.devnet.thetangle.org:443'
  provider: 'https://nodes.thetangle.org:443'
})

const myTrytes = ["VXDXQYG9VOUYNNRVAGBUIGNICNZZXCKYMWPMCUJJQYKFOE9O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XOHSCFBMVD9DV99ATZUFVBLQEZFXAMECMIEELJKYZPQLBVSMJLSVPQFDSDZHTIWGORVJD9OUDGYINMOABRINKLW9HFVSFAKUQSWTJGCGSILS9999999999999999999999999999999999999999999999999999999XKOEG9D99C99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","IDUGXMZZOBBEFTPBRHCTLUSGEKZIXVFXKYTGBZKKJQUNNKWHQJRBJEGSHZUSA9SXQTXAYLTQKQTBAMUBXRDVJUKATCRJYIGHBOLDOEODBCWZNGKEV9DUDBDGVUHZMF9LVUHHZDFLNKVZ9TEAPPGMBCTDTRHAXRKNNBMXVOI9QOKJBCSPVE9FMVNKGWUSVQPRKYRMNNMYKTIBWENL9AOKWOGYRCW9S9YLVSRPOQJOQUXXWAJAKVBYILYNAFOSVSWLMSHCNJ9Z9JCBWSURRVVSPGKYBKBJZLQON9QFYFCZVKCKDXLKRATDLWOCOLFBXSXHM9DAZJMPDNK9NCNW9ELDNRZMSJNLFTTBH9HEJVMFFMV9ZFJERHFNMTQVLEAD9VTMGC9WFPNDX9KXJ9WFSFYGAELYQUMOYCMGNGLISZAHVTCSIWNBAVBBOALL9ZAWXPUJWASKRYMPPNVPVRKAATBCRNPETGCOOPWYJR9TWXVGVRGSPKOYXRLWURRTHVTJMXQVYITZCMQCCZENDQIMHGHZQYDIGIISMGBVJTMKMELRIYRBQCNHTVOYZOZGAXCNBYQRXNDYMPSRETPGOTMAKJT9KGIUANHCHRRGOQCGBHTNAAZZIQT9LUVAVOBNASNDYWZGWJJXYA9CRBSVFBPROPDEVZLNFALRIHSYOYHJROCCWUSEFVCXELLHEVRRCLIW9FBEIZEDIUBVHSPKEIOTXZMSLPOPXYDWFWLNOXVRGFWICQKWAUOT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NODVIEQTMZCQBTLONDJACMRXMNWYHNNBTKN9FWCPUYJPAXXJPCLYEZ9RRJYOFHPAAFNSONSZR9ZBAHQKFGUBQCF99GJMPIK9TVR9AAZWXRQ9SXJFIJXMFISZGYCN9VRNIUHMOMXNMXXGKJMAEUHRFLSHBBURNGMWWZVUP9IQRHDQDTAMFKE9OIYDNZEWVXMGIOKVMQSNZBTJCSJWQRZJFGPCNXQSULMVAZZWVIMRQPOHLQQVIPAJNRJRNOIDZ9SAO9NCNKHCW9BHVBNPDHIDHIREWBOAHDMLRRLBOFLLXYQFPVNTUPYUYCGXGRUORABJPXHVSAXNKRALJLWXJRVQKIMTDEWWOZLIEAJAHFXFUDSC9JZCIWESINOPCCAMECMIEELJKYZPQLBVSMJLSVPQFDSDZHTIWGORVJD9OUDGYINMOABRINKLW9HFVSFAKUQSWTJGCGSILS9UAHHQZ999999999999999999999999999999999999999999999999XKOEG9D99B99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999AYKJNRHMHA9CHSLREPDJBRMYLPOBJRGYPFYYNDSVBJYWEIEVCEQPRBQSEHXSFKLCBQJADSZSYJLUKBCGWDMBYFA999999999999999999999JRSOFFLINE99999999999999999XKOEG9D99A99999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999JRSOFFLINE99999999999999999999999999999999999999999999999999999999999999999999999","999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999J9Q9PHLNIZXIFUNMRYYKDBTGANXNQLWVYNAYMYWIBSSGZDBVWYSHGAWTGH9FCYWQAAHAYEMA9CXTGMILDBMPUD9999999999999999999999TVSOFFLINE99999999999999999XKOEG9D99999999999C99999999FJNIPKSFU9JQQSTABKHNLILRLHKHHIURUKJWZIYPRFOJCPOLWYRILGADRHDNEQJEJBLSQNAXRIVBCBFCD999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999JRSOFFLINE99999999999999999999999999999999999999999999999999999999999999999999999"]

// Create a wrapping function so we can use async/await
const main = async () => {

  try {
    // Send bundle to node.
    const response = await iota.sendTrytes(myTrytes, 3, 14);
    console.log('Completed TXs');
    response.map(tx => console.log(tx));
  } catch (e) {
    console.log(e);
  }
}

main()

Now I can send IOTA securely.
The next step is to wrap these scripts in a very simple web app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.