These steps create a copy of the included template application that you can use as a starting point for working with the Interbit SDK.
To complete this section, make sure that you already have the requirements and the Interbit SDK installed.
-
Copy the
packages/interbit-templatefolder topackages/app-first:cp -R packages/interbit-template packages/app-first
-
Customize the app configuration:
In
packages/app-first/package.json, change the name of your app and the version string:{ "name": "app-the-new-thing", "version": "0.1.0", ... } -
Optional: Specify the app's port:
To avoid port conflicts when running multiple nodes, the port specification for an Interbit application must be specified in two locations.
-
Edit
packages/app-first/package.jsonand revise the line containinginterbit:startto change--port 5000to--port 6000, and save the file.For example:
"scripts": { "interbit:start": "interbit start --db-path ./db-interbit --port 6000 --dev --no-watch", }
-
Edit
packages/app-first/interbit.config.jsand revise the configuration with the new port.Locate the following section of configuration:
apps: { template: { peers: ['localhost:5000'], ... } }
Change the
5000to6000and save the file.
In these examples, we change the port to
6000but any value between1024and65000, that is not already in use by another process, should work. -
-
Optional: Add an identifier to the app's UI:
This step is only helpful if you run multiple Interbit nodes locally.
Add some identifying markup to
packages/app-first/src/App.js. For example, immediately before the<Grid>tag, insert<p>My first app!</p>.
That's it! You have created your first Interbit application. Next, see how to run your application.