In this task, you can choose to either write a string to the blockchain or read a string from the blockchain (or both!) using the JS SDK. You can perform this task with a Node.js application or in a Web Application. Documentation is available on reading and writing strings to the note field using the JS SDK here.
As a writer:
- Using the JS SDK, create a Node.js or Web application that creates an account.
- Use the dispenser to add tokens to the account.
- Using the JS SDK, create a transaction that has a notefield property set with your favorite quote (or your own words of wisdom)! Keep it clean!
- Set the “to” transaction property to our account: NJY27OQ2ZXK6OWBN44LE4K43TA2AV3DPILPYTHAJAMKIVZDWTEJKZJKO4A
- Submit the transaction and enter the transaction ID as a reply to this task thread.
- Wait for a reader to reveal your quote!
As a reader:
- Scope out a writer’s transaction that was posted on this community thread and not yet revealed.
- Make sure your node is set to archival if the transaction you are locating will require you to look more than 300 blocks in the past.
- Using the JS SDK, create a Node.js or Web application
- Locate the transaction and read the note field.
- Post the revealed quote in reply to the writer!
Send us feedback! We would love to hear what you liked about the JS SDK functionalities and/or what could be improved. Reply to this thread on Community or email us at email@example.com.
- Make sure you have completed all the steps here to get your node up and running.
- Check that you are running the latest version.
- If you are a reader and want to look for historical transactions past 300 blocks, make sure you set your node’s archival value to True.
Why This Task Matters
Within the notefield you can post any arbitrary data structure (up to 1KB in size) to the blockchain, which gives you the ability to create and templatize your own transaction types. In this task, you can familiarize yourself with this core functionality (i.e. reading and writing to the notefield). We also hope you will share feedback on the documentation and feature set so far.
Post them here!