New Faucets for Symbol and NEM

Introduction


Having a testnet faucet tool is important. It is used to send out the testnet’s network token to users and can be used for instance to experiment with sending transactions or try out other features of the blockchain protocol without the need to obtain and spend mainnet currency.

As you will be aware, Symbol has its own testnet faucet but an equivalent tool has been absent for the NEM blockchain so we decided that it was time to build one.

Authorization


You may wonder why we need authorization for the faucet. Firstly, we can prevent malicious actors from exhausting all available funds, and secondly prevent accounts from accumulating enough testnet tokens to run spam attacks on the network.

There are a variety of different options for implementing faucet authorization but as most of the web3 / blockchain leaders, and our community members are active in the Twitter space, Twitter authorization seemed like the obvious choice.

Furthermore, with Twitter authorization, we can retrieve the users’ public information, such as the number of followers and age of their Twitter account which can help us to filter out malicious bot accounts.

If you like to know more about how Twitter authorization works, please read theΒ documentation.

System Architecture Design


From past experience with the Symbol faucet, it was clear that due to the monolithic architecture design it could not easily be scaled. This meant that if we wanted to add a NEM faucet then the majority of the functionality could not be shared.

After some discussions with the team, we decided to build an entirely new faucet with a microservice architecture design. By separating the functionality into microservices, it’s easy to maintain and scalable if, in the future, we would like to add additional services or re-use functions in other applications.

Schematic of architecture design

How It Works


The user must sign in with their Twitter account, and the authenticator service will verify it to prevent any newly generated accounts from accessing the faucet. The system requires that the Twitter account must have at least 10 followers and the account needs to be registered for more than 30 days.

What If I don’t have a Twitter account?
You can always reach out to us on Discord so don’t be shy! πŸ™‚

If these requirements are met then the jwt token will be generated and sent to the user’s browser. The jwt token will be stored in the browser’s local storage.

Users need to provide their testnet address and specify the number of tokens required. After clicking the Claim button, the application will submit the form information and the attached auth token to the backend service.

When the process is successfully completed, the backend service will return a confirmation message and transaction hash with the funds being sent to the requester’s account.

Summary


Faucet tools are important for the community. Developers require testnet funds in order to build new applications and, when new users start to explore Symbol and NEM, they need tokens to learn how to use different features of the blockchains. The new faucet is still a work in progress but will be coming soonTM so I hope that it will be useful to you! Stay tuned!

If you would like to know more about Symbol, please join the Discord server. Special thanks to ninelives for reviewing this article.

Tags:
Avatar photo
Anthony
anthony@symbol.dev

Practice Make Perfect.

2 Comments
  • λ°•μœ€ν™
    Posted at 13:29h, 15 December

    쒋은정보 κ°μ‚¬ν•©λ‹ˆλ‹€

  • Avatar photo
    Anthony
    Posted at 08:43h, 22 December

    Thank you πŸ™‚