fruzhin

1.0.1 • Public • Published

Fruzhin-Cover-Black

What is Fruzhin?

Fruzhin is a Java implementation of the Polkadot Host. With the help of TeaVM it is now available as a JS based light client in web environments. It makes use of other full nodes to provide RPC server like behaviour.

It's been funded by Polkadot Pioneers Prize.

Warning Fruzhin is in pre-production state

Example

Starting Fruzhin

In order to use Fruzhin in your webpage you have to import the appropriate JS files from UNKPG. Then you can call the fruzhin.main() method with a string array parameter that takes one entry. The parameter can be one of the following:

  • Well known chain name (polkadot, westend, kusama)
  • A chain spec string
<!DOCTYPE html>
<html>
<head>
    <title>Fruzhin</title>
    <script type="module" src="https://unpkg.com/fruzhin/dist/js/fruzhin-lib.js"></script>
</head>
<body>
<script type="module">
    fruzhin.main(['polkadot']);
</script>
</body>
</html>

Making RPC calls

Once Fruzhin is started an RPC client is exported under a wsRpc object. Making a call is easy.

wsRpc.send('{"jsonrpc":"2.0","id":1,"method":"system_name","params":[]}')

Then the response can be retrieved by calling wsRpc.nextResponse().

NOTE wsRpc.nextResponse() returns null if no response is present in the queue.

Package Sidebar

Install

npm i fruzhin

Weekly Downloads

2

Version

1.0.1

License

Apache-2.0

Unpacked Size

12.7 MB

Total Files

10

Last publish

Collaborators

  • zurcus