Plugins

From Nxt Wiki
Jump to: navigation, search
This page is a translated version of the page Plugins and the translation is 71% complete.

Other languages:
Deutsch • ‎English • ‎русский • ‎українська

1 Einführung

Nxt Plugins ist eine Funktion die es erlaubt Drittanbieter-Software in den Nxt Client hinzuzufügen.

.

This guide describes how to install and use a plugin. Because plugins have unrestricted access to the local Nxt Server including sensitive data and functionality, it is vitally important to install only trusted plugins. If there is any doubt, install a plugin only on the Testnet or on Mainnet accounts with small balances.

Diese Anleitung beschreibt Nxt Plugins ab dem Stand Nxt software release 1.5.9 (Englisch).

2 Inhaltsverzeichnis

3 Acquire a Plugin

Plugins are authored by third party developers. Some are free while others can be purchased in the Nxt Marketplace under the tag plugin. A good place to discover plugins and ask questions about them is the Nxt Plugins subforum.

  • Unless you are an expert coder who is able to independently verify that a plugin is safe to use, only acquire plugins that have been signed by trusted members of the Nxt community.

4 Install a Plugin

When the Nxt Client Interface is launched, it automatically scans the directory nxt/html/ui/plugins for plugins. A plugin is a collection of files in a certain format, all contained within a subdirectory. For example, the Hello World plugin is already installed in the official Nxt Client as the subdirectory nxt/html/ui/plugins/hello_world.

Die Installation eines neuen Plugins beinhaltet das Downloaden der Zip-Datei von einer vertrauenwürdigen Quelle, die Validierung der und das Extrahieren der Zip-Datei in das nxt/html/ui/plugins Verzeichnis.

Folgend eine Beispielneuinstallation des "Hello World" Plugins durch die Anwendung des Terminals in einem Linux System. Die Vorgehensweise kann sich je nach Betriebssystem unterscheiden.

4.1 Downloade ein Plugin

Navigiere zum Plugins-Verzeichnis:

$ cd nxt/html/ui/plugins

Downloade die Zip-Datei des Plugins: $ curl -OL https://bitbucket.org/mystcoin/hello_world/downloads/hello_world.zip

4.2 Validiere die heruntergeladen Plugin-Datei

Durch die Validierung wird sichergestellt, dass es sich nicht um eine modifizierte Version handelt, als die die vom Entwickler bereitgestellt wurde. So wird vermieden, dass z.B. Trojaner und Viren auf das System eingeschleust werden.

4.2.1 Prüfne der Checksum

In diesem Beispiel wird die sha256 checksum gesprüft :

ed8b1c197feadea428aaa4625e356eb84f3b2ae7f6ddc1320a9a76d742392313
  • A checksum always should be provided by the author of the plugin. It uniquely identifies a particular version of the plugin and can validate that your downloaded copy of the plugin is identical to the official version.

4.2.2 Acquire the Checksum Signature

To ensure that the checksum itself is valid, it should be digitally signed. Nxt tokens provide a convenient digital signature mechanism.

In diesem Beispiel wurde ein Nxt Token für die checksum generiert durch mystcoin (der Autor dieser Anleitung):

89urfe4danhu1g49c07l522l3pavesdk87kul769mcvsnfjjqob222u8ci7bsvg2b0udq54enfliv8r3isfu4tdabpijqgpn7foenhmf8sogji1g21bqansbd7pge8hl5bgr1m8qvh9rt6l1ihoutqn40e03fl0l
  • Tokens should be provided by the author of the plugin and may additionally be provided by users of the plugin who are satisfied that it is safe to use. Several signatures generated by trusted code experts are better than one.
  • The signature may apply to a text message that includes the checksum along with other data. It only matters that the checksum is present somewhere in the message.

4.2.3 Validate the Checksum

The checksum can be validated using the Nxt Client as follows. First open the Nxt Token Generation / Validation pop-up entry form by clicking on the gear graphic in the upper right corner, then clicking on Generate Token:

Plugins settings token.png

Next, click on the Validate Token tab of the entry form and enter the checksum, or whatever text containing the checksum was signed, into the Data field and the token into the Token field. Finally, click on Validate:

Plugins token validated.png
  • The result of the validation check is displayed, indicating whether the checksum is properly signed and if so, which account signed it and when. A valid token implies that someone who knows the signing account's secret passphrase must have signed the checksum and that the checksum has not been altered since it was signed.
  • In this example the signing account is NXT-6GMG-FC5F-YSX6-8CVEL, owned by mystcoin (the author of this guide).

4.2.4 Validate the File

Returning to the terminal window, still in the nxt/html/ui/plugins directory where hello_world.zip resides, pipe the checksum and downloaded filename to the sha256sum utility as follows:

$ echo "ed8b1c197feadea428aaa4625e356eb84f3b2ae7f6ddc1320a9a76d742392313 hello_world.zip" | sha256sum -c

Das Dienstprogramm sollte folgendes Ergebnis zurückgeben:

