Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

README: markdown syntax highlighting #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ by the RabbitMQ.

You need to start a mnevis ra node and trigger election:

```
```erlang
mnevis:start("my/ra/directory").
```

Expand All @@ -21,7 +21,7 @@ This will start a single node cluster. Not so useful.
To start a multi-node configuration, you will have to provide `initial_nodes`
environment variable to the `mnevis` application:

```
```erlang
[
{mnevis, [{initial_nodes, [node1, node2]}]}
].
Expand All @@ -33,23 +33,23 @@ If your application includes mnevis as a dependency, you will also have to
provide a ra directory, because it's used by ra on application start,
**this should be fixed in future ra versions**

```
```erlang
[
{ra, data_dir, "my/ra/directory"},
{mnevis, [{initial_nodes, [node1, node2]}]}
].
```

In this case you can run
```
```erlangerlang
application:ensure_all_started(mnevis),
mnevis_node:start().
```

To start a node.

To make sure all nodes are started, you can run
```
```erlang
{ok, _, _} = ra:members(mnevis_node:node_id()).
```

Expand All @@ -66,7 +66,7 @@ TODO: more info on configuration

You can run transactions the same way as in mnesia:

```
```erlang
{atomic, ok} = mnevis:transaction(fun() -> mnesia:write({foo, bar, baz}) end).
```

Expand All @@ -76,7 +76,7 @@ This project is trying to mimic the mnesia API as close as it makes sense.

For example, to run a transaction:

```
```erlang
%% Mnesia transaction
{atomic, ok} = mnesia:transaction(fun() ->
ok = mnesia:write({foo, bar, baz}),
Expand Down