Skip to content

Commit fb8e4bc

Browse files
authored
Update README.md
1 parent d6004cd commit fb8e4bc

1 file changed

Lines changed: 11 additions & 48 deletions

File tree

README.md

Lines changed: 11 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Freenet Mobile wrapper
1+
# Freenet Node wrapper
22

33
Freenet Mobile App's core component.
44

@@ -12,7 +12,7 @@ repositories {
1212
}
1313
1414
dependencies {
15-
implementation 'com.github.freenet-mobile:node-wrapper:0.5'
15+
implementation 'com.github.freenet-mobile:node-wrapper:1.0'
1616
}
1717
```
1818

@@ -26,7 +26,7 @@ repositories {
2626
}
2727
2828
// Freenet dependencies
29-
implementation ('com.github.freenet-mobile:node-wrapper:0.5') {
29+
implementation ('org.freenetproject.mobile:node-wrapper:1.0') {
3030
exclude group: 'org.freenetproject', module: 'freenet-ext'
3131
exclude group: 'net.java.dev.jna', module: 'jna'
3232
exclude group: 'net.java.dev.jna', module: 'jna-platform'
@@ -37,51 +37,14 @@ repositories {
3737

3838
## Usage
3939

40-
### Setup a node for the first time
41-
4240
```java
43-
import org.freenetproject.mobile.Installer;
44-
45-
/**
46-
* Install the node with default configuration and seed nodes both from resources. Some configuration
47-
* properties are dynamically calculated at runtime on the first startup (mostly related to directory paths).
48-
*
49-
* @param path Path to installation location.
50-
* @param seeds Input stream of seeds file.
51-
* @param config Input stream of default configuration.
52-
* @param bookmarks Input stream of default bookmarks
53-
*
54-
* @throws FileNotFoundException
55-
*/
56-
Installer.getInstance().install(
57-
context.getDir("data", Context.MODE_PRIVATE).getAbsolutePath(),
58-
res.openRawResource(R.raw.seednodes),
59-
res.openRawResource(R.raw.freenet),
60-
res.openRawResource(R.raw.bookmarks),
61-
Locale
62-
);
63-
64-
```
65-
66-
Notes:
67-
- Seednodes configuration should point to a seednodes.fref file. It could be the fred default seednodes.
68-
- Config is the freenet.ini configuration, with this config you control the node behaviour.
69-
- Bookmarks: Default fproxy bookmarks.
41+
import org.freenetproject.mobile.NodeControllerImpl;
7042

71-
### Starting a node
43+
// This method will install a freenet node at "/path/to/install/dir"
44+
// and setup it with default configurations. If a node configuration is found in
45+
// the given directory the configration will be picked up.
46+
nc = new NodeControllerImpl("/path/to/install/dir");
7247

73-
```java
74-
import org.freenetproject.mobile.Runner;
75-
76-
/**
77-
* Starts the node through NodeStarter unless it's already started.
78-
*
79-
* @param args Arguments to pass to the NodeStarter
80-
* @return -1 if the node is running or in transition
81-
* -2 if the node is already running
82-
* 0 if the node could be started
83-
*/
84-
Runner runner = Runner.getInstance();
85-
String[] args = { Installer.getInstance().getFreenetIniPath() };
86-
int ret = runner.start(args);
87-
```
48+
// The node will be started with the configuration at the given directory.
49+
nc.start();
50+
```

0 commit comments

Comments
 (0)