hello_world.zip: OK
  • Dies validiert, dass die gedownloadete Datei genau diejenige ist, die mystcoin gezippt hatte.

4.3 Extract the Downloaded Plugin File

Now that the downloaded zip file has been validated, it can be extracted into the nxt/html/ui/plugins directory. In this example, however, the plugin is already present since it is packaged with the Nxt software. For the sake of this example, rename the existing hello_world directory:

$ mv hello_world hw

Nun extrahiere die gedownloadete Zip-Datei:

$ unzip hello_world.zip

Um sicherzustellen das das neuerstellte "hello_word" Verzeichnis, das gleiche ist wie die bereits existierende:

$ diff -r hello_world hw

If there are no differences, the diff command produces no output; otherwise, it displays differences between the two directories. If the official plugin is someday upgraded, there will be differences and there is no need to trust the version just downloaded. Simply restore the preexisting version:

$ mv hw hello_world

Wenn du der neu heruntergeladene Version vertraust, dann kannst du die bereits existierende Version stattdessen löschen:

$ rm -r hw
  • Beim Updaten eines existierenden Plugins, ist es ratsam die ältere Version zuvor zu löschen, bevor die aktuellere Version eingespielt wird.

4.4 Activate the Plugin

The Hello World plugin is initially deactivated. To activate it, edit the manifest.json file in the directory nxt/html/ui/plugins/hello_world and set the deactivated parameter to false. Then, gzip the manifest.json file with gzip -k manifest.json. The gzipped file manifest.json.gz is optional but takes precedence if present; so you may optionally delete the old manifest.json.gz rather than update it by gzipping manifest.json.

  • Nachdem das neue Plugin installiert wurde, musst du dich vom Nxt-Client ausloggen, sofern du eingeloggt warst. Der Nxt-Client wird dann alle aktiven Plugins neu laden, wenn du dich wieder einloggst.

5 Verwendung eines Plugins

5.1 Erlauben von Plugins

Um Plugins zu erlauben, klicke oben rechts im Nxt-Client auf die Steuergrafik und klicke "Einstellungen":

Plugins settings.png
  • Im Einstellungsbereich, wähle Ja beim Erlaube Plugins um Plugins zu erlauben.
  • Änderungen werden erst aktiv nachdem man sich ausgeloggt und neu eingeloggt hat.

5.2 Security Features

Plugins are loaded by the Nxt Client during login. Because plugins are potentially dangerous, the Nxt Client login screen has several plugin security features explained below. These features will not appear when there are no active plugins.

Plugins login.png

5.2.1 Sicherheitshinweis

Plugins security.png

5.2.2 Liste von aktiven Plugins

Beim Darüberfahren des Mauszeigers über die grauen "Aktive Plugins" Box wird eine Liste der derzeit aktiven Plugins angezeigt:

Plugins list.png

5.2.3 Disable Plugins during Session

Check this box before logging in if you are using a client that anyone else has had access to, or if there is any doubt about the active plugins. This control overrides the Enable Plugins setting for the current login session.

5.3 Prüfe Status eines Plugins

Klicke die Steuergrafik im Nxt-Client oben rechts und wähle "Plugins":

Plugins menu.png

Eine neue Ansicht erscheint, in der alle installierten Plugins und ihr aktueller Status aufgeführt sind:

Plugins status.png
  • During the login process, the nxt/html/ui/plugins directory is scanned for plugin subdirectories. Each plugin found is checked for validity, compatibility and launch status.
  • A plugin is Valid if it conforms to the standard file structure and content requirements for all plugins.
  • A plugin is compatible with the Nxt Client if its NRS Compatibility has the same major version number. Compatibility is indicated by a green background.
  • The Nxt Client version is displayed in the upper right corner of the Nxt Client Dashboard. The major version is the first two numbers. For example, version 1.5.6e is major version 1.5.
  • If the Nxt Client major version is smaller, the plugin is disabled and the Launch Status is Halted with a red background. The Nxt client should be updated.
  • If the Nxt Client major version is larger, the plugin is enabled but the Launch Status is Running with a gold background, indicating that the plugin should be updated.

5.4 Entferne oder deaktivere ein Plugin

Ein Plugin kann entfernt werden, indem das Pluginverzeichnis unter nxt/html/ui/plugins gelöscht wird. Um die Änderung zu aktivieren muss man sich aus- und dann wieder einloggen:

A plugin can be deactivated without removing it by editing the manifest.json file in the plugin subdirectory. Simply change the JSON deactivated field from false to true. Then, update the manifest.json.gz file with gzip -k manifest.json. Finally, log out of the Nxt Client.

  • Ein deaktivierte Plugin erscheint unter Plugins Status mit einem Status Deaktiviert.

5.5 Plugin Interface

For detailed instructions on the use of a plugin, refer to documentation provided by the author of the plugin. Typically, unless the author provides another means of access, the plugin is accessed through the Plugins menu item in the left-hand pane of the Nxt Client:

Plugins operate.png
  • Klicke auf "Hello World" um das Beispielplugin zu öffnen, welches den Status der Nxt Blockchain anzeigt: